I'm deploying a .NET Core Web API project into Amazon Lambda using this tutorial:
Creating .NET Core AWS Lambda Projects without Visual Studio
I have successfully executed the command stack and got the sample Web API app running in Lambda behind an API Gateway:
dotnet new lambda.AspNetCoreWebAPI
dotnet restore
dotnet build
dotnet lambda deploy-serverless -sn stackname -sb bucketname --profile-location ./credentials
So far so good, and I can get to the app via the execute-api.eu-west-2.amazonaws.com
address and it works.
However, I want to take advantage of the lambda features around versioning so that every time I deploy, it creates a new deployment and allows me to have the API Gateway stages pointing at differing versions of the lambda.
However there is only one version, $latest
, which always points to the last deployment.
How can I make it have an incrementing version number with the deployments instead of it always just overwriting the $latest
?