AWS Lambda Rolling Rollback
Restore a Lambda function to its previous version after a failed rolling deployment.
The AWS Lambda Rolling Rollback step redeploys the previous function version after a failed rolling deployment. Harness adds this step automatically to the rollback section of a rolling stage. It runs automatically when the Rolling Deploy step fails.
Step YAML
- name: AWS Lambda Rolling Rollback
id: awsLambdaRollingRollbackStep
template:
uses: awsLambdaRollingRollbackStepThe step uses no explicit with: inputs — infrastructure is resolved automatically from the stage context.
Before you begin
This step is automatically added to rolling 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.
Configure the step
Infrastructure Configuration
All values are derived from the infrastructure definition.
AWS Connector
${{infra.connectorRef}}
The AWS connector resolved from the infrastructure definition. Used to authenticate to Lambda and restore the previous 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.
Re-deploys the function to that version.
If the service included an alias definition (
AwsLambdaFunctionAliasDefinition), also repoints the alias back to the restored version at 100% weight. If no alias was involved, only the function version is restored.
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 rolling deployment for the full rolling flow, including when rollback triggers.
Go to AWS Lambda Rolling Deploy for the deploy step that this step rolls back.
Last updated
Was this helpful?