AWS Elastic Beanstalk
Developer Guide (API Version 2010-12-01)
AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

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, and then the web container or application server picks up the new version and restarts if necessary. 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 one and increment by one with each deployment and instance configuration change. Elastic Beanstalk displays the deployment ID in both the health console and the EB CLI when it reports instance health status if you have enabled enhanced health reporting. 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 AutoScaling group is launched in your environment and the new version serves traffic alongside the old version until the new instance 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. Choose Updates and Deployments.

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

  6. Choose Apply.

For deployments that are dependent 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 Re-deploy Existing instances
Rolling Single batch out of service. Any successful batches prior to failure running new application version. Re-deploy Existing instances
Rolling with additional batch Minimal if first batch fails, otherwise similar to Rolling. Re-deploy New & existing instances
Immutable Minimal Re-deploy 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.

  5. For Version label, 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.