AWS Elastic Beanstalk

2018/04/24 - AWS Elastic Beanstalk - 6 updated api methods

Changes  Update elasticbeanstalk client to latest version

CreateApplication (updated) Link ¶
Changes (response)
{'Application': {'ApplicationArn': 'string'}}

Creates an application that has one configuration template named default and no application versions.

See also: AWS API Documentation

Request Syntax

client.create_application(
    ApplicationName='string',
    Description='string',
    ResourceLifecycleConfig={
        'ServiceRole': 'string',
        'VersionLifecycleConfig': {
            'MaxCountRule': {
                'Enabled': True|False,
                'MaxCount': 123,
                'DeleteSourceFromS3': True|False
            },
            'MaxAgeRule': {
                'Enabled': True|False,
                'MaxAgeInDays': 123,
                'DeleteSourceFromS3': True|False
            }
        }
    }
)
type ApplicationName:

string

param ApplicationName:

[REQUIRED]

The name of the application.

Constraint: This name must be unique within your account. If the specified name already exists, the action returns an InvalidParameterValue error.

type Description:

string

param Description:

Describes the application.

type ResourceLifecycleConfig:

dict

param ResourceLifecycleConfig:

Specify an application resource lifecycle configuration to prevent your application from accumulating too many versions.

  • ServiceRole (string) --

    The ARN of an IAM service role that Elastic Beanstalk has permission to assume.

  • VersionLifecycleConfig (dict) --

    The application version lifecycle configuration.

    • MaxCountRule (dict) --

      Specify a max count rule to restrict the number of application versions that are retained for an application.

      • Enabled (boolean) -- [REQUIRED]

        Specify true to apply the rule, or false to disable it.

      • MaxCount (integer) --

        Specify the maximum number of application versions to retain.

      • DeleteSourceFromS3 (boolean) --

        Set to true to delete a version's source bundle from Amazon S3 when Elastic Beanstalk deletes the application version.

    • MaxAgeRule (dict) --

      Specify a max age rule to restrict the length of time that application versions are retained for an application.

      • Enabled (boolean) -- [REQUIRED]

        Specify true to apply the rule, or false to disable it.

      • MaxAgeInDays (integer) --

        Specify the number of days to retain an application versions.

      • DeleteSourceFromS3 (boolean) --

        Set to true to delete a version's source bundle from Amazon S3 when Elastic Beanstalk deletes the application version.

rtype:

dict

returns:

Response Syntax

{
    'Application': {
        'ApplicationArn': 'string',
        'ApplicationName': 'string',
        'Description': 'string',
        'DateCreated': datetime(2015, 1, 1),
        'DateUpdated': datetime(2015, 1, 1),
        'Versions': [
            'string',
        ],
        'ConfigurationTemplates': [
            'string',
        ],
        'ResourceLifecycleConfig': {
            'ServiceRole': 'string',
            'VersionLifecycleConfig': {
                'MaxCountRule': {
                    'Enabled': True|False,
                    'MaxCount': 123,
                    'DeleteSourceFromS3': True|False
                },
                'MaxAgeRule': {
                    'Enabled': True|False,
                    'MaxAgeInDays': 123,
                    'DeleteSourceFromS3': True|False
                }
            }
        }
    }
}

