AWS Elastic Beanstalk
Developer Guide (API Version 2010-12-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Creating New Application Versions

You can create different versions for an application. Each application version consists of a unique file (WAR file or ZIP file), as well as contextual information about the version. This topic describes how to create a new version of an existing AWS Elastic Beanstalk application and deploy it to an existing environment. You may want to do this if, for instance, you have updated your application and want to re-deploy it to your testing environment. For information on how to create new application versions using the AWS Toolkit for Eclipse, see Creating and Deploying AWS Elastic Beanstalk Applications in Java Using AWS Toolkit for Eclipse. For more information on how to create new application versions for PHP, see Deploying AWS Elastic Beanstalk Applications in PHP. For more information on how to create new application versions using the AWS Toolkit for Visual Studio, see Creating and Deploying AWS Elastic Beanstalk Applications in .NET Using AWS Toolkit for Visual Studio.

Note

For information on creating a new application, see Creating New Applications.

AWS Management Console

To create a new application version

  1. Open the AWS Elastic Beanstalk console at https://console.aws.amazon.com/elasticbeanstalk/.

  2. From the region list, select a region.

  3. Select the application to which you want to add a new version.

  4. Click Upload New Version. The Upload New Version window appears.

    AWS Elastic Beanstalk Upload New Version Window
  5. Describe your application version details:

    1. Enter a short descriptive name for the application version in the Version Label box.

    2. Enter a brief description of the application version in the Description box.

    3. In the Upload Existing Application box, enter the location of the WAR file (Java) or the ZIP file (.NET or PHP) containing the new application version. You can optionally click Browse to locate the file in your local file system.

      Note

      AWS Elastic Beanstalk supports only a single WAR file for a Java application version and only a single ZIP file for other applications. The file size limit is 250 MB.

  6. In the Deployment section of the Upload New Version dialog box, you can:

    • Select Upload but do not deploy to any environment.

    • Select Deploy to an existing environment after upload, and select the environment from the drop-down list box.

      Note

      For more information about deploying with zero downtime, see Deploying Versions with Zero Downtime.

    For this example, select Deploy to an existing environment after upload, and then select the Default Environment from the drop-down menu.

  7. Click Upload and Deploy New Version.

    The file you specified is associated with your application, and the application is launched with the selected environment.

CLI

To create a new application version

  1. Create a new application version.

    PROMPT> elastic-beanstalk-create-application-version -a [Application Name] -l [Version Label] -d [Description] -s [Source Location]

  2. Update your existing environment.

    PROMPT> elastic-beanstalk-update-environment -e [Environment Name] -l [Version Label] -d [Description]

  3. Determine if the new environment is Green and Ready.

    PROMPT> elastic-beanstalk-describe-environments -e [Environment Name]

    If the new environment does not come up Green and Ready, you should decide if you want to retry the operation or leave the environment in its current state for investigation. Make sure to terminate the environment after you are finished, and clean up any unused resources.

    Note

    You can adjust the timeout period if the environment doesn't launch in a reasonable time.

API

To create a new application version

  1. Call CreateApplicationVersion with the following parameters:

    • ApplicationName = SampleApp

    • VersionLabel = Version2

    • Description = description

    • SourceBundle.S3Bucket = <your bucket name>

    • SourceBundle.S3Key = <your application file name>

    • AutoCreateApplication = true

    Example

    https://elasticbeanstalk.us-east-1.amazon.com/?ApplicationName=SampleApp
    &VersionLabel=Version2
    &Description=description
    &SourceBundle.S3Bucket=amazonaws.com
    &SourceBundle.S3Key=sample.war
    &AutoCreateApplication=true
    &Operation=CreateApplicationVersion
    &AuthParams        

  2. Call UpdateEnvironment with the following parameters:

    • EnvironmentName = SampleAppEnv

    • VersionLabel = Version2

    • Description = description

    • TemplateName = MyConfigTemplate

    Example

    https://elasticbeanstalk.us-east-1.amazon.com/?EnvironmentName=mysampleappenv
    &TemplateName=myconfigtemplate
    &Description=description
    &VersionLabel=Version2
    &Operation=UpdateEnvironment
    &AuthParams  

  3. Call DescribeEnvironments with the following parameter:

    • EnvironmentName = SampleAppEnv

    Example

    https://elasticbeanstalk.us-east-1.amazon.com/?EnvironmentName=SampleAppEnv
    &Operation=DescribeEnvironments
    &AuthParams