application_versions
Creates, updates, deletes, gets or lists an application_versions resource.
Overview
| Name | application_versions |
| Type | Resource |
| Id | aws.elasticbeanstalk.application_versions |
Fields
The following fields are returned by SELECT queries:
- describe_application_versions
| Name | Datatype | Description |
|---|---|---|
application_name | string | The name of the application to which the application version belongs. |
application_version_arn | string | The Amazon Resource Name (ARN) of the application version. |
build_arn | string | Reference to the artifact from the AWS CodeBuild build. |
date_created | string | The creation date of the application version. |
date_updated | string | The last modified date of the application version. |
description | string | The description of the application version. |
source_build_information | string | If the version's source code was retrieved from AWS CodeCommit, the location of the source code for the application version. |
source_bundle | string | The storage location of the application version's source bundle in Amazon S3. |
status | string | The processing status of the application version. Reflects the state of the application version during its creation. Many of the values are only applicable if you specified True for the Process parameter of the CreateApplicationVersion action. The following list describes the possible values. Unprocessed – Application version wasn't pre-processed or validated. Elastic Beanstalk will validate configuration files during deployment of the application version to an environment. Processing – Elastic Beanstalk is currently processing the application version. Building – Application version is currently undergoing an AWS CodeBuild build. Processed – Elastic Beanstalk was successfully pre-processed and validated. Failed – Either the AWS CodeBuild build failed or configuration files didn't pass validation. This application version isn't usable. |
version_label | string | A unique identifier for the application version. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_application_versions | select | region | ApplicationName, VersionLabels, MaxRecords, NextToken | Retrieve a list of application versions. |
create_application_version | insert | ApplicationName, VersionLabel, region | Description, SourceBuildInformation, SourceBundle, BuildConfiguration, AutoCreateApplication, Process, Tags | 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. 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. |
update_application_version | update | ApplicationName, VersionLabel, region | Description | Updates the specified application version to have the specified properties. If a property (for example, description) is not provided, the value remains unchanged. To clear properties, specify an empty string. |
delete_application_version | delete | ApplicationName, VersionLabel, region | DeleteSourceBundle | Deletes the specified version from the specified application. You cannot delete an application version that is associated with a running environment. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
ApplicationName | string | The name of the application to which the version belongs. |
VersionLabel | string | The label of the version to delete. |
region | string | AWS region (default: us-east-1) |
ApplicationName | string | Specify an application name to show only application versions for that application. |
AutoCreateApplication | boolean | Set to true to create an application with the specified name if it doesn't already exist. |
BuildConfiguration | object | Settings for an AWS CodeBuild build. |
DeleteSourceBundle | boolean | Set to true to delete the source bundle from your storage bucket. Otherwise, the application version is deleted only from Elastic Beanstalk and the source bundle remains in Amazon S3. |
Description | string | A new description for this version. |
MaxRecords | integer | For a paginated request. Specify a maximum number of application versions to include in each response. If no MaxRecords is specified, all available application versions are retrieved in a single response. |
NextToken | string | For a paginated request. Specify a token from a previous response page to retrieve the next response page. All other parameter values must be identical to the ones specified in the initial request. If no NextToken is specified, the first page is retrieved. |
Process | boolean | 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. The Process option validates Elastic Beanstalk configuration files. It doesn't validate your application's configuration files, like proxy server or Docker configuration. |
SourceBuildInformation | object | Specify a commit in an AWS CodeCommit Git repository to use as the source code for the application version. |
SourceBundle | object | The Amazon S3 bucket and key that identify the location of the source bundle for this version. 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. |
Tags | array | 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. |
VersionLabels | array | Specify a version label to show a specific application version. |
SELECT examples
- describe_application_versions
Retrieve a list of application versions.
SELECT
application_name,
application_version_arn,
build_arn,
date_created,
date_updated,
description,
source_build_information,
source_bundle,
status,
version_label
FROM aws.elasticbeanstalk.application_versions
WHERE region = '{{ region }}' -- required
AND ApplicationName = '{{ ApplicationName }}'
AND VersionLabels = '{{ VersionLabels }}'
AND MaxRecords = '{{ MaxRecords }}'
AND NextToken = '{{ NextToken }}'
;
INSERT examples
- create_application_version
- Manifest
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. 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.
INSERT INTO aws.elasticbeanstalk.application_versions (
ApplicationName,
VersionLabel,
region,
Description,
SourceBuildInformation,
SourceBundle,
BuildConfiguration,
AutoCreateApplication,
Process,
Tags
)
SELECT
'{{ ApplicationName }}',
'{{ VersionLabel }}',
'{{ region }}',
'{{ Description }}',
'{{ SourceBuildInformation }}',
'{{ SourceBundle }}',
'{{ BuildConfiguration }}',
'{{ AutoCreateApplication }}',
'{{ Process }}',
'{{ Tags }}'
RETURNING
application_name,
application_version_arn,
build_arn,
date_created,
date_updated,
description,
source_build_information,
source_bundle,
status,
version_label
;
# Description fields are for documentation purposes
- name: application_versions
props:
- name: ApplicationName
value: "{{ ApplicationName }}"
description: Required parameter for the application_versions resource.
- name: VersionLabel
value: "{{ VersionLabel }}"
description: Required parameter for the application_versions resource.
- name: region
value: "{{ region }}"
description: Required parameter for the application_versions resource.
- name: Description
value: "{{ Description }}"
description: A description of this application version.
description: A description of this application version.
- name: SourceBuildInformation
value: "{{ SourceBuildInformation }}"
description: Specify a commit in an AWS CodeCommit Git repository to use as the source code for the application version.
description: Specify a commit in an AWS CodeCommit Git repository to use as the source code for the application version.
- name: SourceBundle
value: "{{ SourceBundle }}"
description: The Amazon S3 bucket and key that identify the location of the source bundle for this version. 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.
description: The Amazon S3 bucket and key that identify the location of the source bundle for this version. 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.
- name: BuildConfiguration
value: "{{ BuildConfiguration }}"
description: Settings for an AWS CodeBuild build.
description: Settings for an AWS CodeBuild build.
- name: AutoCreateApplication
value: {{ AutoCreateApplication }}
description: Set to true to create an application with the specified name if it doesn't already exist.
description: Set to true to create an application with the specified name if it doesn't already exist.
- name: Process
value: {{ Process }}
description: 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. The Process option validates Elastic Beanstalk configuration files. It doesn't validate your application's configuration files, like proxy server or Docker configuration.
description: 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. The Process option validates Elastic Beanstalk configuration files. It doesn't validate your application's configuration files, like proxy server or Docker configuration.
- name: Tags
value: "{{ Tags }}"
description: 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.
description: 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.
UPDATE examples
- update_application_version
Updates the specified application version to have the specified properties. If a property (for example, description) is not provided, the value remains unchanged. To clear properties, specify an empty string.
UPDATE aws.elasticbeanstalk.application_versions
SET
-- No updatable properties
WHERE
ApplicationName = '{{ ApplicationName }}' --required
AND VersionLabel = '{{ VersionLabel }}' --required
AND region = '{{ region }}' --required
AND Description = '{{ Description}}'
RETURNING
application_name,
application_version_arn,
build_arn,
date_created,
date_updated,
description,
source_build_information,
source_bundle,
status,
version_label;
DELETE examples
- delete_application_version
Deletes the specified version from the specified application. You cannot delete an application version that is associated with a running environment.
DELETE FROM aws.elasticbeanstalk.application_versions
WHERE ApplicationName = '{{ ApplicationName }}' --required
AND VersionLabel = '{{ VersionLabel }}' --required
AND region = '{{ region }}' --required
AND DeleteSourceBundle = '{{ DeleteSourceBundle }}'
;