AmplifyGen3 / Client / update_environment
update_environment¶
- AmplifyGen3.Client.update_environment(**kwargs)¶
Updates an environment for a Gen 3 app.
See also: AWS API Documentation
Request Syntax
response = client.update_environment( AppName='string', EnvironmentName='string', EnvironmentRoleArn='string', EnvironmentRolePermissionMode='SCOPED'|'FULL', SourceConfig={ 'GitSource': { 'BranchMatchPatterns': [ 'string', ], 'DeploymentTriggerEvents': [ 'PUSH'|'PULL_REQUEST'|'FORK_PULL_REQUEST', ] }, 'NoSource': {} }, WafLogConfigs=[ { 'CloudWatchLogsConfig': { 'Status': 'ENABLED'|'DISABLED', 'SamplingRate': 123, 'Scope': 'ALL_REQUESTS'|'BLOCKED_ONLY' }, '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 }, '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 }, 'S3Config': { 'Status': 'ENABLED'|'DISABLED', 'SamplingRate': 123, 'BucketArn': 'string' } } }, NetworkConfig={ 'BuildNetworkConnectorArn': 'string', 'ComputeNetworkConnectorArn': 'string' } )
- Parameters:
AppName (string) –
[REQUIRED]
The name of the app.
EnvironmentName (string) –
[REQUIRED]
The name 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 can be set:
GitSource,NoSource.GitSource (dict) –
The Git source information.
BranchMatchPatterns (list) – [REQUIRED]
The branch name patterns that trigger a deployment.
(string) –
DeploymentTriggerEvents (list) –
The Git events that trigger a deployment.
(string) –
NoSource (dict) –
Removes the configured source repository.
WafLogConfigs (list) –
A list of the environment’s AWS WAF log configurations.
(dict) –
The AWS WAF log delivery settings to apply to an environment.
CloudWatchLogsConfig (dict) –
The Amazon CloudWatch Logs delivery settings.
Status (string) – [REQUIRED]
The status of the resource.
SamplingRate (integer) –
The percentage of requests to log.
Scope (string) –
The scope that the setting applies to.
S3Config (dict) –
The Amazon S3 delivery settings.
Status (string) – [REQUIRED]
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. If you specify a different bucket while S3 delivery is enabled, delivery moves to that bucket. Logs written during the move may be lost.
GradualRolloutConfig (dict) –
The gradual rollout settings.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
PresetConfig.PresetConfig (dict) –
The predefined gradual rollout schedule.
Preset (string) – [REQUIRED]
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) – [REQUIRED]
The status of the resource.
SamplingRate (integer) –
The percentage of requests to log.
S3Config (dict) –
The Amazon S3 delivery settings.
Status (string) – [REQUIRED]
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. If you specify a different bucket while S3 delivery is enabled, delivery moves to that bucket. Logs written during the move may be lost.
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. You can specify Auth and Database only when the app has a backend. An app without a backend can specify this only to turn off backend log delivery. If you omit a member, that setting is unchanged.
Auth (string) –
The authentication settings for the environment’s backend, as a JSON document. If you omit this, the stored settings are unchanged. Specify an empty JSON object ({}) to reset the settings to the defaults.
Database (dict) –
The database settings for the environment. If you omit this, the stored settings are unchanged. If you specify this, it replaces the stored settings, so a member that you omit uses the plan’s default. A value above the limit of the account’s plan causes the next deployment to fail, not this request, because the plan can change between the two.
MaxBackendCapacityUnits (integer) –
The maximum number of backend capacity units that the environment’s database can scale to.
BackupRetentionDays (integer) –
The number of days to keep automated backups. This is also how far back the environment’s database can be restored.
DatabaseLogConfig (dict) –
The delivery settings for the environment’s database logs. If you omit this, the stored settings are unchanged. You can specify this only when the app has a backend, unless the request only turns off delivery destinations.
CloudWatchLogsConfig (dict) –
The Amazon CloudWatch Logs delivery settings.
Status (string) – [REQUIRED]
Specifies whether to deliver database logs to CloudWatch Logs.
SamplingRate (integer) –
The percentage of database log lines to deliver to CloudWatch Logs. When Status is ENABLED, specify a value from 1 to 100. When Status is DISABLED, omit this or specify 0. If you omit this, the stored rate is used, or 100 if no rate is stored.
S3Config (dict) –
The Amazon S3 delivery settings.
Status (string) – [REQUIRED]
Specifies whether to deliver database logs to Amazon S3.
SamplingRate (integer) –
The percentage of database log lines to deliver to Amazon S3. When Status is ENABLED, specify a value from 1 to 100. When Status is DISABLED, omit this or specify 0. If you omit this, the stored rate is used, or 100 if no rate is stored.
BucketArn (string) –
The Amazon Resource Name (ARN) of the S3 bucket to deliver the database logs to. Required when Status is ENABLED, unless a bucket is already stored. If you omit this, the stored bucket is used. If you specify a different bucket, delivery moves to that bucket.
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. Set an empty value to remove it.
ComputeNetworkConnectorArn (string) –
The Amazon Resource Name (ARN) of the network connector used for VPC access at runtime. Set an empty value to remove it.
- Return type:
dict
- Returns:
Response Syntax
{}Response Structure
(dict) –
Exceptions