Elastic Beanstalk
Developer Guide (API Version 2010-12-01)
Did this page help you?  Yes | No |  Tell us about it...
« 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.

Create an Application Version

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 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 Elastic Beanstalk Applications in Java Using AWS Toolkit for Eclipse. For more information on how to create new application versions for PHP, see Deploying 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 Elastic Beanstalk Applications in .NET Using AWS Toolkit for Visual Studio.

Note

For information on creating a new application, see Create an Application.

AWS Management Console

To create a new application version

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

  2. From the region list, select the region that includes the application that you want to work with.

  3. From the Elastic Beanstalk console applications page, click the name of the application to which you want to add a new application version.

  4. In the navigation pane, click Application Versions.

  5. Click Upload.

    • Enter a label for this version in the Version label field.

    • (Optional) Enter a brief description for this version in the Description field.

    • Click Browse to specify the location of the application version (.war or .zip file).

      Note

      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 512 MB.

    • Click Upload.

    The file you specified is associated with your application. You can deploy the application version to a new or existing environment. For more information, see Launching a New AWS Elastic Beanstalk Environment or Deploying Applications to Existing Environments

Command Line

To create a new application version with the AWS CLI

$ aws elasticbeanstalk create-application-version --application-name my-application --version-label v1
{
    "ApplicationVersion": {
        "ApplicationName": "my-application",
        "VersionLabel": "v1",
        "SourceBundle": {
            "S3Bucket": "elasticbeanstalk-us-west-2",
            "S3Key": "GenericSampleApplication"
        },
        "DateUpdated": "2015-07-07T21:56:42.426Z",
        "DateCreated": "2015-07-07T21:56:42.426Z"
    }
}

This command creates an application version with a sample application. To create an application version with your own code, specify the location of a source bundle in S3 with the --source-bundle option.

To create a new application version from a source bundle stored in S3

$ aws elasticbeanstalk create-application-version --application-name my-application --version-label v2 --source-bundle S3Bucket=my-bucket,S3Key=php-proxy-sample.zip
{
    "ApplicationVersion": {
        "ApplicationName": "my-application",
        "VersionLabel": "v2",
        "SourceBundle": {
            "S3Bucket": "my-bucket",
            "S3Key": "php-proxy-sample.zip"
        },
        "DateUpdated": "2015-07-07T22:03:49.013Z",
        "DateCreated": "2015-07-07T22:03:49.013Z"
    }
}

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-west-2.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-west-2.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-west-2.amazon.com/?EnvironmentName=SampleAppEnv
    &Operation=DescribeEnvironments
    &AuthParams