Hammer
Hammer

Reputation: 8888

AWS Lambda and Gateway API - blue/green deployment with cloudformation

When deploying the lambda function with Gateway API using cloudformation template, I want to put Gateway APIs created with different stages behind route53, so can use the weighted trafficking for blue/green deployment. Is it possible to automate the whole process without manual logging to the console to configure?

Upvotes: 4

Views: 3307

Answers (3)

Coin Graham
Coin Graham

Reputation: 1584

Blue/Green and Canary deployments are now supported by AWS API Gateway.

Another traffic shifting pattern is enabling blue/green deployments. This near zero-downtime release enables traffic to shift to the new live environment (green) while still keeping the old production environment (blue) warm in case a rollback is necessary. Since API Gateway allows you to define what percentage of traffic is shifted to a particular environment; this style of deployment can be an effective technique. Since blue/green deployments are designed to reduce downtime, many customers adopt this pattern for production changes.

https://docs.aws.amazon.com/wellarchitected/latest/serverless-applications-lens/bluegreen-deployments.html

Upvotes: 2

Mrk Fldig
Mrk Fldig

Reputation: 4486

@Bob,

I've seen a few answers from you on this, I have asked on another, I have a working solution that relies on the SWITCH being the basepath mapping on the APIG stage.

Although AWS just introduced Canary but it relies on CodeDeploy which a lot of us don't use when using things like the Serverless framework.

The idea is simple, when you deploy you switch your basepath mapping between stages(blue/green) if you fire an SNS event for every non 2XX error once you reach a certain threshold you can simply turn the basepath mapping back and it works instantly?

Is there any reason why this wouldn't work?

Upvotes: 0

Bob Kinney
Bob Kinney

Reputation: 9020

You won't be able to do this. Your Route53 aliases will not be understood by API Gateway. There currently isn't an out-of-the box blue/green solution for API gateway and Lambda.

Upvotes: 5

Related Questions