Response Structure

  • (dict) --

    Result message containing a single description of an application.

    • Application (dict) --

      The ApplicationDescription of the application.

      • ApplicationArn (string) --

        The Amazon Resource Name (ARN) of the application.

      • ApplicationName (string) --

        The name of the application.

      • Description (string) --

        User-defined description of the application.

      • DateCreated (datetime) --

        The date when the application was created.

      • DateUpdated (datetime) --

        The date when the application was last modified.

      • Versions (list) --

        The names of the versions for this application.

        • (string) --

      • ConfigurationTemplates (list) --

        The names of the configuration templates associated with this application.

        • (string) --

      • ResourceLifecycleConfig (dict) --

        The lifecycle settings for the application.

        • ServiceRole (string) --

          The ARN of an IAM service role that Elastic Beanstalk has permission to assume.

        • VersionLifecycleConfig (dict) --

          The application version lifecycle configuration.

          • MaxCountRule (dict) --

            Specify a max count rule to restrict the number of application versions that are retained for an application.

            • Enabled (boolean) --

              Specify true to apply the rule, or false to disable it.

            • MaxCount (integer) --

              Specify the maximum number of application versions to retain.

            • DeleteSourceFromS3 (boolean) --

              Set to true to delete a version's source bundle from Amazon S3 when Elastic Beanstalk deletes the application version.

          • MaxAgeRule (dict) --

            Specify a max age rule to restrict the length of time that application versions are retained for an application.

            • Enabled (boolean) --

              Specify true to apply the rule, or false to disable it.

            • MaxAgeInDays (integer) --

              Specify the number of days to retain an application versions.

            • DeleteSourceFromS3 (boolean) --

              Set to true to delete a version's source bundle from Amazon S3 when Elastic Beanstalk deletes the application version.

CreateApplicationVersion (updated) Link ¶
Changes (response)
{'ApplicationVersion': {'ApplicationVersionArn': 'string'}}

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.

See also: AWS API Documentation

Request Syntax

client.create_application_version(
    ApplicationName='string',
    VersionLabel='string',
    Description='string',
    SourceBuildInformation={
        'SourceType': 'Git'|'Zip',
        'SourceRepository': 'CodeCommit'|'S3',
        'SourceLocation': 'string'
    },
    SourceBundle={
        'S3Bucket': 'string',
        'S3Key': 'string'
    },
    BuildConfiguration={
        'ArtifactName': 'string',
        'CodeBuildServiceRole': 'string',
        'ComputeType': 'BUILD_GENERAL1_SMALL'|'BUILD_GENERAL1_MEDIUM'|'BUILD_GENERAL1_LARGE',
        'Image': 'string',
        'TimeoutInMinutes': 123
    },
    AutoCreateApplication=True|False,
    Process=True|False
)
type ApplicationName:

string

param ApplicationName:

[REQUIRED]

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

type VersionLabel:

string

param VersionLabel:

[REQUIRED]

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

string

param Description:

Describes this version.

type SourceBuildInformation:

dict

param SourceBuildInformation:

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

  • SourceType (string) -- [REQUIRED]

    The type of repository.

    • Git

    • Zip

  • SourceRepository (string) -- [REQUIRED]

    Location where the repository is stored.

    • CodeCommit

    • S3

  • SourceLocation (string) -- [REQUIRED]

    The location of the source code, as a formatted string, depending on the value of SourceRepository

    • For CodeCommit, the format is the repository name and commit ID, separated by a forward slash. For example, my-git-repo/265cfa0cf6af46153527f55d6503ec030551f57a.

    • For S3, the format is the S3 bucket name and object key, separated by a forward slash. For example, my-s3-bucket/Folders/my-source-file.

type SourceBundle:

dict

param SourceBundle:

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

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.

  • S3Bucket (string) --

    The Amazon S3 bucket where the data is located.

  • S3Key (string) --

    The Amazon S3 key where the data is located.

type BuildConfiguration:

dict

param BuildConfiguration:

Settings for an AWS CodeBuild build.

  • ArtifactName (string) --

    The name of the artifact of the CodeBuild build. If provided, Elastic Beanstalk stores the build artifact in the S3 location S3-bucket/resources/application-name/codebuild/codebuild-version-label-artifact-name.zip. If not provided, Elastic Beanstalk stores the build artifact in the S3 location S3-bucket/resources/application-name/codebuild/codebuild-version-label.zip.

  • CodeBuildServiceRole (string) -- [REQUIRED]

    The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that enables AWS CodeBuild to interact with dependent AWS services on behalf of the AWS account.

  • ComputeType (string) --

    Information about the compute resources the build project will use.

    • BUILD_GENERAL1_SMALL: Use up to 3 GB memory and 2 vCPUs for builds

    • BUILD_GENERAL1_MEDIUM: Use up to 7 GB memory and 4 vCPUs for builds

    • BUILD_GENERAL1_LARGE: Use up to 15 GB memory and 8 vCPUs for builds

  • Image (string) -- [REQUIRED]

    The ID of the Docker image to use for this build project.

  • TimeoutInMinutes (integer) --

    How long in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait until timing out any related build that does not get marked as completed. The default is 60 minutes.

type AutoCreateApplication:

boolean

param AutoCreateApplication:

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

type Process:

boolean

param Process:

Preprocesses 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.

rtype:

dict

returns:

Response Syntax

{
    'ApplicationVersion': {
        'ApplicationVersionArn': 'string',
        'ApplicationName': 'string',
        'Description': 'string',
        'VersionLabel': 'string',
        'SourceBuildInformation': {
            'SourceType': 'Git'|'Zip',
            'SourceRepository': 'CodeCommit'|'S3',
            'SourceLocation': 'string'
        },
        'BuildArn': 'string',
        'SourceBundle': {
            'S3Bucket': 'string',
            'S3Key': 'string'
        },
        'DateCreated': datetime(2015, 1, 1),
        'DateUpdated': datetime(2015, 1, 1),
        'Status': 'Processed'|'Unprocessed'|'Failed'|'Processing'|'Building'
    }
}

Response Structure

  • (dict) --

    Result message wrapping a single description of an application version.

    • ApplicationVersion (dict) --

      The ApplicationVersionDescription of the application version.

      • ApplicationVersionArn (string) --

        The Amazon Resource Name (ARN) of the application version.

      • ApplicationName (string) --

        The name of the application to which the application version belongs.

      • Description (string) --

        The description of the application version.

      • VersionLabel (string) --

        A unique identifier for the application version.

      • SourceBuildInformation (dict) --

        If the version's source code was retrieved from AWS CodeCommit, the location of the source code for the application version.

        • SourceType (string) --

          The type of repository.

          • Git

          • Zip

        • SourceRepository (string) --

          Location where the repository is stored.

          • CodeCommit

          • S3

        • SourceLocation (string) --

          The location of the source code, as a formatted string, depending on the value of SourceRepository

          • For CodeCommit, the format is the repository name and commit ID, separated by a forward slash. For example, my-git-repo/265cfa0cf6af46153527f55d6503ec030551f57a.

          • For S3, the format is the S3 bucket name and object key, separated by a forward slash. For example, my-s3-bucket/Folders/my-source-file.

      • BuildArn (string) --

        Reference to the artifact from the AWS CodeBuild build.

      • SourceBundle (dict) --

        The storage location of the application version's source bundle in Amazon S3.

        • S3Bucket (string) --

          The Amazon S3 bucket where the data is located.

        • S3Key (string) --

          The Amazon S3 key where the data is located.

      • DateCreated (datetime) --

        The creation date of the application version.

      • DateUpdated (datetime) --

        The last modified date of the application version.

      • Status (string) --

        The processing status of the application version.

DescribeApplicationVersions (updated) Link ¶
Changes (response)
{'ApplicationVersions': {'ApplicationVersionArn': 'string'}}

Retrieve a list of application versions.

See also: AWS API Documentation

Request Syntax

client.describe_application_versions(
    ApplicationName='string',
    VersionLabels=[
        'string',
    ],
    MaxRecords=123,
    NextToken='string'
)
type ApplicationName:

string

param ApplicationName:

Specify an application name to show only application versions for that application.

type VersionLabels:

list

param VersionLabels:

Specify a version label to show a specific application version.

  • (string) --

type MaxRecords:

integer

param MaxRecords:

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.

type NextToken:

string

param NextToken:

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.

rtype:

dict

returns:

Response Syntax

