From f335b54c8b2f42bf2b09feb96d9ac58db1482ab6 Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Sat, 19 Apr 2025 10:02:53 -0400 Subject: [PATCH 1/2] Update README.md (#65) (#66) --- src/Aspire.Hosting.AWS/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Aspire.Hosting.AWS/README.md b/src/Aspire.Hosting.AWS/README.md index c39df7a..64384a1 100644 --- a/src/Aspire.Hosting.AWS/README.md +++ b/src/Aspire.Hosting.AWS/README.md @@ -198,11 +198,11 @@ When adding Lambda functions to your .NET Aspire application, the integration au You can customize the tool installation behavior by calling `AddAWSLambdaServiceEmulator` before any `AddAWSLambdaFunction` calls: ```csharp -builder.AddAWSLambdaServiceEmulator(options => +builder.AddAWSLambdaServiceEmulator(new LambdaEmulatorOptions { - options.DisableAutoInstall = false; - options.OverrideMinimumInstallVersion = "0.1.0"; - options.AllowDowngrade = false; + DisableAutoInstall = false, + OverrideMinimumInstallVersion = "0.1.0", + AllowDowngrade = false }); // Add Lambda functions after configuring the emulator @@ -217,7 +217,7 @@ The `LambdaEmulatorOptions` provide the following customization: ### API Gateway Local Emulation -To add an API Gateaway emulator to your .NET Aspire AppHost, use the `AddAPIGatewayEmulator` method. +To add an API Gateaway emulator to your .NET Aspire AppHost, use the `AddAWSAPIGatewayEmulator` method. ```csharp #pragma warning disable CA2252 // This API requires opting into preview features @@ -232,12 +232,12 @@ var addFunction = builder.AddAWSLambdaFunction( lambdaHandler: "WebAddLambdaFunction"); // Configure API Gateway emulator -builder.AddAPIGatewayEmulator("APIGatewayEmulator", APIGatewayType.HttpV2) +builder.AddAWSAPIGatewayEmulator("APIGatewayEmulator", APIGatewayType.HttpV2) .WithReference(rootWebFunction, Method.Get, "/") .WithReference(addFunction, Method.Get, "/add/{x}/{y}"); ``` -The `AddAPIGatewayEmulator` method requires: +The `AddAWSAPIGatewayEmulator` method requires: - A name for the emulator resource - The API Gateway type (`Rest`, `HttpV1`, or `HttpV2` ) @@ -260,7 +260,7 @@ Here's an example of how to set up an API Gateway emulator with a wildcard path: var aspNetCoreLambdaFunction = builder.AddAWSLambdaFunction("Resource", "AWSServerless"); // Configure the API Gateway emulator -builder.AddAPIGatewayEmulator("APIGatewayEmulator", APIGatewayType.Rest) +builder.AddAWSAPIGatewayEmulator("APIGatewayEmulator", APIGatewayType.Rest) .WithReference(aspNetCoreLambdaFunction, Method.Any, "/") .WithReference(aspNetCoreLambdaFunction, Method.Any, "/{proxy+}"); From 73dba41df62083d46ac3411ded773f1b5d7ec8f0 Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Wed, 11 Jun 2025 13:22:57 -0400 Subject: [PATCH 2/2] update test wait time (#93) (#94) --- .../Aspire.Hosting.AWS.Integ.Tests/Lambda/PlaygroundE2ETests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Aspire.Hosting.AWS.Integ.Tests/Lambda/PlaygroundE2ETests.cs b/tests/Aspire.Hosting.AWS.Integ.Tests/Lambda/PlaygroundE2ETests.cs index f7643d8..13e2c59 100644 --- a/tests/Aspire.Hosting.AWS.Integ.Tests/Lambda/PlaygroundE2ETests.cs +++ b/tests/Aspire.Hosting.AWS.Integ.Tests/Lambda/PlaygroundE2ETests.cs @@ -70,7 +70,7 @@ await resourceNotificationService await sqsClient.SendMessageAsync(queueUrl, "themessage", cancellationToken.Token); // Wait for the Lambda function to consume the message it gets deleted. - await Task.Delay(5000); + await Task.Delay(20000); var queueAttributesRepsonse = await sqsClient.GetQueueAttributesAsync(new GetQueueAttributesRequest { QueueUrl = queueUrl, AttributeNames = new List { "All" } }); Assert.Equal(0, queueAttributesRepsonse.ApproximateNumberOfMessages + queueAttributesRepsonse.ApproximateNumberOfMessagesNotVisible); }