Skip to content

Conversation

@normj
Copy link
Member

@normj normj commented Feb 11, 2026

Issue #, if available:
aws/integrations-on-dotnet-aspire-for-aws#136

Description of changes:
Added the --lambda-emulator-https-port and --api-gateway-emulator-https-port switches to configure what HTTPS ports to listen to. Also added corresponding environment variables LAMBDA_WEB_UI_HTTPS_PORT and API_GATEWAY_EMULATOR_HTTPS_PORT that the Aspire integration will use to configure the ports.

To use HTTPS the user has to make sure the environment has certs configured for the host which is usually localhost. Aspire will automatically take care of setting up certs and set the SSL_CERT_DIR environment variable which ASP.NET Core will pick up and automatically use.

For the Lambda emulator side the --lambda-emulator-port still must always be set because the Lambda Runtime API that Lambda functions call only goes over HTTP. For API Gateway you can set either --api-gateway-emulator-port or --api-gateway-emulator-https-port or both.

Testing with HTTPS ports through xunit is tricky and I doubt our CI system will have certs in place so I relied on manually testing building the test tool into NuGet packages and testing it directly along with the Aspire integration.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds configuration knobs for HTTPS listeners in the Lambda Test Tool (Lambda UI emulator and API Gateway emulator), primarily to support Aspire integration scenarios where certificates can be provisioned automatically.

Changes:

  • Add --lambda-emulator-https-port and --api-gateway-emulator-https-port CLI options (and corresponding env var parsing in RunCommand).
  • Bind the Lambda UI emulator and API Gateway emulator to HTTPS URLs when configured (and prefer HTTPS for the returned/logged ServiceUrl).
  • Add an .autover patch changelog entry for the TestTool package.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Processes/TestToolProcess.cs Adds optional HTTPS URL binding for the Lambda UI emulator and prefers HTTPS for ServiceUrl.
Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Processes/ApiGatewayEmulatorProcess.cs Adds optional HTTP/HTTPS URL binding for API Gateway emulator and prefers HTTPS for logging/ServiceUrl.
Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Commands/Settings/RunCommandSettings.cs Introduces new CLI options and documentation for HTTPS ports.
Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Commands/RunCommand.cs Adds env var constants/parsing and enables starting API Gateway emulator when HTTPS port is provided.
.autover/changes/27264eba-d94e-4190-a5ab-91c895db6b45.json Records changelog message for the patch release.
Comments suppressed due to low confidence (1)

Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Commands/RunCommand.cs:84

  • There are existing unit tests for RunCommand.ExecuteAsync, but none cover the new HTTPS-only API Gateway startup path (e.g., ApiGatewayEmulatorHttpsPort set with ApiGatewayEmulatorPort null, or configuring via API_GATEWAY_EMULATOR_HTTPS_PORT). Add a test to ensure the command doesn't throw and that the emulator becomes reachable when only the HTTPS port is configured (or at least that settings validation allows this configuration).
            if (settings.ApiGatewayEmulatorPort.HasValue || settings.ApiGatewayEmulatorHttpsPort.HasValue)
            {
                if (settings.ApiGatewayEmulatorMode is null)
                {
                    throw new ArgumentException("When --api-gateway-emulator-port or --api-gateway-emulator-https-port is set the --api-gateway-emulator-mode must be set to configure the mode for the API Gateway emulator.");
                }

                var apiGatewayEmulatorProcess =
                    ApiGatewayEmulatorProcess.Startup(settings, cancellationTokenSource.Token);
                tasks.Add(apiGatewayEmulatorProcess.RunningTask);
            }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +61 to +69
/// The port number used for the test tool's API Gateway emulator. If a port is specified the API Gateway emulator will be started. The --api-gateway-mode
/// also be set when setting the API Gateway emulator port.
/// </summary>
[CommandOption("--api-gateway-emulator-port <PORT>")]
[Description("The port number used for the test tool's API Gateway emulator.")]
public int? ApiGatewayEmulatorPort { get; set; }

/// <summary>
/// The https port number used for the test tool's API Gateway emulator. If a port is specified the API Gateway emulator will be started. The --api-gateway-mode must
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The XML doc for ApiGatewayEmulatorPort references the wrong option name (--api-gateway-mode) and also has a grammatical omission ("also be set"). This is user-facing documentation and should match the actual switch --api-gateway-emulator-mode and say it "must" be set.

Suggested change
/// The port number used for the test tool's API Gateway emulator. If a port is specified the API Gateway emulator will be started. The --api-gateway-mode
/// also be set when setting the API Gateway emulator port.
/// </summary>
[CommandOption("--api-gateway-emulator-port <PORT>")]
[Description("The port number used for the test tool's API Gateway emulator.")]
public int? ApiGatewayEmulatorPort { get; set; }
/// <summary>
/// The https port number used for the test tool's API Gateway emulator. If a port is specified the API Gateway emulator will be started. The --api-gateway-mode must
/// The port number used for the test tool's API Gateway emulator. If a port is specified the API Gateway emulator will be started. The --api-gateway-emulator-mode
/// must also be set when setting the API Gateway emulator port.
/// </summary>
[CommandOption("--api-gateway-emulator-port <PORT>")]
[Description("The port number used for the test tool's API Gateway emulator.")]
public int? ApiGatewayEmulatorPort { get; set; }
/// <summary>
/// The https port number used for the test tool's API Gateway emulator. If a port is specified the API Gateway emulator will be started. The --api-gateway-emulator-mode must

