UpdateEnvironment
Updates an Amazon Managed Workflows for Apache Airflow (MWAA) environment.
Request Syntax
PATCH /environments/Name
HTTP/1.1
Content-type: application/json
{
"AirflowConfigurationOptions": {
"string
" : "string
"
},
"AirflowVersion": "string
",
"DagS3Path": "string
",
"EnvironmentClass": "string
",
"ExecutionRoleArn": "string
",
"LoggingConfiguration": {
"DagProcessingLogs": {
"Enabled": boolean
,
"LogLevel": "string
"
},
"SchedulerLogs": {
"Enabled": boolean
,
"LogLevel": "string
"
},
"TaskLogs": {
"Enabled": boolean
,
"LogLevel": "string
"
},
"WebserverLogs": {
"Enabled": boolean
,
"LogLevel": "string
"
},
"WorkerLogs": {
"Enabled": boolean
,
"LogLevel": "string
"
}
},
"MaxWorkers": number
,
"MinWorkers": number
,
"NetworkConfiguration": {
"SecurityGroupIds": [ "string
" ]
},
"PluginsS3ObjectVersion": "string
",
"PluginsS3Path": "string
",
"RequirementsS3ObjectVersion": "string
",
"RequirementsS3Path": "string
",
"Schedulers": number
,
"SourceBucketArn": "string
",
"WebserverAccessMode": "string
",
"WeeklyMaintenanceWindowStart": "string
"
}
URI Request Parameters
The request uses the following URI parameters.
- Name
-
The name of your Amazon MWAA environment. For example,
MyMWAAEnvironment
.Length Constraints: Minimum length of 1. Maximum length of 80.
Pattern:
^[a-zA-Z][0-9a-zA-Z-_]*$
Required: Yes
Request Body
The request accepts the following data in JSON format.
- AirflowConfigurationOptions
-
A list of key-value pairs containing the Apache Airflow configuration options you want to attach to your environment. To learn more, see Apache Airflow configuration options.
Type: String to string map
Key Length Constraints: Minimum length of 1. Maximum length of 64.
Key Pattern:
^[a-z]+([a-z0-9._]*[a-z0-9_]+)?$
Value Length Constraints: Minimum length of 1. Maximum length of 65536.
Value Pattern:
^[ -~]+$
Required: No
- AirflowVersion
-
The Apache Airflow version for your environment. If no value is specified, defaults to the latest version. Valid values:
1.10.12
,2.0.2
,2.2.2
, and2.4.3
.Type: String
Length Constraints: Minimum length of 1. Maximum length of 32.
Pattern:
^[0-9a-z.]+$
Required: No
- DagS3Path
-
The relative path to the DAGs folder on your Amazon S3 bucket. For example,
dags
. To learn more, see Adding or updating DAGs.Type: String
Length Constraints: Minimum length of 1. Maximum length of 1024.
Pattern:
.*
Required: No
- EnvironmentClass
-
The environment class type. Valid values:
mw1.small
,mw1.medium
,mw1.large
. To learn more, see Amazon MWAA environment class.Type: String
Length Constraints: Minimum length of 1. Maximum length of 1024.
Required: No
- ExecutionRoleArn
-
The Amazon Resource Name (ARN) of the execution role in IAM that allows MWAA to access AWS resources in your environment. For example,
arn:aws:iam::123456789:role/my-execution-role
. To learn more, see Amazon MWAA Execution role.Type: String
Length Constraints: Minimum length of 1. Maximum length of 1224.
Pattern:
^arn:aws(-[a-z]+)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+$
Required: No
- LoggingConfiguration
-
The Apache Airflow log types to send to CloudWatch Logs.
Type: LoggingConfigurationInput object
Required: No
- MaxWorkers
-
The maximum number of workers that you want to run in your environment. MWAA scales the number of Apache Airflow workers up to the number you specify in the
MaxWorkers
field. For example,20
. When there are no more tasks running, and no more in the queue, MWAA disposes of the extra workers leaving the one worker that is included with your environment, or the number you specify inMinWorkers
.Type: Integer
Valid Range: Minimum value of 1.
Required: No
- MinWorkers
-
The minimum number of workers that you want to run in your environment. MWAA scales the number of Apache Airflow workers up to the number you specify in the
MaxWorkers
field. When there are no more tasks running, and no more in the queue, MWAA disposes of the extra workers leaving the worker count you specify in theMinWorkers
field. For example,2
.Type: Integer
Valid Range: Minimum value of 1.
Required: No
- NetworkConfiguration
-
The VPC networking components used to secure and enable network traffic between the AWS resources for your environment. To learn more, see About networking on Amazon MWAA.
Type: UpdateNetworkConfigurationInput object
Required: No
- PluginsS3ObjectVersion
-
The version of the plugins.zip file on your Amazon S3 bucket. A version must be specified each time a plugins.zip file is updated. To learn more, see How S3 Versioning works.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 1024.
Required: No
- PluginsS3Path
-
The relative path to the
plugins.zip
file on your Amazon S3 bucket. For example,plugins.zip
. If specified, then the plugins.zip version is required. To learn more, see Installing custom plugins.Type: String
Length Constraints: Minimum length of 1. Maximum length of 1024.
Pattern:
.*
Required: No
- RequirementsS3ObjectVersion
-
The version of the requirements.txt file on your Amazon S3 bucket. A version must be specified each time a requirements.txt file is updated. To learn more, see How S3 Versioning works.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 1024.
Required: No
- RequirementsS3Path
-
The relative path to the
requirements.txt
file on your Amazon S3 bucket. For example,requirements.txt
. If specified, then a file version is required. To learn more, see Installing Python dependencies.Type: String
Length Constraints: Minimum length of 1. Maximum length of 1024.
Pattern:
.*
Required: No
- Schedulers
-
The number of Apache Airflow schedulers to run in your Amazon MWAA environment.
Type: Integer
Valid Range: Maximum value of 5.
Required: No
- SourceBucketArn
-
The Amazon Resource Name (ARN) of the Amazon S3 bucket where your DAG code and supporting files are stored. For example,
arn:aws:s3:::my-airflow-bucket-unique-name
. To learn more, see Create an Amazon S3 bucket for Amazon MWAA.Type: String
Length Constraints: Minimum length of 1. Maximum length of 1224.
Pattern:
^arn:aws(-[a-z]+)?:s3:::[a-z0-9.\-]+$
Required: No
- WebserverAccessMode
-
The Apache Airflow Web server access mode. To learn more, see Apache Airflow access modes.
Type: String
Valid Values:
PRIVATE_ONLY | PUBLIC_ONLY
Required: No
- WeeklyMaintenanceWindowStart
-
The day and time of the week in Coordinated Universal Time (UTC) 24-hour standard time to start weekly maintenance updates of your environment in the following format:
DAY:HH:MM
. For example:TUE:03:30
. You can specify a start time in 30 minute increments only.Type: String
Length Constraints: Minimum length of 1. Maximum length of 9.
Pattern:
(MON|TUE|WED|THU|FRI|SAT|SUN):([01]\d|2[0-3]):(00|30)
Required: No
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"Arn": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- Arn
-
The Amazon Resource Name (ARN) of the Amazon MWAA environment. For example,
arn:aws:airflow:us-east-1:123456789012:environment/MyMWAAEnvironment
.Type: String
Length Constraints: Minimum length of 1. Maximum length of 1224.
Pattern:
^arn:aws(-[a-z]+)?:airflow:[a-z0-9\-]+:\d{12}:environment/\w+
Errors
For information about the errors that are common to all actions, see Common Errors.
- InternalServerException
-
InternalServerException: An internal error has occurred.
HTTP Status Code: 500
- ResourceNotFoundException
-
ResourceNotFoundException: The resource is not available.
HTTP Status Code: 404
- ValidationException
-
ValidationException: The provided input is not valid.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: