Skip to content

(aws-lambda): Support for .NET Lambda functions with included bundling #23236

@vlesierse

Description

@vlesierse

Describe the feature

This is a proposal to support .NET Lambda functions like what already exists for NodeJS, Python & Go. This construct will include the Lambda function definition with predefined bundling support locally or using a Docker container.

Use Case

As a .NET developer I would like to build serverless Lambda application with .NET and deploy this application using AWS CDK. It is painful to design a build process which first need to build/test and package one or more Lambda functions in my project and then use lambda.Code.fromAsset(path.join(__dirname, 'out', 'package.zip')) to point to those packages. This has been beautifully solved with the aws-lambda-go, aws-lambda-nodejs and aws-lambda-python constructs and I would like to have the same experience with .NET.

Proposed Solution

This functionality can implemented in a separate package called aws-lambda-dotnet. The code will look like this;

import * as dotnet from 'aws-cdk-lib/aws-lambda-dotnet';
...
new dotnet.DotNetFunction(this, 'WebApiFunction', {
  projectDir: 'src/Serverless.WebApi'
});
...

Other Information

I have already got started with this in my fork and I'm happy to continue with implementing the integration tests, documentation, collecting design feedback and submit the PR.

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.53.0

Environment details (OS name and version, etc.)

macOS Monterey v12.6

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-lambdaRelated to AWS Lambdaeffort/largeLarge work item – several weeks of effortfeature-requestA feature should be added or improved.p2

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions