airflow.providers.amazon.aws.hooks.mwaa¶
This module contains AWS MWAA hook.
Classes¶
Interact with AWS Manager Workflows for Apache Airflow. |
Module Contents¶
- class airflow.providers.amazon.aws.hooks.mwaa.MwaaHook(*args, **kwargs)[source]¶
Bases:
airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook
Interact with AWS Manager Workflows for Apache Airflow.
Provide thin wrapper around
boto3.client("mwaa")
If your IAM policy doesn’t have airflow:InvokeRestApi permission, the hook will use a fallback method that uses the AWS credential to generate a local web login token for the Airflow Web UI and then directly make requests to the Airflow API. This fallback method can be set as the default (and only) method used by setting generate_local_token to True. Learn more here: https://docs.aws.amazon.com/mwaa/latest/userguide/access-mwaa-apache-airflow-rest-api.html#granting-access-MWAA-Enhanced-REST-API
Additional arguments (such as
aws_conn_id
) may be specified and are passed down to the underlying AwsBaseHook.- invoke_rest_api(env_name, path, method, body=None, query_params=None, generate_local_token=False)[source]¶
Invoke the REST API on the Airflow webserver with the specified inputs.
See also
- Parameters:
env_name (str) – name of the MWAA environment
path (str) – Apache Airflow REST API endpoint path to be called
method (str) – HTTP method used for making Airflow REST API calls: ‘GET’|’PUT’|’POST’|’PATCH’|’DELETE’
body (dict | None) – Request body for the Apache Airflow REST API call
query_params (dict | None) – Query parameters to be included in the Apache Airflow REST API call
generate_local_token (bool) – If True, only the local web token method is used without trying boto’s invoke_rest_api first. If False, the local web token method is used as a fallback after trying boto’s invoke_rest_api