1. Resources
  2. /
  3. Plugins
  4. /
  5. aws-lambda-deploy-buildkite-plugin

AWS Lambda Deploy Buildkite Plugin

A Buildkite plugin for deploying AWS Lambda functions with alias management, health checks, and automatic rollback capabilities.

Features

  • Deploy & Rollback: Deploy new Lambda versions and rollback on failure
  • Package Types: Support for both Zip files and Container images
  • Alias Management: Manages Lambda aliases for blue/green deployments
  • Health Checks: Optional function invocation testing
  • Auto Rollback: Automatic rollback on deployment or health check failures
  • Build Metadata: Tracks deployment state across pipeline steps
  • Annotations: Creates detailed deployment and rollback annotations

Quick Start

steps:
  - label: ":rocket: Deploy Lambda"
    plugins:
      - aws-lambda-deploy#v1.0.0:
          function-name: "my-function"
          alias: "production"
          mode: "deploy"
          zip-file: "function.zip"
          region: "us-east-1"
          auto-rollback: true
          health-check-enabled: true
          health-check-payload: '{"length": 5, "width": 10}'

For complete examples, see the examples/ directory:

Configuration

Required Parameters

ParameterDescription
function-nameAWS Lambda function name
aliasLambda alias to manage (e.g., “production”, “staging”)
modeOperation mode: deploy or rollback

Deploy Mode Parameters

Package Configuration

ParameterTypeDescriptionRequired
package-typeStringPackage type: Zip or ImageNo (default: Zip)

For Zip packages (choose one):

ParameterTypeDescription
zip-fileStringPath to local zip file
s3-bucket + s3-keyStringS3 location of zip file
s3-object-versionStringS3 object version (optional)

For Container images:

ParameterTypeDescription
image-uriStringECR image URI
image-configObjectContainer configuration (entrypoint, command, working-directory)

Function Configuration

ParameterTypeDescription
runtimeStringLambda runtime (for Zip packages)
handlerStringFunction handler (for Zip packages)
timeoutIntegerFunction timeout in seconds
memory-sizeIntegerMemory allocation in MB
descriptionStringFunction description
environmentObjectEnvironment variables

Health Checks & Rollback

ParameterTypeDefaultDescription
auto-rollbackBooleanfalseEnable automatic rollback on failure
health-check-enabledBooleanfalseEnable health check testing
health-check-timeoutInteger300Health check timeout in seconds
health-check-payloadString{}JSON payload for test invocation
health-check-expected-statusInteger200Expected HTTP status code

Common Parameters

ParameterTypeDescription
regionStringAWS region

How It Works

Deploy Mode

  1. Capture Current State: Records the current alias target for potential rollback
  2. Update Function Code: Publishes new Lambda version with provided package
  3. Wait for Active: Ensures the new version becomes active
  4. Update Configuration: Applies any function configuration changes
  5. Health Checks: Runs optional health checks on the new version
  6. Update Alias: Points the alias to the new version
  7. Post-deployment Checks: Final health validation
  8. Auto Rollback: Automatically rolls back if any step fails (when enabled)

Rollback Mode

The rollback mode assesses the deployment state and takes appropriate action:

  • Failed Deployment: Rolls back alias to previous version and deletes failed version
  • Successful Deployment: Creates success annotation
  • Manual Rollback: Allows manual rollback regardless of deployment state

Build Metadata

The plugin uses Buildkite build metadata to track deployment state. All keys are namespaced by function name to support multiple function deployments:

  • deployment:aws_lambda:{function_name}:current_version - Current Lambda version
  • deployment:aws_lambda:{function_name}:previous_version - Previous version for rollback
  • deployment:aws_lambda:{function_name}:result - Deployment result (success/failed/rolled_back)
  • deployment:aws_lambda:{function_name}:package_type - Package type used
  • deployment:aws_lambda:{function_name}:auto_rollback - Whether auto-rollback was triggered

For example, when deploying a function named my-api, the metadata keys would be deployment:aws_lambda:my-api:current_version, etc.

Requirements

  • AWS CLI v2
  • jq
  • Appropriate AWS IAM permissions for Lambda operations

Required IAM Permissions

Example policy

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "lambda:GetFunction",
        "lambda:UpdateFunctionCode",
        "lambda:UpdateFunctionConfiguration",
        "lambda:PublishVersion",
        "lambda:GetAlias",
        "lambda:UpdateAlias",
        "lambda:CreateAlias",
        "lambda:DeleteFunction",
        "lambda:InvokeFunction"
      ],
      "Resource": "arn:aws:lambda:*:*:function:*"
    }
  ]
}

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -am 'Add my feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. Create a Pull Request

License

MIT License - see LICENSE file for details.

The plugins listed on this webpage are provided for informational purposes only. They have not undergone any formal security review or assessment. While we strive to provide useful resources, we cannot guarantee the safety, reliability, or integrity of these plugins. Users are strongly advised to conduct their own security evaluations before downloading, installing, or using any plugin. By using these plugins, you acknowledge and accept any risks associated with their use. We disclaim any liability for any harm or damages arising from the use of the plugins listed.

Start turning complexity into an advantage

Create an account to get started with a 30-day free trial. No credit card required.

Buildkite Pipelines

Platform

  1. Pipelines
  2. Public pipelines
  3. Test Engine
  4. Package Registries
  5. Mobile Delivery Cloud
  6. Pricing

Hosting options

  1. Self-hosted agents
  2. Mac hosted agents
  3. Linux hosted agents

Resources

  1. Docs
  2. Blog
  3. Changelog
  4. Example pipelines
  5. Plugins
  6. Webinars
  7. Case studies
  8. Events
  9. Migration Services
  10. Comparisons

Company

  1. About
  2. Careers
  3. Press
  4. Brand assets
  5. Contact

Solutions

  1. Replace Jenkins
  2. Workflows for AI/ML
  3. Testing at scale
  4. Monorepo mojo
  5. Bazel orchestration

Legal

  1. Terms of Service
  2. Acceptable Use Policy
  3. Privacy Policy
  4. Subprocessors
  5. Service Level Agreement

Support

  1. System status
  2. Forum
© Buildkite Pty Ltd 2025