AWS Elastic Beanstalk

2016/12/22 - AWS Elastic Beanstalk - 1 new 3 updated api methods

Changes  Adds a new feature for managing Application Version Lifecycle.

UpdateApplicationResourceLifecycle (new) Link ¶

Modifies lifecycle settings for an application.

See also: AWS API Documentation

Request Syntax

client.update_application_resource_lifecycle(
    ApplicationName='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.

type ResourceLifecycleConfig

dict

param ResourceLifecycleConfig

[REQUIRED]

The lifecycle configuration.

  • 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

{
    'ApplicationName': '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) --

    • ApplicationName (string) --

      The name of the application.

    • ResourceLifecycleConfig (dict) --

      The lifecycle configuration.

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

CreateApplication (updated) Link ¶
Changes (request, response)
Request
{'ResourceLifecycleConfig': {'ServiceRole': 'string',
                             'VersionLifecycleConfig': {'MaxAgeRule': {'DeleteSourceFromS3': 'boolean',
                                                                       'Enabled': 'boolean',
                                                                       'MaxAgeInDays': 'integer'},
                                                        'MaxCountRule': {'DeleteSourceFromS3': 'boolean',
                                                                         'Enabled': 'boolean',
                                                                         'MaxCount': 'integer'}}}}
Response
{'Application': {'ResourceLifecycleConfig': {'ServiceRole': 'string',
                                             'VersionLifecycleConfig': {'MaxAgeRule': {'DeleteSourceFromS3': 'boolean',
                                                                                       'Enabled': 'boolean',
                                                                                       'MaxAgeInDays': 'integer'},
                                                                        'MaxCountRule': {'DeleteSourceFromS3': 'boolean',
                                                                                         'Enabled': 'boolean',
                                                                                         'MaxCount': 'integer'}}}}}

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': {
        '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.

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

DescribeApplications (updated) Link ¶
Changes (response)
{'Applications': {'ResourceLifecycleConfig': {'ServiceRole': 'string',
                                              'VersionLifecycleConfig': {'MaxAgeRule': {'DeleteSourceFromS3': 'boolean',
                                                                                        'Enabled': 'boolean',
                                                                                        'MaxAgeInDays': 'integer'},
                                                                         'MaxCountRule': {'DeleteSourceFromS3': 'boolean',
                                                                                          'Enabled': 'boolean',
                                                                                          'MaxCount': 'integer'}}}}}

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': [
        {
            '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.

        • 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': {'ResourceLifecycleConfig': {'ServiceRole': 'string',
                                             'VersionLifecycleConfig': {'MaxAgeRule': {'DeleteSourceFromS3': 'boolean',
                                                                                       'Enabled': 'boolean',
                                                                                       'MaxAgeInDays': 'integer'},
                                                                        'MaxCountRule': {'DeleteSourceFromS3': 'boolean',
                                                                                         'Enabled': 'boolean',
                                                                                         'MaxCount': 'integer'}}}}}

Updates the specified application to have the specified properties.

Note

If a property (for example, description ) is not provided, the value remains unchanged. To clear these properties, specify an empty string.

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': {
        '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.

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