This repo is a working implementation of AWS Serverless Application Model (SAM) deployment preferences.
The majority of interest will be in the deploy.sam.yaml
This file contains the deployment information for a simple hello-world lambda function. This contains example of how to enable:
- Canary/Linear Deployments
- PreTraffic lambda function validation (Post traffic enabled the same way)
- Alarms to trigger automated cloudformation rollback based on error threshold
- Conditions to control when these
To test out these deployment strategies, recommendation is to deploy into nbos-sandbox-np. The conditions in the same template have excluded dev so you can swap between dev/tst in sandbox to see the differences (stg does not exist in sandbox)
- dev will be a quick deployment
- tst will be a safe deployment with all options enabled
- GNU Make > 4.2.1
- aws-cli > 1.14.60
- node version > 11.1.0
- npm version > 6.4.1
- saml2aws > 2.10.0
- direnv
Build commands are configured in the Makefile:
make build
To deploy this locally:
- Have a valid AWS Account cli session configured (saml2aws)
- Have your environment variables configured (direnv or manually)
make deploy
More information on Deployment Preferences is available at:
- Versent Confluence
- SAM Safe Lambda Deployments
- AWS Blog - Implmenting Canary Deployments