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

CreateApplicationVersion

Creates an application version for the specified application. You can create an application version from a source bundle in Amazon S3, a commit in AWS CodeCommit, or the output of an AWS CodeBuild build as follows:

Specify a commit in an AWS CodeCommit repository with SourceBuildInformation.

Specify a build in an AWS CodeBuild with SourceBuildInformation and BuildConfiguration.

Specify a source bundle in S3 with SourceBundle

Omit both SourceBuildInformation and SourceBundle to use the default sample application.

Note

Once you create an application version with a specified Amazon S3 bucket and key location, you cannot change that Amazon S3 location. If you change the Amazon S3 location, you receive an exception when you attempt to launch an environment from the application version.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

ApplicationName

The name of the application. If no application is found with this name, and AutoCreateApplication is false, returns an InvalidParameterValue error.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Required: Yes

AutoCreateApplication

Set to true to create an application with the specified name if it doesn't already exist.

Type: Boolean

Required: No

BuildConfiguration

Settings for an AWS CodeBuild build.

Type: BuildConfiguration object

Required: No

Description

Describes this version.

Type: String

Length Constraints: Maximum length of 200.

Required: No

Process

Preprocesses and validates the environment manifest and configuration files in the source bundle. Validating configuration files can identify issues prior to deploying the application version to an environment.

Type: Boolean

Required: No

SourceBuildInformation

Specify a commit in an AWS CodeCommit Git repository to use as the source code for the application version.

Type: SourceBuildInformation object

Required: No

SourceBundle

The Amazon S3 bucket and key that identify the location of the source bundle for this version.

Note

The Amazon S3 bucket must be in the same region as the environment.

Specify a source bundle in S3 or a commit in an AWS CodeCommit repository (with SourceBuildInformation), but not both. If neither SourceBundle nor SourceBuildInformation are provided, Elastic Beanstalk uses a sample application.

Type: S3Location object

Required: No

VersionLabel

A label identifying this version.

Constraint: Must be unique per application. If an application version already exists with this label for the specified application, AWS Elastic Beanstalk returns an InvalidParameterValue error.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Required: Yes

Response Elements

The following element is returned by the service.

ApplicationVersion

The ApplicationVersionDescription of the application version.

Type: ApplicationVersionDescription object

Errors

For information about the errors that are common to all actions, see Common Errors.

CodeBuildNotInServiceRegion

AWS CodeBuild is not available in the specified region.

HTTP Status Code: 400

InsufficientPrivileges

The specified account does not have sufficient privileges for one of more AWS services.

HTTP Status Code: 403

S3LocationNotInServiceRegion

The specified S3 bucket does not belong to the S3 region in which the service is running. The following regions are supported:

  • IAD/us-east-1

  • PDX/us-west-2

  • DUB/eu-west-1

HTTP Status Code: 400

TooManyApplications

The specified account has reached its limit of applications.

HTTP Status Code: 400

TooManyApplicationVersions

The specified account has reached its limit of application versions.

HTTP Status Code: 400

Example

Sample Request

Copy
https://elasticbeanstalk.us-west-2.amazonaws.com/?ApplicationName=SampleApp &VersionLabel=Version1 &Description=description &SourceBundle.S3Bucket=amazonaws.com &SourceBundle.S3Key=sample.war &AutoCreateApplication=true &Operation=CreateApplicationVersion &AuthParams

Sample Response

Copy
<CreateApplicationVersionResponse xmlns="https://elasticbeanstalk.amazonaws.com/docs/2010-12-01/"> <CreateApplicationVersionResult> <ApplicationVersion> <SourceBundle> <S3Bucket>amazonaws.com</S3Bucket> <S3Key>sample.war</S3Key> </SourceBundle> <VersionLabel>Version1</VersionLabel> <Description>description</Description> <ApplicationName>SampleApp</ApplicationName> <DateCreated>2010-11-17T03:21:59.161Z</DateCreated> <DateUpdated>2010-11-17T03:21:59.161Z</DateUpdated> </ApplicationVersion> </CreateApplicationVersionResult> <ResponseMetadata> <RequestId>d653efef-f1f9-11df-8a78-9f77047e0d0c</RequestId> </ResponseMetadata> </CreateApplicationVersionResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: