capabilities.work

Shift Canary Traffic Across Two Versions

A 3-step recipe with AWS Lambda. We can help you get access.

Recipe · 3 steps

Shift Canary Traffic Across Two Versions

Re-weight an existing alias between its primary version and a canary version.

  1. Read the alias to capture the version it currently points at and its RevisionId, which guards the update against a concurrent release.
  2. Set the primary version and the weighted split in a single update. AdditionalVersionWeights is replaced wholesale, so an empty map removes the canary and returns every invocation to the primary version.
  3. Read the alias back so the routing configuration Lambda stored is observed directly, confirming the canary is carrying the intended share before the rollout proceeds.
What you'll need to have ready
  • functionName: The name or ARN of the function whose alias is being re-weighted.
  • aliasName: The alias carrying production traffic (e.g. prod).
  • primaryVersion: The version the alias points at, which receives all invocations not claimed by additionalVersionWeights.
  • additionalVersionWeights: Map of version number to the share of invocations it receives, between 0.0 and 1.0 (e.g. {"7": 0.1} sends 10 percent to version 7 and leaves 90 percent on prima
  • shiftDescription: Description recorded against the alias for this shift (e.g. "canary 10%").
For your developer

Arazzo workflow aws-lambda:canary-traffic-shift, 3 operations: GetAlias → UpdateAlias → GetAlias. Specs on APIs.io.