update_environment

update_environment(**kwargs)

Updates an environment.

See also: AWS API Documentation

Request Syntax

response = client.update_environment(
    ApplicationId='string',
    EnvironmentId='string',
    Name='string',
    Description='string',
    Monitors=[
        {
            'AlarmArn': 'string',
            'AlarmRoleArn': 'string'
        },
    ]
)
Parameters
  • ApplicationId (string) --

    [REQUIRED]

    The application ID.

  • EnvironmentId (string) --

    [REQUIRED]

    The environment ID.

  • Name (string) -- The name of the environment.
  • Description (string) -- A description of the environment.
  • Monitors (list) --

    Amazon CloudWatch alarms to monitor during the deployment process.

    • (dict) --

      Amazon CloudWatch alarms to monitor during the deployment process.

      • AlarmArn (string) -- [REQUIRED]

        Amazon Resource Name (ARN) of the Amazon CloudWatch alarm.

      • AlarmRoleArn (string) --

        ARN of an Identity and Access Management (IAM) role for AppConfig to monitor AlarmArn .

Return type

dict

Returns

Response Syntax

{
    'ApplicationId': 'string',
    'Id': 'string',
    'Name': 'string',
    'Description': 'string',
    'State': 'READY_FOR_DEPLOYMENT'|'DEPLOYING'|'ROLLING_BACK'|'ROLLED_BACK',
    'Monitors': [
        {
            'AlarmArn': 'string',
            'AlarmRoleArn': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • ApplicationId (string) --

      The application ID.

    • Id (string) --

      The environment ID.

    • Name (string) --

      The name of the environment.

    • Description (string) --

      The description of the environment.

    • State (string) --

      The state of the environment. An environment can be in one of the following states: READY_FOR_DEPLOYMENT , DEPLOYING , ROLLING_BACK , or ROLLED_BACK

    • Monitors (list) --

      Amazon CloudWatch alarms monitored during the deployment.

      • (dict) --

        Amazon CloudWatch alarms to monitor during the deployment process.

        • AlarmArn (string) --

          Amazon Resource Name (ARN) of the Amazon CloudWatch alarm.

        • AlarmRoleArn (string) --

          ARN of an Identity and Access Management (IAM) role for AppConfig to monitor AlarmArn .

Exceptions

  • AppConfig.Client.exceptions.BadRequestException
  • AppConfig.Client.exceptions.ResourceNotFoundException
  • AppConfig.Client.exceptions.InternalServerException

Examples

The following update-environment example updates an environment's description.

response = client.update_environment(
    ApplicationId='339ohji',
    Description='An environment for examples.',
    EnvironmentId='54j1r29',
)

print(response)

Expected Output:

{
    'ApplicationId': '339ohji',
    'Description': 'An environment for examples.',
    'Id': '54j1r29',
    'Name': 'Example-Environment',
    'State': 'ROLLED_BACK',
    'ResponseMetadata': {
        '...': '...',
    },
}