This Repository contents sample source code that shows how to streamline building, packaging, and publishing .NET Lambda functions using AWS CDK with C#.
Prerequisites:
- Visual Studio Code (or your preferred IDE).
- AWS account.
- .NET 6 SDK
- AWS Cloud Development Kit (CDK) (https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html).
- GIT (https://git-scm.com/download).
- Docker
To learn how to implement CDK C# to build, package and publish lambda code follow the implementation on the file infra/src/Infra/InfraStack.cs.
Execute the following commands to deploy and test the solution
Deploy:
cd /infra
cdk deploy --profile <your AWS account profile alias>
Test:
Once the deployment is complete, copy the endpoint from the terminal output and make HTTP GET Request. The format of the endpoint should be similar to https://xxxyyyzzz.execute-api.us-east-1.amazonaws.com/prod/.
curl https://xxxyyyzzz.execute-api.us-west-2.amazonaws.com/prod/
curl https://xxxyyyzzz.execute-api.us-west-2.amazonaws.com/prod/functiontwo
curl https://xxxyyyzzz.execute-api.us-west-2.amazonaws.com/prod/functionthree
To learn more about the implementation read the blog post Build, package, and publish .NET C# Lambda functions with the AWS CDK
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.