Select your cookie preferences

We use cookies and similar tools to enhance your experience, provide our services, deliver relevant advertising, and make improvements. Approved third parties also use these tools to help us deliver advertising and provide certain site features.

Amazon API Gateway canary deployment

Created with SnapAPI Gateway REST APIAWS Lambda

Create a serverless app using API Gateway and Lambda. Then create an API Gateway canary deployment

This pattern shows how to create an API Gateway canary deployment with a Lambda function behind an API Gateway REST API. Once the canary deployment is live, requests will be routed to the new and old version of the Lambda function at a rate of 50/50 using the Lambda alias from the APIGW stage variables to route traffic to the correct version.

< Back to all patterns


GitHub icon Visit the GitHub repo for this pattern.

Download

git clone https://github.com/aws-samples/serverless-patterns/ cd serverless-patterns/apigw-canary-deployment-cdk-java

Deploy

cdk deploy MyServerlessApplicationStackcdk deploy MyServerlessApplicationStack -c env=dev cdk deploy CanaryDeploymentStack


Testing

See the GitHub repo for testing instructions.

Cleanup

1. Delete the Canary Deployment stack:
cdk destroy CanaryDeploymentStack
2. Delete the Serverless application stack.
cdk destroy MyServerlessApplicationStack

Muhammed Soyer

Presented by Muhammed Soyer

I am a Technical Account Manager at AWS with a background of software development.

Follow on LinkedIn