Skip to content

New pattern: lambda-web-weighted-rollout - weighted revision rollouts for a Lambda Web Function - #3443

Open
sshekghub wants to merge 3 commits into
aws-samples:mainfrom
sshekghub:sshekaz-lambda-web-weighted-rollout
Open

sshekghub wants to merge 3 commits into
aws-samples:mainfrom
sshekghub:sshekaz-lambda-web-weighted-rollout

Conversation

@sshekghub

@sshekghub sshekghub commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:
This pattern shows how to roll out a new release to an AWS Lambda Web Function gradually: canary, shift, promote and rollback, using AutoDeploymentMode: Disabled and RevisionWeights. The Lambda documentation recommends this approach for production. I couldn't find an existing pattern that implements it as infrastructure as code.

  • Two fixed revision slots (blue and green) behind one IamAuth endpoint. Stack parameters set each slot's S3 code version and traffic weight, so the template always matches what's serving traffic.
  • New code only ever goes into the slot with 0% traffic. The other slot keeps serving and stays the rollback target.
  • deploy.sh runs the release with canary PCT, shift PCT, promote, rollback and status. It reads the current state from the stack, so users never handle revision IDs.
  • CloudFront with OAC sits in front. The page shows which slot served each request and can sample the live traffic split.
  • Code bucket policy scoped to this stack's revisions, log groups with retention, endpoint throttling and scaling caps, and a full versioned-bucket cleanup.

Tested end to end : first deploy, canary, shift, promote, rollback after promote, and abort during a canary.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants