This is the plugin of
Serverless framework which let's to create canary deployment for API Gateway.
This addresses two things:
- Canary deployments for API Gateway
- Concrete lambda function version binding to API Gateway (instead of $LATEST, it will take current deployed lambda version)
Second point above enables API Gateway canary deployments since it binds concrete lambda version to concrete API Gateway deployment. It allows base version to point to concrete deployment, whilst canary can point to not yet promoted version. Using this principle, Blue/Green deployment can be achieved, meaning that canary can take either 100% or 0% traffic if needed.
npm install --save-dev serverless-apigw-canary-settings, and add this plugin to
serverless.yml. It will hook to package phase, meaning either
deploy phases will trigger this plugin if used as specified below.
Add custom settings for canary in
custom: apiGatewayDeployment: canary: trafficInPercentages: 0
serverless deploy --canaryDeployment true to deploy API Gateway to canary deployment.
true/false value in order to allow enable canary deployments for API Gateway.
If value is
custom.apiGatewayDeployment settings are read from
serverless.yml file and applied for canary deployment.
Otherwise, no action is taken.