AWS Lambda Canary Rollback
Reset a Lambda function alias to route all traffic back to the previous version after a failed canary deployment.
The AWS Lambda Canary Rollback step resets the weighted alias to route 100% of traffic back to the previous function version and removes the newly published version. Harness adds this step automatically to the rollback section of a canary stage. It runs automatically when any step in the stage fails.
Before you begin
This step is automatically added to canary stages. You do not need to add it manually unless you are building a custom rollback flow.
A Lambda infrastructure with an AWS connector and region. Go to Lambda infrastructure.
Step YAML
- name: AWS Lambda Canary Rollback
id: awsLambdaCanaryRollbackStep
template:
uses: awsLambdaCanaryRollbackStepThe step uses no explicit with: inputs — infrastructure is resolved automatically from the stage context.
Configure the step
Infrastructure Configuration
All values are derived from the infrastructure definition. You do not need to change them when the step is wired to a correctly configured infrastructure.
AWS Connector
${{infra.connectorRef}}
The AWS connector resolved from the infrastructure definition. Used to update the alias weights and remove the new version.
AWS Region
${{infra.region}}
The AWS region resolved from the infrastructure definition.
What the step does
The rollback step reads state from the last successful execution of this stage — not from the failed run. When it runs:
Reads the function name and previous version number from the last successful stage execution.
Resets the weighted alias to route 100% of traffic back to the previous version.
Deletes the newly published version that was created by the Canary Deploy step.
After rollback, the alias points exclusively to the last known good version and all traffic is fully restored to it.
This behavior applies to both ZIP artifact and ECR image canary deployments. For ECR functions where no alias manifest was declared in the service, the canary deploy step still created a managed alias internally — the rollback step resets that alias using the same mechanism.
Advanced settings
Timeout duration: Maximum time the step is allowed to run before being terminated.
On failure: Define what happens if the rollback step itself fails.
Strategy: Configure a looping strategy.
Conditional execution: Run this step only when a condition is true.
Next steps
Go to Lambda canary deployment for the full canary flow, including when rollback triggers.
Go to AWS Lambda Canary Deploy for the deploy step that this step rolls back.
Last updated
Was this helpful?