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.

@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.

2 participants