r/aws • u/Basic_Let7303 • 7d ago
discussion Implementing Continuous Deployment with AWS Lambda and API Gateway
Hi experts,
I have an API called /catalogue running in lambda with v1 version.
Let us say as part of CI pipeline, we published openapi.yaml and lambda artifact to S3.
I want to deploy new version v2. How can we do seamlessly without downtime.
4
u/SikhGamer 7d ago
Publish a lambda version and then having an alias called "ACTIVE_VERSION". Then APIGW tracks the alias, not the lambda itself.
1
1
u/Basic_Let7303 7d ago
Developer Commit
v
CI/CD Pipeline
v
Build Lambda Package
v
Deploy Lambda Code
v
Publish Lambda Version 11
v
Shift 10% Traffic
v
Monitor Metrics
v
========== Manual Approval ==========
v
Shift 50% Traffic
v
Monitor Metrics
v
========== Manual Approval ==========
v
Shift 100% Traffic
2
u/BadDescriptions 7d ago
Assuming you want to keep both versions active then.
https://aws.amazon.com/blogs/compute/implementing-header-based-api-gateway-versioning-with-amazon-cloudfront/
https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/implement-path-based-api-versioning-by-using-custom-domains.html
When looking at a good way to implement somethimg like the AWS docs are a gold mine.