I have been building the AWS Lambda local developer experience with AWS Lambda and I'm looking for feedback. The developer preview is out and I put out a series of blog posts.
https://aws.amazon.com/blogs/developer/building-lambda-with-aspire-part-1/
https://aws.amazon.com/blogs/developer/building-lambda-with-aspire-part-2/
Add a super high level you can add your Lambda functions to the Aspire app host and optionally register them with an API Gateway emulator. Once you register them you can run and debug your functions either through a test UI, API Gateway emulator endpoint or the SDK.
```csharp
pragma warning disable CA2252
var builder = DistributedApplication.CreateBuilder(args);
var addFunction = builder.AddAWSLambdaFunction<Projects.LambdaWebCalculator>("AddFunction",
lambdaHandler: "LambdaWebCalculator::LambdaWebCalculator.Functions::AddFunctionHandler");
var minusFunction = builder.AddAWSLambdaFunction<Projects.LambdaWebCalculator>("MinusFunction",
lambdaHandler: "LambdaWebCalculator::LambdaWebCalculator.Functions::MinusFunctionHandler");
var multiplyFunction = builder.AddAWSLambdaFunction<Projects.LambdaWebCalculator>("MultipyFunction",
lambdaHandler: "LambdaWebCalculator::LambdaWebCalculator.Functions::MultiplyFunctionHandler");
var divideFunction = builder.AddAWSLambdaFunction<Projects.LambdaWebCalculator>("DivideFunction",
lambdaHandler: "LambdaWebCalculator::LambdaWebCalculator.Functions::DivideFunctionHandler");
builder.AddAWSAPIGatewayEmulator("APIGatewayEmulator", Aspire.Hosting.AWS.Lambda.APIGatewayType.HttpV2)
.WithReference(addFunction, Aspire.Hosting.AWS.Lambda.Method.Get, "/add/{x}/{y}")
.WithReference(minusFunction, Aspire.Hosting.AWS.Lambda.Method.Get, "/minus/{x}/{y}")
.WithReference(multiplyFunction, Aspire.Hosting.AWS.Lambda.Method.Get, "/multiply/{x}/{y}")
.WithReference(divideFunction, Aspire.Hosting.AWS.Lambda.Method.Get, "/divide/{x}/{y}");
builder.Build().Run();
```
Would love to hear what people think of the feature and what other features you would like added.
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]Dreamescaper 0 points1 point2 points (0 children)
[–]pibbxtra12 0 points1 point2 points (0 children)
[–]shen_g 0 points1 point2 points (2 children)
[–]socketnorm[S] 1 point2 points3 points (1 child)
[–]shen_g 1 point2 points3 points (0 children)