Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 2 tasks
vlesierse opened this issue Dec 5, 2022 · 4 comments
Open
1 of 2 tasks
Assignees
Labels
@aws-cdk/aws-lambda Related to AWS Lambda effort/large Large work item – several weeks of effort feature-request A feature should be added or improved. p2

Comments

@vlesierse
Copy link
Contributor

vlesierse commented Dec 5, 2022

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

@vlesierse vlesierse added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Dec 5, 2022
@github-actions github-actions bot added the @aws-cdk/aws-lambda Related to AWS Lambda label Dec 5, 2022
@peterwoodworth
Copy link
Contributor

Thanks for the request @vlesierse, this would be an excellent addition.

Due to the size and effort this would require, I think we are going to require an RFC if this were to be implemented. If you or anyone else is interested, feel free to submit an issue in the RFC repo so that we can talk at length about the design that will go into this construct.

@peterwoodworth peterwoodworth added p2 effort/large Large work item – several weeks of effort and removed needs-triage This issue or PR still needs to be triaged. labels Dec 5, 2022
@vlesierse
Copy link
Contributor Author

@peterwoodworth I'm currently review the RFC process and will create one accordingly.

@vlesierse
Copy link
Contributor Author

vlesierse commented Nov 13, 2023

@peterwoodworth I'm bumping this now as it appears that the RFC process is closed.

As the process was described, I have created this RFC earlier this year. Meanwhile I have put the construct and placed it successfully on Construct Hub and getting some traction, but I was hoping to put this in the standard library as I believe is belongs there.

How to proceed? Happy to create a PR with the construct as separate package, marked as Alpha and have responsibility of maintaining.

@jkuek
Copy link

jkuek commented Nov 13, 2023

I have a TriggerFunction that I'm converting to C# from Node and have run into this issue. I'm not sure yet how to resolve it and had to resort to running "dotnet lambda package" externally before "cdk deploy"

Built-in support for this in CDK would be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda Related to AWS Lambda effort/large Large work item – several weeks of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants