AmplifyGen3 / Client / list_environments

list_environments

AmplifyGen3.Client.list_environments(**kwargs)

Returns a list of the environments for a Gen 3 app.

See also: AWS API Documentation

Request Syntax

response = client.list_environments(
    AppName='string',
    NextToken='string',
    MaxResults=123
)
Parameters:
  • AppName (string) –

    [REQUIRED]

    The name of the app.

  • NextToken (string) – The pagination token returned in a previous response, used to retrieve the next page of results.

  • MaxResults (integer) – The maximum number of results to return in a single response.

Return type:

dict

Returns:

Response Syntax

{
    'Environments': [
        {
            'AppName': 'string',
            'EnvironmentName': 'string',
            'EnvironmentArn': 'string',
            'Type': 'PRODUCTION'|'PREVIEW'|'CUSTOM',
            'SourceConfig': {
                'GitSource': {
                    'BranchMatchPatterns': [
                        'string',
                    ],
                    'DeploymentTriggerEvents': [
                        'PUSH'|'PULL_REQUEST'|'FORK_PULL_REQUEST',
                    ]
                }
            },
            'WafLogConfigs': [
                {
                    'CloudWatchLogsConfig': {
                        'Status': 'ENABLED'|'DISABLED',
                        'SamplingRate': 123,
                        'Scope': 'ALL_REQUESTS'|'BLOCKED_ONLY',
                        'LogGroupArn': 'string'
                    },
                    'S3Config': {
                        'Status': 'ENABLED'|'DISABLED',
                        'SamplingRate': 123,
                        'Scope': 'ALL_REQUESTS'|'BLOCKED_ONLY',
                        'BucketArn': 'string'
                    }
                },
            ],
            'Web': {
                'AccessLogConfig': {
                    'CloudWatchLogsConfig': {
                        'Status': 'ENABLED'|'DISABLED',
                        'SamplingRate': 123,
                        'LogGroupArn': 'string'
                    },
                    'S3Config': {
                        'Status': 'ENABLED'|'DISABLED',
                        'SamplingRate': 123,
                        'BucketArn': 'string'
                    }
                }
            },
            'Backend': {
                'DatabaseLogConfig': {
                    'CloudWatchLogsConfig': {
                        'Status': 'ENABLED'|'DISABLED',
                        'SamplingRate': 123,
                        'LogGroupArn': 'string'
                    },
                    'S3Config': {
                        'Status': 'ENABLED'|'DISABLED',
                        'SamplingRate': 123,
                        'BucketArn': 'string'
                    }
                }
            },
            'CreatedAt': datetime(2015, 1, 1),
            'UpdatedAt': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • Environments (list) –

      The environments.

      • (dict) –

        Summary information for an environment.

        • AppName (string) –

          The name of the app.

        • EnvironmentName (string) –

          The name of the environment.

        • EnvironmentArn (string) –

          The Amazon Resource Name (ARN) of the environment.

        • Type (string) –

          The type of the environment.

        • SourceConfig (dict) –

          The source configuration for the environment.

          Note

          This is a Tagged Union structure. Only one of the following top level keys will be set: GitSource. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

          'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
          
          • GitSource (dict) –

            The Git source information.

            • BranchMatchPatterns (list) –

              The branch name patterns that trigger a deployment.

              • (string) –

            • DeploymentTriggerEvents (list) –

              The Git events that trigger a deployment.

              • (string) –

        • WafLogConfigs (list) –

          A list of the environment’s AWS WAF log configurations. Omitted when the environment has no WAF log configuration.

          • (dict) –

            The AWS WAF log delivery settings for an environment.

            • CloudWatchLogsConfig (dict) –

              The Amazon CloudWatch Logs delivery settings.

              • Status (string) –

                The status of the resource.

              • SamplingRate (integer) –

                The percentage of requests to log.

              • Scope (string) –

                The scope that the setting applies to.

              • LogGroupArn (string) –

                The Amazon Resource Name (ARN) of the Amazon CloudWatch Logs log group.

            • S3Config (dict) –

              The Amazon S3 delivery settings.

              • Status (string) –

                The status of the resource.

              • SamplingRate (integer) –

                The percentage of requests to log.

              • Scope (string) –

                The scope that the setting applies to.

              • BucketArn (string) –

                The Amazon Resource Name (ARN) of the Amazon S3 bucket.

        • Web (dict) –

          The web hosting settings for the environment.

          • AccessLogConfig (dict) –

            The access log delivery settings.

            • CloudWatchLogsConfig (dict) –

              The Amazon CloudWatch Logs delivery settings.

              • Status (string) –

                The status of the resource.

              • SamplingRate (integer) –

                The percentage of requests to log.

              • LogGroupArn (string) –

                The Amazon Resource Name (ARN) of the Amazon CloudWatch Logs log group.

            • S3Config (dict) –

              The Amazon S3 delivery settings.

              • Status (string) –

                The status of the resource.

              • SamplingRate (integer) –

                The percentage of requests to log.

              • BucketArn (string) –

                The Amazon Resource Name (ARN) of the Amazon S3 bucket.

        • Backend (dict) –

          The backend log settings for the environment. Present only when the app has a backend.

          • DatabaseLogConfig (dict) –

            The delivery settings for the environment’s database logs.

            • CloudWatchLogsConfig (dict) –

              The Amazon CloudWatch Logs delivery settings.

              • Status (string) –

                Specifies whether database logs are delivered to CloudWatch Logs.

              • SamplingRate (integer) –

                The percentage of database log lines that are delivered to CloudWatch Logs, from 0 to 100. Absent when no rate is stored, in which case 100% of the lines are delivered.

              • LogGroupArn (string) –

                The Amazon Resource Name (ARN) of the Amazon CloudWatch Logs log group that receives the database logs. Present while delivery is ENABLED.

            • S3Config (dict) –

              The Amazon S3 delivery settings.

              • Status (string) –

                Specifies whether database logs are delivered to Amazon S3.

              • SamplingRate (integer) –

                The percentage of database log lines that are delivered to Amazon S3, from 0 to 100. Absent when no rate is stored, in which case 100% of the lines are delivered.

              • BucketArn (string) –

                The Amazon Resource Name (ARN) of the S3 bucket that receives the database logs. The bucket is kept while delivery is DISABLED.

        • CreatedAt (datetime) –

          The time at which the environment was created. The value is in ISO-8601 format.

        • UpdatedAt (datetime) –

          The time at which the environment was last updated. The value is in ISO-8601 format.

    • NextToken (string) –

      The pagination token returned in a previous response, used to retrieve the next page of results.

Exceptions