{
    'ApplicationVersions': [
        {
            'ApplicationVersionArn': 'string',
            'ApplicationName': 'string',
            'Description': 'string',
            'VersionLabel': 'string',
            'SourceBuildInformation': {
                'SourceType': 'Git'|'Zip',
                'SourceRepository': 'CodeCommit'|'S3',
                'SourceLocation': 'string'
            },
            'BuildArn': 'string',
            'SourceBundle': {
                'S3Bucket': 'string',
                'S3Key': 'string'
            },
            'DateCreated': datetime(2015, 1, 1),
            'DateUpdated': datetime(2015, 1, 1),
            'Status': 'Processed'|'Unprocessed'|'Failed'|'Processing'|'Building'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Result message wrapping a list of application version descriptions.

    • ApplicationVersions (list) --

      List of ApplicationVersionDescription objects sorted in order of creation.

      • (dict) --

        Describes the properties of an application version.

        • ApplicationVersionArn (string) --

          The Amazon Resource Name (ARN) of the application version.

        • ApplicationName (string) --

          The name of the application to which the application version belongs.

        • Description (string) --

          The description of the application version.

        • VersionLabel (string) --

          A unique identifier for the application version.

        • SourceBuildInformation (dict) --

          If the version's source code was retrieved from AWS CodeCommit, the location of the source code for the application version.

          • SourceType (string) --

            The type of repository.

            • Git

            • Zip

          • SourceRepository (string) --

            Location where the repository is stored.

            • CodeCommit

            • S3

          • SourceLocation (string) --

            The location of the source code, as a formatted string, depending on the value of SourceRepository

            • For CodeCommit, the format is the repository name and commit ID, separated by a forward slash. For example, my-git-repo/265cfa0cf6af46153527f55d6503ec030551f57a.

            • For S3, the format is the S3 bucket name and object key, separated by a forward slash. For example, my-s3-bucket/Folders/my-source-file.

        • BuildArn (string) --

          Reference to the artifact from the AWS CodeBuild build.

        • SourceBundle (dict) --

          The storage location of the application version's source bundle in Amazon S3.

          • S3Bucket (string) --

            The Amazon S3 bucket where the data is located.

          • S3Key (string) --

            The Amazon S3 key where the data is located.

        • DateCreated (datetime) --

          The creation date of the application version.

        • DateUpdated (datetime) --

          The last modified date of the application version.

        • Status (string) --

          The processing status of the application version.

    • NextToken (string) --

      In a paginated request, the token that you can pass in a subsequent request to get the next response page.

DescribeApplications (updated) Link ¶
Changes (response)
{'Applications': {'ApplicationArn': 'string'}}

Returns the descriptions of existing applications.

See also: AWS API Documentation

Request Syntax

client.describe_applications(
    ApplicationNames=[
        'string',
    ]
)
type ApplicationNames:

list

param ApplicationNames:

If specified, AWS Elastic Beanstalk restricts the returned descriptions to only include those with the specified names.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'Applications': [
        {
            'ApplicationArn': 'string',
            'ApplicationName': 'string',
            'Description': 'string',
            'DateCreated': datetime(2015, 1, 1),
            'DateUpdated': datetime(2015, 1, 1),
            'Versions': [
                'string',
            ],
            'ConfigurationTemplates': [
                'string',
            ],
            'ResourceLifecycleConfig': {
                'ServiceRole': 'string',
                'VersionLifecycleConfig': {
                    'MaxCountRule': {
                        'Enabled': True|False,
                        'MaxCount': 123,
                        'DeleteSourceFromS3': True|False
                    },
                    'MaxAgeRule': {
                        'Enabled': True|False,
                        'MaxAgeInDays': 123,
                        'DeleteSourceFromS3': True|False
                    }
                }
            }
        },
    ]
}

Response Structure

  • (dict) --

    Result message containing a list of application descriptions.

    • Applications (list) --

      This parameter contains a list of ApplicationDescription.

      • (dict) --

        Describes the properties of an application.

        • ApplicationArn (string) --

          The Amazon Resource Name (ARN) of the application.

        • ApplicationName (string) --

          The name of the application.

        • Description (string) --

          User-defined description of the application.

        • DateCreated (datetime) --

          The date when the application was created.

        • DateUpdated (datetime) --

          The date when the application was last modified.

        • Versions (list) --

          The names of the versions for this application.

          • (string) --

        • ConfigurationTemplates (list) --

          The names of the configuration templates associated with this application.

          • (string) --

        • ResourceLifecycleConfig (dict) --

          The lifecycle settings for the application.

          • ServiceRole (string) --

            The ARN of an IAM service role that Elastic Beanstalk has permission to assume.

          • VersionLifecycleConfig (dict) --

            The application version lifecycle configuration.

            • MaxCountRule (dict) --

              Specify a max count rule to restrict the number of application versions that are retained for an application.

              • Enabled (boolean) --

                Specify true to apply the rule, or false to disable it.

              • MaxCount (integer) --

                Specify the maximum number of application versions to retain.

              • DeleteSourceFromS3 (boolean) --

                Set to true to delete a version's source bundle from Amazon S3 when Elastic Beanstalk deletes the application version.

            • MaxAgeRule (dict) --

              Specify a max age rule to restrict the length of time that application versions are retained for an application.

              • Enabled (boolean) --

                Specify true to apply the rule, or false to disable it.

              • MaxAgeInDays (integer) --

                Specify the number of days to retain an application versions.

              • DeleteSourceFromS3 (boolean) --

                Set to true to delete a version's source bundle from Amazon S3 when Elastic Beanstalk deletes the application version.

UpdateApplication (updated) Link ¶
Changes (response)
{'Application': {'ApplicationArn': 'string'}}

Updates the specified application to have the specified properties.

See also: AWS API Documentation

Request Syntax

client.update_application(
    ApplicationName='string',
    Description='string'
)
type ApplicationName:

string

param ApplicationName:

[REQUIRED]

The name of the application to update. If no such application is found, UpdateApplication returns an InvalidParameterValue error.

type Description:

string

param Description:

A new description for the application.

Default: If not specified, AWS Elastic Beanstalk does not update the description.

rtype:

dict

returns:

Response Syntax

{
    'Application': {
        'ApplicationArn': 'string',
        'ApplicationName': 'string',
        'Description': 'string',
        'DateCreated': datetime(2015, 1, 1),
        'DateUpdated': datetime(2015, 1, 1),
        'Versions': [
            'string',
        ],
        'ConfigurationTemplates': [
            'string',
        ],
        'ResourceLifecycleConfig': {
            'ServiceRole': 'string',
            'VersionLifecycleConfig': {
                'MaxCountRule': {
                    'Enabled': True|False,
                    'MaxCount': 123,
                    'DeleteSourceFromS3': True|False
                },
                'MaxAgeRule': {
                    'Enabled': True|False,
                    'MaxAgeInDays': 123,
                    'DeleteSourceFromS3': True|False
                }
            }
        }
    }
}

Response Structure

  • (dict) --

    Result message containing a single description of an application.

    • Application (dict) --

      The ApplicationDescription of the application.

      • ApplicationArn (string) --

        The Amazon Resource Name (ARN) of the application.

      • ApplicationName (string) --

        The name of the application.

      • Description (string) --

        User-defined description of the application.

      • DateCreated (datetime) --

        The date when the application was created.

      • DateUpdated (datetime) --

        The date when the application was last modified.

      • Versions (list) --

        The names of the versions for this application.

        • (string) --

      • ConfigurationTemplates (list) --

        The names of the configuration templates associated with this application.

        • (string) --

      • ResourceLifecycleConfig (dict) --

        The lifecycle settings for the application.

        • ServiceRole (string) --

          The ARN of an IAM service role that Elastic Beanstalk has permission to assume.

        • VersionLifecycleConfig (dict) --

          The application version lifecycle configuration.

          • MaxCountRule (dict) --

            Specify a max count rule to restrict the number of application versions that are retained for an application.

            • Enabled (boolean) --

              Specify true to apply the rule, or false to disable it.

            • MaxCount (integer) --

              Specify the maximum number of application versions to retain.

            • DeleteSourceFromS3 (boolean) --

              Set to true to delete a version's source bundle from Amazon S3 when Elastic Beanstalk deletes the application version.

          • MaxAgeRule (dict) --

            Specify a max age rule to restrict the length of time that application versions are retained for an application.

            • Enabled (boolean) --

              Specify true to apply the rule, or false to disable it.

            • MaxAgeInDays (integer) --

              Specify the number of days to retain an application versions.

            • DeleteSourceFromS3 (boolean) --

              Set to true to delete a version's source bundle from Amazon S3 when Elastic Beanstalk deletes the application version.

UpdateApplicationVersion (updated) Link ¶
Changes (response)
{'ApplicationVersion': {'ApplicationVersionArn': 'string'}}

Updates the specified application version to have the specified properties.

See also: AWS API Documentation

Request Syntax

client.update_application_version(
    ApplicationName='string',
    VersionLabel='string',
    Description='string'
)
type ApplicationName:

string

param ApplicationName:

[REQUIRED]

The name of the application associated with this version.

If no application is found with this name, UpdateApplication returns an InvalidParameterValue error.

type VersionLabel:

string

param VersionLabel:

[REQUIRED]

The name of the version to update.

If no application version is found with this label, UpdateApplication returns an InvalidParameterValue error.

type Description:

string

param Description:

A new description for this version.

rtype:

dict

returns:

Response Syntax

{
    'ApplicationVersion': {
        'ApplicationVersionArn': 'string',
        'ApplicationName': 'string',
        'Description': 'string',
        'VersionLabel': 'string',
        'SourceBuildInformation': {
            'SourceType': 'Git'|'Zip',
            'SourceRepository': 'CodeCommit'|'S3',
            'SourceLocation': 'string'
        },
        'BuildArn': 'string',
        'SourceBundle': {
            'S3Bucket': 'string',
            'S3Key': 'string'
        },
        'DateCreated': datetime(2015, 1, 1),
        'DateUpdated': datetime(2015, 1, 1),
        'Status': 'Processed'|'Unprocessed'|'Failed'|'Processing'|'Building'
    }
}

Response Structure

  • (dict) --

    Result message wrapping a single description of an application version.

    • ApplicationVersion (dict) --

      The ApplicationVersionDescription of the application version.

      • ApplicationVersionArn (string) --

        The Amazon Resource Name (ARN) of the application version.

      • ApplicationName (string) --

        The name of the application to which the application version belongs.

      • Description (string) --

        The description of the application version.

      • VersionLabel (string) --

        A unique identifier for the application version.

      • SourceBuildInformation (dict) --

        If the version's source code was retrieved from AWS CodeCommit, the location of the source code for the application version.

        • SourceType (string) --

          The type of repository.

          • Git

          • Zip

        • SourceRepository (string) --

          Location where the repository is stored.

          • CodeCommit

          • S3

        • SourceLocation (string) --

          The location of the source code, as a formatted string, depending on the value of SourceRepository

          • For CodeCommit, the format is the repository name and commit ID, separated by a forward slash. For example, my-git-repo/265cfa0cf6af46153527f55d6503ec030551f57a.

          • For S3, the format is the S3 bucket name and object key, separated by a forward slash. For example, my-s3-bucket/Folders/my-source-file.

      • BuildArn (string) --

        Reference to the artifact from the AWS CodeBuild build.

      • SourceBundle (dict) --

        The storage location of the application version's source bundle in Amazon S3.

        • S3Bucket (string) --

          The Amazon S3 bucket where the data is located.

        • S3Key (string) --

          The Amazon S3 key where the data is located.

      • DateCreated (datetime) --

        The creation date of the application version.

      • DateUpdated (datetime) --

        The last modified date of the application version.

      • Status (string) --

        The processing status of the application version.