Select your cookie preferences

We use cookies and similar tools to enhance your experience, provide our services, deliver relevant advertising, and make improvements. Approved third parties also use these tools to help us deliver advertising and provide certain site features.

get_environment

get_environment(**kwargs)

Retrieves information about an environment. An environment is a deployment group of AppConfig applications, such as applications in a Production environment or in an EU_Region environment. Each configuration deployment targets an environment. You can enable one or more Amazon CloudWatch alarms for an environment. If an alarm is triggered during a deployment, AppConfig roles back the configuration.

See also: AWS API Documentation

Request Syntax

response = client.get_environment(
    ApplicationId='string',
    EnvironmentId='string'
)
Parameters
  • ApplicationId (string) --

    [REQUIRED]

    The ID of the application that includes the environment you want to get.

  • EnvironmentId (string) --

    [REQUIRED]

    The ID of the environment that you want to get.

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.ResourceNotFoundException
  • AppConfig.Client.exceptions.InternalServerException
  • AppConfig.Client.exceptions.BadRequestException

Examples

The following get-environment example returns the details and state of the specified environment.

response = client.get_environment(
    ApplicationId='339ohji',
    EnvironmentId='54j1r29',
)

print(response)

Expected Output:

{
    'ApplicationId': '339ohji',
    'Id': '54j1r29',
    'Name': 'Example-Environment',
    'State': 'READY_FOR_DEPLOYMENT',
    'ResponseMetadata': {
        '...': '...',
    },
}