选择您的 Cookie 首选项

我们使用必要 Cookie 和类似工具提供我们的网站和服务。我们使用性能 Cookie 收集匿名统计数据,以便我们可以了解客户如何使用我们的网站并进行改进。必要 Cookie 无法停用,但您可以单击“自定义”或“拒绝”来拒绝性能 Cookie。

如果您同意,AWS 和经批准的第三方还将使用 Cookie 提供有用的网站功能、记住您的首选项并显示相关内容,包括相关广告。要接受或拒绝所有非必要 Cookie,请单击“接受”或“拒绝”。要做出更详细的选择,请单击“自定义”。

CreateApplicationVersion - AWS Elastic Beanstalk
此页面尚未翻译为您的语言。 请求翻译

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 Amazon S3 with SourceBundle

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

Note

After you create an application version with a specified Amazon S3 bucket and key location, you can't 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

A description of this application version.

Type: String

Length Constraints: Maximum length of 200.

Required: No

Process

Pre-processes and validates the environment manifest (env.yaml) and configuration files (*.config files in the .ebextensions folder) in the source bundle. Validating configuration files can identify issues prior to deploying the application version to an environment.

You must turn processing on for application versions that you create using AWS CodeBuild or AWS CodeCommit. For application versions built from a source bundle in Amazon S3, processing is optional.

Note

The Process option validates Elastic Beanstalk configuration files. It doesn't validate your application's configuration files, like proxy server or Docker configuration.

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.

Unless you're specifying a source bundle in the bucket that Elastic Beanstalk manages in your account, you must assign a custom policy to your user, and grant Allow permission to the s3:Get* actions on your S3 object resource, for example, arn:aws:s3:::your-bucket/your-source-bundle-object.

Specify a source bundle in Amazon 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

Tags.member.N

Specifies the tags applied to the application version.

Elastic Beanstalk applies these tags only to the application version. Environments that use the application version don't inherit the tags.

Type: Array of Tag objects

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 or 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

Examples

Example

This example illustrates one usage of CreateApplicationVersion.

Sample Request

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

<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:

隐私网站条款Cookie 首选项
© 2025, Amazon Web Services, Inc. 或其附属公司。保留所有权利。