update_environment
async
¶
update_environment(
name: EnvironmentName,
*,
config_overrides: Optional[AsyncMWAAClientConfig] = None,
execution_role_arn: Optional[IamRoleArn] = None,
airflow_configuration_options: Optional[AirflowConfigurationOptions] = None,
airflow_version: Optional[AirflowVersion] = None,
dag_s3_path: Optional[RelativePath] = None,
environment_class: Optional[EnvironmentClass] = None,
logging_configuration: Optional[LoggingConfigurationInput] = None,
max_workers: Optional[MaxWorkers] = None,
min_workers: Optional[MinWorkers] = None,
max_webservers: Optional[MaxWebservers] = None,
min_webservers: Optional[MinWebservers] = None,
worker_replacement_strategy: Optional[WorkerReplacementStrategy] = None,
network_configuration: Optional[UpdateNetworkConfigurationInput] = None,
plugins_s3_path: Optional[RelativePath] = None,
plugins_s3_object_version: Optional[S3ObjectVersion] = None,
requirements_s3_path: Optional[RelativePath] = None,
requirements_s3_object_version: Optional[S3ObjectVersion] = None,
schedulers: Optional[Schedulers] = None,
source_bucket_arn: Optional[S3BucketArn] = None,
startup_script_s3_path: Optional[RelativePath] = None,
startup_script_s3_object_version: Optional[S3ObjectVersion] = None,
webserver_access_mode: Optional[WebserverAccessMode] = None,
weekly_maintenance_window_start: Optional[WeeklyMaintenanceWindowStart] = None,
) -> UpdateEnvironmentOutput
Updates an Amazon Managed Workflows for Apache Airflow (MWAA) environment.
Parameters:
-
name(EnvironmentName) –The name of your Amazon MWAA environment. For example,
MyMWAAEnvironment. -
execution_role_arn(Optional[IamRoleArn], default:None) –The Amazon Resource Name (ARN) of the execution role in IAM that allows MWAA to access Amazon Web Services resources in your environment. For example,
arn:aws:iam::123456789:role/my-execution-role. For more information, refer to Amazon MWAA Execution role. -
airflow_configuration_options(Optional[AirflowConfigurationOptions], default:None) –A list of key-value pairs containing the Apache Airflow configuration options you want to attach to your environment. For more information, refer to Apache Airflow configuration options.
-
airflow_version(Optional[AirflowVersion], default:None) –The Apache Airflow version for your environment. To upgrade your environment, specify a newer version of Apache Airflow supported by Amazon MWAA. To downgrade your environment, specify an older version of Apache Airflow supported by Amazon MWAA.
Before you upgrade or downgrade an environment, make sure your requirements, DAGs, plugins, and other resources used in your workflows are compatible with the new Apache Airflow version. For more information about updating your resources, see Upgrading and downgrading an Amazon MWAA environment.
Valid values:
2.7.2,2.8.1,2.9.2,2.10.1,2.10.3,2.11.0, and3.0.6. -
dag_s3_path(Optional[RelativePath], default:None) –The relative path to the DAGs folder on your Amazon S3 bucket. For example,
dags. For more information, refer to Adding or updating DAGs. -
environment_class(Optional[EnvironmentClass], default:None) –The environment class type. Valid values:
mw1.micro,mw1.small,mw1.medium,mw1.large,mw1.xlarge, andmw1.2xlarge. For more information, refer to Amazon MWAA environment class. -
logging_configuration(Optional[LoggingConfigurationInput], default:None) –The Apache Airflow log types to send to CloudWatch Logs.
-
max_workers(Optional[MaxWorkers], default:None) –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
MaxWorkersfield. 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. -
min_workers(Optional[MinWorkers], default:None) –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
MaxWorkersfield. 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 theMinWorkersfield. For example,2. -
max_webservers(Optional[MaxWebservers], default:None) –The maximum number of web servers that you want to run in your environment. Amazon MWAA scales the number of Apache Airflow web servers up to the number you specify for
MaxWebserverswhen you interact with your Apache Airflow environment using Apache Airflow REST API, or the Apache Airflow CLI. For example, in scenarios where your workload requires network calls to the Apache Airflow REST API with a high transaction-per-second (TPS) rate, Amazon MWAA will increase the number of web servers up to the number set inMaxWebserers. As TPS rates decrease Amazon MWAA disposes of the additional web servers, and scales down to the number set inMinxWebserers.Valid values: For environments larger than mw1.micro, accepts values from
2to5. Defaults to2for all environment sizes except mw1.micro, which defaults to1. -
min_webservers(Optional[MinWebservers], default:None) –The minimum number of web servers that you want to run in your environment. Amazon MWAA scales the number of Apache Airflow web servers up to the number you specify for
MaxWebserverswhen you interact with your Apache Airflow environment using Apache Airflow REST API, or the Apache Airflow CLI. As the transaction-per-second rate, and the network load, decrease, Amazon MWAA disposes of the additional web servers, and scales down to the number set inMinxWebserers.Valid values: For environments larger than mw1.micro, accepts values from
2to5. Defaults to2for all environment sizes except mw1.micro, which defaults to1. -
worker_replacement_strategy(Optional[WorkerReplacementStrategy], default:None) –The worker replacement strategy to use when updating the environment.
You can select one of the following strategies:
-
Forced - Stops and replaces Apache Airflow workers without waiting for tasks to complete before an update.
-
Graceful - Allows Apache Airflow workers to complete running tasks for up to 12 hours during an update before they're stopped and replaced.
-
-
network_configuration(Optional[UpdateNetworkConfigurationInput], default:None) –The VPC networking components used to secure and enable network traffic between the Amazon Web Services resources for your environment. For more information, refer to About networking on Amazon MWAA.
-
plugins_s3_path(Optional[RelativePath], default:None) –The relative path to the
plugins.zipfile on your Amazon S3 bucket. For example,plugins.zip. If specified, then the plugins.zip version is required. For more information, refer to Installing custom plugins. -
plugins_s3_object_version(Optional[S3ObjectVersion], default:None) –The version of the plugins.zip file on your Amazon S3 bucket. You must specify a version each time a
plugins.zipfile is updated. For more information, refer to How S3 Versioning works. -
requirements_s3_path(Optional[RelativePath], default:None) –The relative path to the
requirements.txtfile on your Amazon S3 bucket. For example,requirements.txt. If specified, then a file version is required. For more information, refer to Installing Python dependencies. -
requirements_s3_object_version(Optional[S3ObjectVersion], default:None) –The version of the requirements.txt file on your Amazon S3 bucket. You must specify a version each time a
requirements.txtfile is updated. For more information, refer to How S3 Versioning works. -
schedulers(Optional[Schedulers], default:None) –The number of Apache Airflow schedulers to run in your Amazon MWAA environment.
-
source_bucket_arn(Optional[S3BucketArn], default:None) –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. For more information, refer to Create an Amazon S3 bucket for Amazon MWAA. -
startup_script_s3_path(Optional[RelativePath], default:None) –The relative path to the startup shell script in your Amazon S3 bucket. For example,
s3://mwaa-environment/startup.sh.Amazon MWAA runs the script as your environment starts, and before running the Apache Airflow process. You can use this script to install dependencies, modify Apache Airflow configuration options, and set environment variables. For more information, refer to Using a startup script.
-
startup_script_s3_object_version(Optional[S3ObjectVersion], default:None) –The version of the startup shell script in your Amazon S3 bucket. You must specify the version ID that Amazon S3 assigns to the file every time you update the script.
Version IDs are Unicode, UTF-8 encoded, URL-ready, opaque strings that are no more than 1,024 bytes long. The following is an example:
3sL4kqtJlcpXroDTDmJ+rmSpXd3dIbrHY+MTRCxf3vjVBH40Nr8X8gdRQBpUMLUoFor more information, refer to Using a startup script.
-
webserver_access_mode(Optional[WebserverAccessMode], default:None) –The Apache Airflow Web server access mode. For more information, refer to Apache Airflow access modes.
If set to
PUBLIC_AND_PRIVATE, creates both a public network load balancer (NLB) for browser access and a private VPC endpoint (VPCE) for worker-to-webserver communication. This mode is only available for Apache Airflow version 3.2 and later. -
weekly_maintenance_window_start(Optional[WeeklyMaintenanceWindowStart], default:None) –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.
Raises:
-
InternalServerException–InternalServerException: An internal error has occurred.
-
ResourceNotFoundException–ResourceNotFoundException: The resource is not available.
-
ServiceUnavailableException–ServiceUnavailableException: The service is currently unavailable.
-
ValidationException–ValidationException: The provided input is not valid.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_mwaa/_services/async_mwaa.py
953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 | |