Menu
AWS Elastic Beanstalk
Developer Guide (API Version 2010-12-01)

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.

To configure deployments

  1. Open the Elastic Beanstalk console.

  2. Navigate to the management console 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

MethodImpact of Failed DeploymentDeploy TimeZero DowntimeNo DNS ChangeRollback ProcessCode Deployed To
All at onceDowntimeRe-deployExisting instances
RollingSingle batch out of service. Any successful batches prior to failure running new application version.Re-deployExisting instances
Rolling with additional batchMinimal if first batch fails, otherwise similar to Rolling.Re-deployNew & existing instances
ImmutableMinimalRe-deployNew instances
Blue/greenMinimalSwap URLNew 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 console 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.