A Cookiecutter template to create a Serverless application using the AWS Serverless Application Model Command Line Interface (AWS SAM CLI) and .NET 6.
This template follows the default directory structure of Visual Studio solutions (including a test project), and also includes core utilities - Logging, Metrics and Tracing - for the AWS Lambda Powertools for .NET. To see how to leverage all of Powertools functionality vistit the documentation https://awslabs.github.io/aws-lambda-powertools-dotnet/.
Do not
git clone
this project unless you want to fork it to create your own project template. To create a Serverless application from this template follow the instructions below and use the AWS SAM CLI instead.
Install cookiecutter
command line:
- Pip users:
pip install cookiecutter
- Homebrew users:
brew install cookiecutter
- Windows or Pipenv users:
pipenv install cookiecutter
To use the AWS SAM CLI, you need the following tools.
- AWS SAM CLI - Install the AWS SAM CLI
- Docker - Install Docker community edition
You will need the following for local testing.
- .NET 6.0 - Install .NET 6.0
The sam init
command initializes a serverless application with an AWS SAM template, or a template or application you specify. Use the location
parameter to pass the location of this project
sam init --location gh:aws-samples/cookiecutter-aws-sam-dotnet
alternatively you can use Cookiecutter command:
cookiecutter gh:aws-samples/cookiecutter-aws-sam-dotnet`.
You'll be prompted a few questions to help this cookiecutter template to scaffold this project. After it's completed, you should see a new folder at your current path with the name of the project you specified as input.
NOTE: After you understand how cookiecutter works (cookiecutter.json, mainly), you can fork this repo and apply your own mechanisms to accelerate your development process and this can be followed for any programming language and OS.
Option | Description |
---|---|
solution_name |
Name of the Visual Studio solution file |
project_name |
Name of the Visual Studio project |
include_safe_deployment |
Sends by default 10% of traffic for every 1 minute to a newly deployed function using CodeDeploy + SAM integration - Linear10PercentEvery1Minute |
- This project has been generated with Cookiecutter
- This project has been modelled on the Cookiecutter SAM for Python Lambda functions
This sample code is made available under a modified MIT license. See the LICENSE file.