AWS Elastic Beanstalk
Developer Guide

Deploying Applications to AWS Elastic Beanstalk Environments

You can use the AWS Management Console to upload an updated source bundle and deploy it to your AWS Elastic Beanstalk environment, or redeploy a previously uploaded version.

Deploying a new version of your application to an environment is typically a fairly quick process. The new source bundle is deployed to an instance and extracted. Then the web container or application server picks up the new version and, if necessary, restarts. During deployment, your application might still become unavailable to users for a few seconds. You can prevent this by configuring your environment to use rolling deployments to deploy the new version to instances in batches.

Each deployment is identified by a deployment ID. Deployment IDs start at 1 and increment by one with each deployment and instance configuration change. If you enable enhanced health reporting, Elastic Beanstalk displays the deployment ID in both the health console and the EB CLI when it reports instance health status. The deployment ID can help you determine the state of your environment when a rolling update fails.

If you need to ensure that your application source is always deployed to new instances, instead of updating existing instances, you can configure your environment to use immutable updates for deployments. In an immutable update, a second Auto Scaling group is launched in your environment and the new version serves traffic alongside the old version until the new instances pass health checks.

Supported Deployment Policies

Deployment Policy Load-Balanced Environments Single-Instance Environments Windows Server Environments

All at Once


Rolling with an Additional Batch


To configure deployments

  1. Open the Elastic Beanstalk console.

  2. Navigate to the management page for your environment.

  3. Choose Configuration.

  4. On the Rolling updates and deployments configuration card, choose Modify.

  5. In the Application Deployments section, choose a Deployment policy and batch settings.

  6. Choose Apply.

For deployments that depend on resource configuration changes or a new version that can't run alongside the old version, you can launch a new environment with the new version and perform a CNAME swap for a blue/green deployment.

The following table compares deployment methods.

Deployment Methods

Method Impact of Failed Deployment Deploy Time Zero Downtime No DNS Change Rollback Process Code Deployed To
All at once Downtime Manual Redeploy Existing instances
Rolling Single batch out of service; any successful batches prior to failure running new application version Manual Redeploy Existing instances
Rolling with additional batch Minimal if first batch fails, otherwise, similar to Rolling Manual Redeploy New and existing instances
Immutable Minimal Terminate New Instances New instances
Blue/green Minimal Swap URL New instances

Varies depending on batch size.

If you deploy often, consider using the Elastic Beanstalk Command Line Interface to manage your environments. The EB CLI creates a repository alongside your source code and can create a source bundle, upload it to Elastic Beanstalk, and deploy with a single command.

Deploying a New Application Version

You can perform deployments from your environment's dashboard.

To deploy a new application version to an Elastic Beanstalk environment

  1. Open the Elastic Beanstalk console.

  2. Navigate to the management page for your environment.

  3. Choose Upload and Deploy.

  4. Choose Browse to select the application source bundle for the application version you want to deploy.

            The upload and deploy dialog
  5. Type a unique Version label to represent the new application version.

  6. Choose Deploy.

Redeploying a Previous Version

You can also deploy a previously uploaded version of your application to any of its environments from the application versions page.

To deploy an existing application version to an existing environment

  1. Open the Elastic Beanstalk console.

  2. Choose Actions next to the application name, and then choose View application versions.

  3. Select the application version that you want to deploy, and then click Deploy.

  4. Choose an environment and then choose Deploy.