Table of Contents
A low-level client representing AmazonMWAA
This section contains the Amazon Managed Workflows for Apache Airflow (MWAA) API reference documentation. For more information, see What Is Amazon MWAA? .
import boto3
client = boto3.client('mwaa')
These are the available methods:
Check if an operation can be paginated.
Create a CLI token to use Airflow CLI.
See also: AWS API Documentation
Request Syntax
response = client.create_cli_token(
Name='string'
)
[REQUIRED]
Create a CLI token request for a MWAA environment.
{
'CliToken': 'string',
'WebServerHostname': 'string'
}
Response Structure
Create an Airflow CLI login token response for the provided JWT token.
Create an Airflow CLI login token response for the provided webserver hostname.
Exceptions
JSON blob that describes the environment to create.
See also: AWS API Documentation
Request Syntax
response = client.create_environment(
AirflowConfigurationOptions={
'string': 'string'
},
AirflowVersion='string',
DagS3Path='string',
EnvironmentClass='string',
ExecutionRoleArn='string',
KmsKey='string',
LoggingConfiguration={
'DagProcessingLogs': {
'Enabled': True|False,
'LogLevel': 'CRITICAL'|'ERROR'|'WARNING'|'INFO'|'DEBUG'
},
'SchedulerLogs': {
'Enabled': True|False,
'LogLevel': 'CRITICAL'|'ERROR'|'WARNING'|'INFO'|'DEBUG'
},
'TaskLogs': {
'Enabled': True|False,
'LogLevel': 'CRITICAL'|'ERROR'|'WARNING'|'INFO'|'DEBUG'
},
'WebserverLogs': {
'Enabled': True|False,
'LogLevel': 'CRITICAL'|'ERROR'|'WARNING'|'INFO'|'DEBUG'
},
'WorkerLogs': {
'Enabled': True|False,
'LogLevel': 'CRITICAL'|'ERROR'|'WARNING'|'INFO'|'DEBUG'
}
},
MaxWorkers=123,
Name='string',
NetworkConfiguration={
'SecurityGroupIds': [
'string',
],
'SubnetIds': [
'string',
]
},
PluginsS3ObjectVersion='string',
PluginsS3Path='string',
RequirementsS3ObjectVersion='string',
RequirementsS3Path='string',
SourceBucketArn='string',
Tags={
'string': 'string'
},
WebserverAccessMode='PRIVATE_ONLY'|'PUBLIC_ONLY',
WeeklyMaintenanceWindowStart='string'
)
The Apache Airflow configuration setting you want to override in your environment. For more information, see Environment configuration .
[REQUIRED]
The relative path to the DAG folder on your Amazon S3 storage bucket. For example, dags . For more information, see Importing DAGs on Amazon MWAA .
[REQUIRED]
The Amazon Resource Name (ARN) of the execution role for your environment. An execution role is an AWS Identity and Access Management (IAM) role that grants MWAA permission to access AWS services and resources used by your environment. For example, arn:aws:iam::123456789:role/my-execution-role . For more information, see Managing access to Amazon Managed Workflows for Apache Airflow .
The Apache Airflow logs you want to send to Amazon CloudWatch Logs.
A JSON blob that provides configuration to use for logging with respect to the various Apache Airflow services: DagProcessingLogs, SchedulerLogs, TaskLogs, WebserverLogs, and WorkerLogs.
Defines that the logging module is enabled.
Defines the log level, which can be CRITICAL, ERROR, WARNING, or INFO.
A JSON blob that provides configuration to use for logging with respect to the various Apache Airflow services: DagProcessingLogs, SchedulerLogs, TaskLogs, WebserverLogs, and WorkerLogs.
Defines that the logging module is enabled.
Defines the log level, which can be CRITICAL, ERROR, WARNING, or INFO.
A JSON blob that provides configuration to use for logging with respect to the various Apache Airflow services: DagProcessingLogs, SchedulerLogs, TaskLogs, WebserverLogs, and WorkerLogs.
Defines that the logging module is enabled.
Defines the log level, which can be CRITICAL, ERROR, WARNING, or INFO.
A JSON blob that provides configuration to use for logging with respect to the various Apache Airflow services: DagProcessingLogs, SchedulerLogs, TaskLogs, WebserverLogs, and WorkerLogs.
Defines that the logging module is enabled.
Defines the log level, which can be CRITICAL, ERROR, WARNING, or INFO.
A JSON blob that provides configuration to use for logging with respect to the various Apache Airflow services: DagProcessingLogs, SchedulerLogs, TaskLogs, WebserverLogs, and WorkerLogs.
Defines that the logging module is enabled.
Defines the log level, which can be CRITICAL, ERROR, WARNING, or INFO.
[REQUIRED]
The name of your MWAA environment.
[REQUIRED]
The VPC networking components you want to use for your environment. At least two private subnet identifiers and one VPC security group identifier are required to create an environment. For more information, see Creating the VPC network for a MWAA environment .
A JSON list of 1 or more security groups IDs by name, in the same VPC as the subnets.
Provide a JSON list of 2 subnet IDs by name. These must be private subnets, in the same VPC, in two different availability zones.
[REQUIRED]
The Amazon Resource Name (ARN) of your Amazon S3 storage bucket. For example, arn:aws:s3:::airflow-mybucketname .
The metadata tags you want to attach to your environment. For more information, see Tagging AWS resources .
dict
Response Syntax
{
'Arn': 'string'
}
Response Structure
(dict) --
Arn (string) --
The resulting Amazon MWAA envirnonment ARN.
Exceptions
Create a JWT token to be used to login to Airflow Web UI with claims based Authentication.
See also: AWS API Documentation
Request Syntax
response = client.create_web_login_token(
Name='string'
)
[REQUIRED]
Create an Airflow Web UI login token request for a MWAA environment.
{
'WebServerHostname': 'string',
'WebToken': 'string'
}
Response Structure
Create an Airflow Web UI login token response for the provided webserver hostname.
Create an Airflow Web UI login token response for the provided JWT token.
Exceptions
Delete an existing environment.
See also: AWS API Documentation
Request Syntax
response = client.delete_environment(
Name='string'
)
[REQUIRED]
The name of the environment to delete.
{}
Response Structure
Exceptions
Generate a presigned url given a client, its method, and arguments
The presigned url
Get details of an existing environment.
See also: AWS API Documentation
Request Syntax
response = client.get_environment(
Name='string'
)
[REQUIRED]
The name of the environment to retrieve.
{
'Environment': {
'AirflowConfigurationOptions': {
'string': 'string'
},
'AirflowVersion': 'string',
'Arn': 'string',
'CreatedAt': datetime(2015, 1, 1),
'DagS3Path': 'string',
'EnvironmentClass': 'string',
'ExecutionRoleArn': 'string',
'KmsKey': 'string',
'LastUpdate': {
'CreatedAt': datetime(2015, 1, 1),
'Error': {
'ErrorCode': 'string',
'ErrorMessage': 'string'
},
'Status': 'SUCCESS'|'PENDING'|'FAILED'
},
'LoggingConfiguration': {
'DagProcessingLogs': {
'CloudWatchLogGroupArn': 'string',
'Enabled': True|False,
'LogLevel': 'CRITICAL'|'ERROR'|'WARNING'|'INFO'|'DEBUG'
},
'SchedulerLogs': {
'CloudWatchLogGroupArn': 'string',
'Enabled': True|False,
'LogLevel': 'CRITICAL'|'ERROR'|'WARNING'|'INFO'|'DEBUG'
},
'TaskLogs': {
'CloudWatchLogGroupArn': 'string',
'Enabled': True|False,
'LogLevel': 'CRITICAL'|'ERROR'|'WARNING'|'INFO'|'DEBUG'
},
'WebserverLogs': {
'CloudWatchLogGroupArn': 'string',
'Enabled': True|False,
'LogLevel': 'CRITICAL'|'ERROR'|'WARNING'|'INFO'|'DEBUG'
},
'WorkerLogs': {
'CloudWatchLogGroupArn': 'string',
'Enabled': True|False,
'LogLevel': 'CRITICAL'|'ERROR'|'WARNING'|'INFO'|'DEBUG'
}
},
'MaxWorkers': 123,
'Name': 'string',
'NetworkConfiguration': {
'SecurityGroupIds': [
'string',
],
'SubnetIds': [
'string',
]
},
'PluginsS3ObjectVersion': 'string',
'PluginsS3Path': 'string',
'RequirementsS3ObjectVersion': 'string',
'RequirementsS3Path': 'string',
'ServiceRoleArn': 'string',
'SourceBucketArn': 'string',
'Status': 'CREATING'|'CREATE_FAILED'|'AVAILABLE'|'UPDATING'|'DELETING'|'DELETED',
'Tags': {
'string': 'string'
},
'WebserverAccessMode': 'PRIVATE_ONLY'|'PUBLIC_ONLY',
'WebserverUrl': 'string',
'WeeklyMaintenanceWindowStart': 'string'
}
}
Response Structure
A JSON blob with environment details.
The Airflow Configuration Options of the Amazon MWAA Environment.
The AirflowV ersion of the Amazon MWAA Environment.
The ARN of the Amazon MWAA Environment.
The Created At date of the Amazon MWAA Environment.
The Dags S3 Path of the Amazon MWAA Environment.
The Environment Class (size) of the Amazon MWAA Environment.
The Execution Role ARN of the Amazon MWAA Environment.
The Kms Key of the Amazon MWAA Environment.
Last update information for the environment.
Time that last update occurred.
Error string of last update, if applicable.
Error code of update.
Error message of update.
Status of last update of SUCCESS, FAILED, CREATING, DELETING.
The Logging Configuration of the Amazon MWAA Environment.
A JSON blob that provides configuration to use for logging with respect to the various Apache Airflow services: DagProcessingLogs, SchedulerLogs, TaskLogs, WebserverLogs, and WorkerLogs.
Provides the ARN for the CloudWatch group where the logs will be published.
Defines that the logging module is enabled.
Defines the log level, which can be CRITICAL, ERROR, WARNING, or INFO.
A JSON blob that provides configuration to use for logging with respect to the various Apache Airflow services: DagProcessingLogs, SchedulerLogs, TaskLogs, WebserverLogs, and WorkerLogs.
Provides the ARN for the CloudWatch group where the logs will be published.
Defines that the logging module is enabled.
Defines the log level, which can be CRITICAL, ERROR, WARNING, or INFO.
A JSON blob that provides configuration to use for logging with respect to the various Apache Airflow services: DagProcessingLogs, SchedulerLogs, TaskLogs, WebserverLogs, and WorkerLogs.
Provides the ARN for the CloudWatch group where the logs will be published.
Defines that the logging module is enabled.
Defines the log level, which can be CRITICAL, ERROR, WARNING, or INFO.
A JSON blob that provides configuration to use for logging with respect to the various Apache Airflow services: DagProcessingLogs, SchedulerLogs, TaskLogs, WebserverLogs, and WorkerLogs.
Provides the ARN for the CloudWatch group where the logs will be published.
Defines that the logging module is enabled.
Defines the log level, which can be CRITICAL, ERROR, WARNING, or INFO.
A JSON blob that provides configuration to use for logging with respect to the various Apache Airflow services: DagProcessingLogs, SchedulerLogs, TaskLogs, WebserverLogs, and WorkerLogs.
Provides the ARN for the CloudWatch group where the logs will be published.
Defines that the logging module is enabled.
Defines the log level, which can be CRITICAL, ERROR, WARNING, or INFO.
The Maximum Workers of the Amazon MWAA Environment.
The name of the Amazon MWAA Environment.
Provide the security group and subnet IDs for the workers and scheduler.
A JSON list of 1 or more security groups IDs by name, in the same VPC as the subnets.
Provide a JSON list of 2 subnet IDs by name. These must be private subnets, in the same VPC, in two different availability zones.
The Plugins.zip S3 Object Version of the Amazon MWAA Environment.
The Plugins.zip S3 Path of the Amazon MWAA Environment.
The Requirements.txt file S3 Object Version of the Amazon MWAA Environment.
The Requirement.txt S3 Path of the Amazon MWAA Environment.
The Service Role ARN of the Amazon MWAA Environment.
The Source S3 Bucket ARN of the Amazon MWAA Environment.
The status of the Amazon MWAA Environment.
The Tags of the Amazon MWAA Environment.
The Webserver Access Mode of the Amazon MWAA Environment (public or private only).
The Webserver URL of the Amazon MWAA Environment.
The Weekly Maintenance Window Start of the Amazon MWAA Environment.
Exceptions
Create a paginator for an operation.
Returns an object that can wait for some condition.
List Amazon MWAA Environments.
See also: AWS API Documentation
Request Syntax
response = client.list_environments(
MaxResults=123,
NextToken='string'
)
dict
Response Syntax
{
'Environments': [
'string',
],
'NextToken': 'string'
}
Response Structure
(dict) --
Environments (list) --
The list of Amazon MWAA Environments.
NextToken (string) --
The Next Token when listing MWAA environments.
Exceptions
List the tags for MWAA environments.
See also: AWS API Documentation
Request Syntax
response = client.list_tags_for_resource(
ResourceArn='string'
)
[REQUIRED]
The ARN of the MWAA environment.
{
'Tags': {
'string': 'string'
}
}
Response Structure
The tags of the MWAA environments.
Exceptions
An operation for publishing metrics from the customers to the Ops plane.
See also: AWS API Documentation
Request Syntax
response = client.publish_metrics(
EnvironmentName='string',
MetricData=[
{
'Dimensions': [
{
'Name': 'string',
'Value': 'string'
},
],
'MetricName': 'string',
'StatisticValues': {
'Maximum': 123.0,
'Minimum': 123.0,
'SampleCount': 123,
'Sum': 123.0
},
'Timestamp': datetime(2015, 1, 1),
'Unit': 'Seconds'|'Microseconds'|'Milliseconds'|'Bytes'|'Kilobytes'|'Megabytes'|'Gigabytes'|'Terabytes'|'Bits'|'Kilobits'|'Megabits'|'Gigabits'|'Terabits'|'Percent'|'Count'|'Bytes/Second'|'Kilobytes/Second'|'Megabytes/Second'|'Gigabytes/Second'|'Terabytes/Second'|'Bits/Second'|'Kilobits/Second'|'Megabits/Second'|'Gigabits/Second'|'Terabits/Second'|'Count/Second'|'None',
'Value': 123.0
},
]
)
[REQUIRED]
Publishes environment metric data to Amazon CloudWatch.
[REQUIRED]
Publishes metric data points to Amazon CloudWatch. CloudWatch associates the data points with the specified metrica.
Internal only API.
Internal only API.
Internal only API.
Internal only API.
Internal only API.
Internal only API.
Internal only API.
Internal only API.
Internal only API.
Internal only API.
Internal only API.
Internal only API.
Unit
Internal only API.
dict
Response Syntax
{}
Response Structure
Exceptions
Add tag to the MWAA environments.
See also: AWS API Documentation
Request Syntax
response = client.tag_resource(
ResourceArn='string',
Tags={
'string': 'string'
}
)
[REQUIRED]
The tag resource ARN of the MWAA environments.
[REQUIRED]
The tag resource tag of the MWAA environments.
dict
Response Syntax
{}
Response Structure
Exceptions
Remove a tag from the MWAA environments.
See also: AWS API Documentation
Request Syntax
response = client.untag_resource(
ResourceArn='string',
tagKeys=[
'string',
]
)
[REQUIRED]
The tag resource ARN of the MWAA environments.
[REQUIRED]
The tag resource key of the MWAA environments.
dict
Response Syntax
{}
Response Structure
Exceptions
Update an MWAA environment.
See also: AWS API Documentation
Request Syntax
response = client.update_environment(
AirflowConfigurationOptions={
'string': 'string'
},
AirflowVersion='string',
DagS3Path='string',
EnvironmentClass='string',
ExecutionRoleArn='string',
LoggingConfiguration={
'DagProcessingLogs': {
'Enabled': True|False,
'LogLevel': 'CRITICAL'|'ERROR'|'WARNING'|'INFO'|'DEBUG'
},
'SchedulerLogs': {
'Enabled': True|False,
'LogLevel': 'CRITICAL'|'ERROR'|'WARNING'|'INFO'|'DEBUG'
},
'TaskLogs': {
'Enabled': True|False,
'LogLevel': 'CRITICAL'|'ERROR'|'WARNING'|'INFO'|'DEBUG'
},
'WebserverLogs': {
'Enabled': True|False,
'LogLevel': 'CRITICAL'|'ERROR'|'WARNING'|'INFO'|'DEBUG'
},
'WorkerLogs': {
'Enabled': True|False,
'LogLevel': 'CRITICAL'|'ERROR'|'WARNING'|'INFO'|'DEBUG'
}
},
MaxWorkers=123,
Name='string',
NetworkConfiguration={
'SecurityGroupIds': [
'string',
]
},
PluginsS3ObjectVersion='string',
PluginsS3Path='string',
RequirementsS3ObjectVersion='string',
RequirementsS3Path='string',
SourceBucketArn='string',
WebserverAccessMode='PRIVATE_ONLY'|'PUBLIC_ONLY',
WeeklyMaintenanceWindowStart='string'
)
The Airflow Configuration Options to update of your Amazon MWAA environment.
The Logging Configuration to update of your Amazon MWAA environment.
A JSON blob that provides configuration to use for logging with respect to the various Apache Airflow services: DagProcessingLogs, SchedulerLogs, TaskLogs, WebserverLogs, and WorkerLogs.
Defines that the logging module is enabled.
Defines the log level, which can be CRITICAL, ERROR, WARNING, or INFO.
A JSON blob that provides configuration to use for logging with respect to the various Apache Airflow services: DagProcessingLogs, SchedulerLogs, TaskLogs, WebserverLogs, and WorkerLogs.
Defines that the logging module is enabled.
Defines the log level, which can be CRITICAL, ERROR, WARNING, or INFO.
A JSON blob that provides configuration to use for logging with respect to the various Apache Airflow services: DagProcessingLogs, SchedulerLogs, TaskLogs, WebserverLogs, and WorkerLogs.
Defines that the logging module is enabled.
Defines the log level, which can be CRITICAL, ERROR, WARNING, or INFO.
A JSON blob that provides configuration to use for logging with respect to the various Apache Airflow services: DagProcessingLogs, SchedulerLogs, TaskLogs, WebserverLogs, and WorkerLogs.
Defines that the logging module is enabled.
Defines the log level, which can be CRITICAL, ERROR, WARNING, or INFO.
A JSON blob that provides configuration to use for logging with respect to the various Apache Airflow services: DagProcessingLogs, SchedulerLogs, TaskLogs, WebserverLogs, and WorkerLogs.
Defines that the logging module is enabled.
Defines the log level, which can be CRITICAL, ERROR, WARNING, or INFO.
[REQUIRED]
The name of your Amazon MWAA environment that you wish to update.
The Network Configuration to update of your Amazon MWAA environment.
Provide a JSON list of 1 or more security groups IDs by name, in the same VPC as the subnets.
dict
Response Syntax
{
'Arn': 'string'
}
Response Structure
(dict) --
Arn (string) --
The ARN to update of your Amazon MWAA environment.
Exceptions
The available paginators are:
paginator = client.get_paginator('list_environments')
Creates an iterator that will paginate through responses from MWAA.Client.list_environments().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
{
'Environments': [
'string',
],
}
Response Structure
The list of Amazon MWAA Environments.