AmplifyGen3 / Client / get_environment

get_environment

AmplifyGen3.Client.get_environment(**kwargs)

Retrieves an environment for a Gen 3 app.

See also: AWS API Documentation

Request Syntax

response = client.get_environment(
    AppName='string',
    EnvironmentName='string'
)
Parameters:
  • AppName (string) –

    [REQUIRED]

    The name of the app.

  • EnvironmentName (string) –

    [REQUIRED]

    The name of the environment.

Return type:

dict

Returns:

Response Syntax

{
    'AppName': 'string',
    'EnvironmentName': 'string',
    'EnvironmentArn': 'string',
    'Type': 'PRODUCTION'|'PREVIEW'|'CUSTOM',
    'EnvironmentRoleArn': 'string',
    'EnvironmentRolePermissionMode': 'SCOPED'|'FULL',
    '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'
            }
        },
    ],
    'GradualRolloutConfig': {
        'PresetConfig': {
            'Preset': 'ALL_AT_ONCE'|'CANARY_10_PERCENT_5_MINUTES'|'CANARY_10_PERCENT_15_MINUTES'|'CANARY_10_PERCENT_30_MINUTES'|'LINEAR_10_PERCENT_EVERY_1_MINUTE'|'LINEAR_10_PERCENT_EVERY_3_MINUTES'|'LINEAR_10_PERCENT_EVERY_10_MINUTES'
        }
    },
    'Web': {
        'AccessLogConfig': {
            'CloudWatchLogsConfig': {
                'Status': 'ENABLED'|'DISABLED',
                'SamplingRate': 123,
                'LogGroupArn': 'string'
            },
            'S3Config': {
                'Status': 'ENABLED'|'DISABLED',
                'SamplingRate': 123,
                'BucketArn': 'string'
            }
        },
        'EnvironmentAliasConfig': {
            'RoutingMode': 'AUTO_ROUTE_TO_LATEST'|'MANUAL'
        },
        'SkewProtectionConfig': {
            'Status': 'ENABLED'|'DISABLED',
            'CookieMaxAgeSeconds': 123
        }
    },
    'Backend': {
        'Auth': 'string',
        'Database': {
            'MaxBackendCapacityUnits': 123,
            'BackupRetentionDays': 123
        },
        'DatabaseLogConfig': {
            'CloudWatchLogsConfig': {
                'Status': 'ENABLED'|'DISABLED',
                'SamplingRate': 123,
                'LogGroupArn': 'string'
            },
            'S3Config': {
                'Status': 'ENABLED'|'DISABLED',
                'SamplingRate': 123,
                'BucketArn': 'string'
            }
        }
    },
    'NetworkConfig': {
        'BuildNetworkConnectorArn': 'string',
        'ComputeNetworkConnectorArn': 'string'
    },
    'CreatedAt': datetime(2015, 1, 1),
    'UpdatedAt': datetime(2015, 1, 1)
}

Response Structure

  • (dict) –

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

    • EnvironmentRoleArn (string) –

      The Amazon Resource Name (ARN) of the IAM role for the environment.

    • EnvironmentRolePermissionMode (string) –

      The permission mode for the environment’s IAM role.

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

    • GradualRolloutConfig (dict) –

      The gradual rollout settings.

      Note

      This is a Tagged Union structure. Only one of the following top level keys will be set: PresetConfig. 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'}
      
      • PresetConfig (dict) –

        The predefined gradual rollout schedule.

        • Preset (string) –

          The predefined gradual rollout schedule to use.

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

      • EnvironmentAliasConfig (dict) –

        The alias routing settings for the environment.

        • RoutingMode (string) –

          How the environment alias routes traffic to deployments.

      • SkewProtectionConfig (dict) –

        The version skew protection settings.

        • Status (string) –

          The status of the resource.

        • CookieMaxAgeSeconds (integer) –

          The maximum age, in seconds, of the version skew protection cookie.

    • Backend (dict) –

      The backend settings for the environment. Database is present only when the app has a backend. Auth is present whenever it is stored.

      • Auth (string) –

        The authentication settings for the environment’s backend, as a JSON document, from the most recent successful CreateEnvironment or UpdateEnvironment request. The settings take effect at the next deployment.

      • Database (dict) –

        The database settings for the environment, from the most recent successful CreateEnvironment or UpdateEnvironment request. The settings take effect at the next deployment.

        • MaxBackendCapacityUnits (integer) –

          The maximum number of backend capacity units that the environment’s database can scale to.

        • BackupRetentionDays (integer) –

          The number of days that automated backups are kept. This is also how far back the environment’s database can be restored.

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

    • NetworkConfig (dict) –

      The VPC network configuration for the environment.

      • BuildNetworkConnectorArn (string) –

        The Amazon Resource Name (ARN) of the network connector used for VPC access during builds.

      • ComputeNetworkConnectorArn (string) –

        The Amazon Resource Name (ARN) of the network connector used for VPC access at runtime.

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

Exceptions