aws / aws/aws-lambda-dotnet

Support extending Amazon.Lambda.AspNetCoreServer.Hosting handler

Open
#1,551 5 comments 3 reactions 0 assignees View on GitHub
feature-request module/aspnetcore-support p1 queued
Dominant language
C#
Stars
1.7k
Forks
503
Avg merge
1d 5h
Merged PRs (30d)
18

Description

### Describe the feature

Provide some way to annotate or wrap the abstracted handler provided by Amazon.Lambda.AspNetCoreServer.Hosting so that third party tooling that requires interaction with the handler can be used.

### Use Case

Many observability and utility tools for .NET (OpenTelemetry and AWS Lambda Powertools to name the most prominent) require either directly wrapping the Lambda handler or adding annotations to it.

### Proposed Solution

Some kind of override or extension method that would allow for slapping annotations or boilerplate around the handler without sacrificing the convenience of Amazon.Lambda.AspNetCoreServer.Hosting. Maybe a delegate in the registration method (AddAWSLambdaHosting) to allow adding some arbitrary code executed before the handler.

### Other Information

Amazon.Lambda.AspNetCoreServer.Hosting is an amazing package and solution that lowers the barrier to entry for moving non-serverless .NET APIs to AWS Lambda with very little overhead. I'm excited about this because it can help increase adoption of serverless in my teams and be less intimidating.

However, we need to be able to use observability tooling to go to production, and this is the only real show-stopper for us.

I'm not totally against using the less abstracted method with LambdaEntryPoint / LocalEntryPoint but we've already consolidated Program.cs and Startup.cs using the minimal API startup model and we would have to undo that in all of our services to revert back to this pattern.

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### AWS .NET SDK and/or Package version used

Amazon.Lambda.AspNetCoreServer.Hosting

### Targeted .NET Platform

.NET 6

### Operating System and version

Any

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.