Copilot uses AI. Check for mistakes.
Comment on lines +61 to +74
/// The port number used for the test tool's API Gateway emulator. If a port is specified the API Gateway emulator will be started. The --api-gateway-mode
/// also be set when setting the API Gateway emulator port.
/// </summary>
[CommandOption("--api-gateway-emulator-port <PORT>")]
[Description("The port number used for the test tool's API Gateway emulator.")]
public int? ApiGatewayEmulatorPort { get; set; }

/// <summary>
/// The https port number used for the test tool's API Gateway emulator. If a port is specified the API Gateway emulator will be started. The --api-gateway-mode must
/// also be set when setting the API Gateway emulator port. To use HTTPS the environment must be configured with certs
/// for the host specified in <see cref="LambdaEmulatorHost"/>.
/// </summary>
[CommandOption("--api-gateway-emulator-https-port <PORT>")]
[Description("The port number used for the test tool's API Gateway emulator.")]
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The XML doc for ApiGatewayEmulatorHttpsPort repeats the same issue as the HTTP port docs: it references --api-gateway-mode (not an actual option) and the second line talks about setting the emulator port rather than the HTTPS port. Please update the text to reference --api-gateway-emulator-mode and clarify the requirement when the HTTPS port switch is used.

Suggested change
/// The port number used for the test tool's API Gateway emulator. If a port is specified the API Gateway emulator will be started. The --api-gateway-mode
/// also be set when setting the API Gateway emulator port.
/// </summary>
[CommandOption("--api-gateway-emulator-port <PORT>")]
[Description("The port number used for the test tool's API Gateway emulator.")]
public int? ApiGatewayEmulatorPort { get; set; }
/// <summary>
/// The https port number used for the test tool's API Gateway emulator. If a port is specified the API Gateway emulator will be started. The --api-gateway-mode must
/// also be set when setting the API Gateway emulator port. To use HTTPS the environment must be configured with certs
/// for the host specified in <see cref="LambdaEmulatorHost"/>.
/// </summary>
[CommandOption("--api-gateway-emulator-https-port <PORT>")]
[Description("The port number used for the test tool's API Gateway emulator.")]
/// The port number used for the test tool's API Gateway emulator. If a port is specified the API Gateway emulator will be started.
/// </summary>
[CommandOption("--api-gateway-emulator-port <PORT>")]
[Description("The port number used for the test tool's API Gateway emulator.")]
public int? ApiGatewayEmulatorPort { get; set; }
/// <summary>
/// The HTTPS port number used for the test tool's API Gateway emulator. If a port is specified the API Gateway emulator will be started. The --api-gateway-emulator-mode option must
/// be set to a mode that enables HTTPS when this HTTPS port switch is used. To use HTTPS the environment must be configured with certs
/// for the host specified in <see cref="LambdaEmulatorHost"/>.
/// </summary>
[CommandOption("--api-gateway-emulator-https-port <PORT>")]
[Description("The HTTPS port number used for the test tool's API Gateway emulator.")]

Copilot uses AI. Check for mistakes.
/// for the host specified in <see cref="LambdaEmulatorHost"/>.
/// </summary>
[CommandOption("--lambda-emulator-https-port <PORT>")]
[Description("The port number used for the test tool's web interface.")]
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Description attribute for --lambda-emulator-https-port is identical to the HTTP port description and doesn't mention HTTPS. This shows up in CLI help; please adjust it to explicitly say it configures the HTTPS endpoint / web UI HTTPS port.

Suggested change
[Description("The port number used for the test tool's web interface.")]
[Description("The HTTPS port number used for the test tool's web interface (web UI HTTPS endpoint).")]

Copilot uses AI. Check for mistakes.
/// for the host specified in <see cref="LambdaEmulatorHost"/>.
/// </summary>
[CommandOption("--api-gateway-emulator-https-port <PORT>")]
[Description("The port number used for the test tool's API Gateway emulator.")]
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Description attribute for --api-gateway-emulator-https-port doesn't mention HTTPS (it repeats the HTTP port text). Since this is user-facing CLI help, update it to clarify this switch configures the HTTPS listener for the API Gateway emulator.

Suggested change
[Description("The port number used for the test tool's API Gateway emulator.")]
[Description("The HTTPS port number used for the test tool's API Gateway emulator listener.")]

Copilot uses AI. Check for mistakes.
@normj normj force-pushed the normj/testtool-https branch from e6be9e7 to 03cca33 Compare February 11, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant