> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/continuous-delivery/3.0/use-deployments/overview-4/lambda-canary-deploy/lambda-rolling-deploy.md).

# AWS Lambda Rolling Deploy

Publish a new Lambda function version and immediately route all traffic to it using a rolling update strategy.

The AWS Lambda Rolling Deploy step publishes a new version of your Lambda function and routes all traffic to it immediately. There is no gradual traffic shift. Use this step when you want the simplest Lambda deployment path with automatic rollback on failure.

***

## Step YAML

```yaml
- name: AWS Lambda Rolling Deploy
  id: awsLambdaRollingDeployStep
  template:
    uses: awsLambdaRollingDeployStep
```

The step uses no explicit `with:` inputs — service configuration and infrastructure are resolved automatically from the stage context at runtime.

***

## Before you begin

* **A Lambda service** with an `AwsLambdaFunctionDefinition` manifest and an artifact source. An alias definition is optional — include one if you want the rolling deploy to also update a named alias. Go to [Lambda services](/continuous-delivery/3.0/use-deployments/overview-4/lambda-services.md).
* **A Lambda infrastructure** with an AWS connector and region. Go to [Lambda infrastructure](/continuous-delivery/3.0/use-deployments/overview-4/lambda-infrastructure.md).

***

## Configure the step

### Service Configuration

| Field                   | Value                                                  | Description                                                                                                                                                                                                                                                   |
| ----------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Function Definition** | `${{serviceOutput.manifests.awsLambdaFunction.paths}}` | Path to the function definition manifest resolved from the service. Defines the function name, handler, runtime, memory, and timeout.                                                                                                                         |
| **Function Alias**      | `${{serviceOutput.manifests.awsLambdaAlias.paths}}`    | Path to the alias definition manifest. Populated when your service includes an `AwsLambdaFunctionAliasDefinition` manifest. When present, the deploy step updates the alias to point to the new version at 100% weight. Leave empty to skip alias management. |

### Infrastructure Configuration

| Field             | Value                     | Description                                                    |
| ----------------- | ------------------------- | -------------------------------------------------------------- |
| **AWS Connector** | `${{infra.connectorRef}}` | The AWS connector resolved from the infrastructure definition. |
| **AWS Region**    | `${{infra.region}}`       | The AWS region resolved from the infrastructure definition.    |

{% hint style="info" %}
**ECR image functions**

When your artifact is a container image from ECR, the function definition uses `packageType: Image` — there is no `handler` or `runtime` field. Define `functionName` and `role` as service variables. The **Function Alias** field will be empty for ECR services; this is expected.

When your artifact is a ZIP file from S3, Artifactory, or Nexus, define `functionName` and `runtime` as service variables.
{% endhint %}

***

## Step outputs

After the step completes, the following output variables are available for downstream steps and expressions.

| Output variable | Expression                                                                                           | Description                                                   |
| --------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| `functionName`  | `<+pipeline.stages.<stage-id>.steps.awsLambdaRollingDeployStep.output.outputVariables.functionName>` | The name of the Lambda function that was deployed.            |
| `version`       | `<+pipeline.stages.<stage-id>.steps.awsLambdaRollingDeployStep.output.outputVariables.version>`      | The version number published by this deployment.              |
| `runtime`       | `<+pipeline.stages.<stage-id>.steps.awsLambdaRollingDeployStep.output.outputVariables.runtime>`      | The Lambda runtime identifier. Empty for ECR image functions. |
| `functionArn`   | `<+pipeline.stages.<stage-id>.steps.awsLambdaRollingDeployStep.output.outputVariables.functionArn>`  | The full ARN of the deployed function version.                |

In the CEL expression syntax, use `${{pipeline.stages.<stage-id>.steps.awsLambdaRollingDeployStep.output.outputVariables.<variable>}}`.

***

## Advanced settings

* **Timeout duration:** Maximum time the step is allowed to run before being terminated.
* **On failure:** Define what happens if the step fails — retry, mark as success, or abort.
* **Strategy:** Configure a looping strategy to run this step over a list of values.
* **Conditional execution:** Run this step only when a specified condition is true.

***

## Next steps

* Go to [AWS Lambda Rolling Rollback](/continuous-delivery/3.0/use-deployments/overview-4/lambda-canary-deploy/lambda-rolling-rollback.md) for the rollback step that restores the previous version.
* Go to [Lambda rolling deployment](/continuous-delivery/3.0/use-deployments/overview-4/canary/rolling.md) for the full rolling flow walkthrough.

{% @harness-feedback/feedback %}
