airflow.providers.amazon.aws.triggers.emr¶
Classes¶
Poll for the status of EMR steps until they reach terminal state. |
|
Asynchronously poll the boto3 API and wait for the JobFlow to finish executing. |
|
Asynchronously poll the boto3 API and wait for the JobFlow to finish terminating. |
|
Poll for the status of EMR container until reaches terminal state. |
|
Poll for the status of EMR container until reaches terminal state. |
|
Poll an Emr Serverless application and wait for it to be created. |
|
Poll an Emr Serverless application and wait for it to be started. |
|
Poll an Emr Serverless application and wait for it to be stopped. |
|
Poll an EMR Serverless job run until it reaches a target or failure state. |
|
Poll an Emr Serverless job run and wait for it to be completed. |
|
Poll an Emr Serverless application and wait for it to be deleted. |
|
Trigger for canceling a list of jobs in an EMR Serverless application. |
Module Contents¶
- class airflow.providers.amazon.aws.triggers.emr.EmrAddStepsTrigger(job_flow_id, step_ids, waiter_delay, waiter_max_attempts, aws_conn_id='aws_default', region_name=None, verify=None, botocore_config=None)[source]¶
Bases:
airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTriggerPoll for the status of EMR steps until they reach terminal state.
- Parameters:
job_flow_id (str) – job_flow_id which contains the steps to check the state of
waiter_delay (int) – polling period in seconds to check for the status
waiter_max_attempts (int) – The maximum number of attempts to be made
aws_conn_id (str | None) – Reference to AWS connection id
region_name (str | None) – The AWS region where the resources to watch are.
verify (bool | str | None) – Whether or not to verify SSL certificates. See: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config (dict | None) – Configuration dictionary (key-values) for botocore client. See: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- class airflow.providers.amazon.aws.triggers.emr.EmrCreateJobFlowTrigger(job_flow_id, aws_conn_id=None, waiter_delay=30, waiter_max_attempts=60, waiter_name='job_flow_waiting', region_name=None, verify=None, botocore_config=None)[source]¶
Bases:
airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTriggerAsynchronously poll the boto3 API and wait for the JobFlow to finish executing.
- Parameters:
job_flow_id (str) – The id of the job flow to wait for.
waiter_delay (int) – The amount of time in seconds to wait between attempts.
waiter_max_attempts (int) – The maximum number of attempts to be made.
aws_conn_id (str | None) – The Airflow connection used for AWS credentials.
region_name (str | None) – The AWS region where the resources to watch are.
verify (bool | str | None) – Whether or not to verify SSL certificates. See: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config (dict | None) – Configuration dictionary (key-values) for botocore client. See: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- class airflow.providers.amazon.aws.triggers.emr.EmrTerminateJobFlowTrigger(job_flow_id, aws_conn_id=None, waiter_delay=30, waiter_max_attempts=60, region_name=None, verify=None, botocore_config=None)[source]¶
Bases:
airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTriggerAsynchronously poll the boto3 API and wait for the JobFlow to finish terminating.
- Parameters:
job_flow_id (str) – ID of the EMR Job Flow to terminate
waiter_delay (int) – The amount of time in seconds to wait between attempts.
waiter_max_attempts (int) – The maximum number of attempts to be made.
aws_conn_id (str | None) – The Airflow connection used for AWS credentials.
region_name (str | None) – The AWS region where the resources to watch are.
verify (bool | str | None) – Whether or not to verify SSL certificates. See: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config (dict | None) – Configuration dictionary (key-values) for botocore client. See: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- class airflow.providers.amazon.aws.triggers.emr.EmrContainerTrigger(virtual_cluster_id, job_id, aws_conn_id='aws_default', waiter_delay=30, waiter_max_attempts=sys.maxsize, cancel_on_kill=True, region_name=None, verify=None, botocore_config=None)[source]¶
Bases:
airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTriggerPoll for the status of EMR container until reaches terminal state.
- Parameters:
virtual_cluster_id (str) – Reference Emr cluster id
job_id (str) – job_id to check the state
aws_conn_id (str | None) – Reference to AWS connection id
waiter_delay (int) – polling period in seconds to check for the status
waiter_max_attempts (int) – The maximum number of attempts to be made. Defaults to an infinite wait.
cancel_on_kill (bool) – If True (default), cancel the EMR container job when the user marks the deferred task failed, clears it, or mark-succeeds it. Requires
apache-airflowwithBaseTrigger.on_kill()support; on older versions the hook is silently inert.region_name (str | None) – The AWS region where the resources to watch are.
verify (bool | str | None) – Whether or not to verify SSL certificates. See: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config (dict | None) – Configuration dictionary (key-values) for botocore client. See: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- class airflow.providers.amazon.aws.triggers.emr.EmrStepSensorTrigger(job_flow_id, step_id, waiter_delay=30, waiter_max_attempts=60, aws_conn_id='aws_default', region_name=None, verify=None, botocore_config=None)[source]¶
Bases:
airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTriggerPoll for the status of EMR container until reaches terminal state.
- Parameters:
job_flow_id (str) – job_flow_id which contains the step check the state of
step_id (str) – step to check the state of
waiter_delay (int) – polling period in seconds to check for the status
waiter_max_attempts (int) – The maximum number of attempts to be made
aws_conn_id (str | None) – Reference to AWS connection id
region_name (str | None) – The AWS region where the resources to watch are.
verify (bool | str | None) – Whether or not to verify SSL certificates. See: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config (dict | None) – Configuration dictionary (key-values) for botocore client. See: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- class airflow.providers.amazon.aws.triggers.emr.EmrServerlessCreateApplicationTrigger(application_id, waiter_delay=30, waiter_max_attempts=60, aws_conn_id='aws_default', region_name=None, verify=None, botocore_config=None)[source]¶
Bases:
airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTriggerPoll an Emr Serverless application and wait for it to be created.
- Parameters:
application_id (str) – The ID of the application being polled.
waiter_max_attempts (int) – The maximum number of attempts to be made
aws_conn_id (str | None) – Reference to AWS connection id
region_name (str | None) – The AWS region where the resources to watch are.
verify (bool | str | None) – Whether or not to verify SSL certificates. See: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config (dict | None) – Configuration dictionary (key-values) for botocore client. See: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- Waiter_delay:
polling period in seconds to check for the status
- class airflow.providers.amazon.aws.triggers.emr.EmrServerlessStartApplicationTrigger(application_id, waiter_delay=30, waiter_max_attempts=60, aws_conn_id='aws_default', region_name=None, verify=None, botocore_config=None)[source]¶
Bases:
airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTriggerPoll an Emr Serverless application and wait for it to be started.
- Parameters:
application_id (str) – The ID of the application being polled.
waiter_max_attempts (int) – The maximum number of attempts to be made
aws_conn_id (str | None) – Reference to AWS connection id
region_name (str | None) – The AWS region where the resources to watch are.
verify (bool | str | None) – Whether or not to verify SSL certificates. See: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config (dict | None) – Configuration dictionary (key-values) for botocore client. See: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- Waiter_delay:
polling period in seconds to check for the status
- class airflow.providers.amazon.aws.triggers.emr.EmrServerlessStopApplicationTrigger(application_id, waiter_delay=30, waiter_max_attempts=60, aws_conn_id='aws_default', region_name=None, verify=None, botocore_config=None)[source]¶
Bases:
airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTriggerPoll an Emr Serverless application and wait for it to be stopped.
- Parameters:
application_id (str) – The ID of the application being polled.
waiter_max_attempts (int) – The maximum number of attempts to be made
aws_conn_id (str | None) – Reference to AWS connection id.
region_name (str | None) – The AWS region where the resources to watch are.
verify (bool | str | None) – Whether or not to verify SSL certificates. See: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config (dict | None) – Configuration dictionary (key-values) for botocore client. See: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- Waiter_delay:
polling period in seconds to check for the status
- class airflow.providers.amazon.aws.triggers.emr.EmrServerlessJobSensorTrigger(application_id, job_run_id, target_states, waiter_delay=60, waiter_max_attempts=sys.maxsize, aws_conn_id='aws_default', region_name=None, verify=None, botocore_config=None)[source]¶
Bases:
airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTriggerPoll an EMR Serverless job run until it reaches a target or failure state.
- Parameters:
application_id (str) – The ID of the application the job is running on.
job_run_id (str) – The ID of the job run.
target_states (set[str] | frozenset[str]) – The states that indicate the sensor has succeeded.
waiter_delay (int) – The time in seconds to wait between polling attempts.
waiter_max_attempts (int) – The maximum number of attempts to be made. Defaults to an infinite wait.
aws_conn_id (str | None) – Reference to the AWS connection ID.
region_name (str | None) – The AWS region where the job is running.
verify (bool | str | None) – Whether to verify SSL certificates.
botocore_config (dict | None) – Configuration dictionary for the botocore client.
- class airflow.providers.amazon.aws.triggers.emr.EmrServerlessStartJobTrigger(application_id, job_id, waiter_delay=30, waiter_max_attempts=60, aws_conn_id='aws_default', cancel_on_kill=True, region_name=None, verify=None, botocore_config=None)[source]¶
Bases:
airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTriggerPoll an Emr Serverless job run and wait for it to be completed.
- Parameters:
application_id (str) – The ID of the application the job in being run on.
job_id (str | None) – The ID of the job run.
waiter_delay (int) – polling period in seconds to check for the status
waiter_max_attempts (int) – The maximum number of attempts to be made
aws_conn_id (str | None) – Reference to AWS connection id
cancel_on_kill (bool) – Flag to indicate whether to cancel the job when the task is killed.
region_name (str | None) – The AWS region where the resources to watch are.
verify (bool | str | None) – Whether or not to verify SSL certificates. See: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config (dict | None) – Configuration dictionary (key-values) for botocore client. See: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- get_task_instance(*, session)[source]¶
Get the task instance for the current trigger (Airflow 2.x compatibility).
- async safe_to_cancel()[source]¶
Whether it is safe to cancel the EMR Serverless job.
Returns True if task is NOT DEFERRED (user-initiated cancellation). Returns False if task is DEFERRED (triggerer restart - don’t cancel job).
- class airflow.providers.amazon.aws.triggers.emr.EmrServerlessDeleteApplicationTrigger(application_id, waiter_delay=30, waiter_max_attempts=60, aws_conn_id='aws_default', region_name=None, verify=None, botocore_config=None)[source]¶
Bases:
airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTriggerPoll an Emr Serverless application and wait for it to be deleted.
- Parameters:
application_id (str) – The ID of the application being polled.
waiter_max_attempts (int) – The maximum number of attempts to be made
aws_conn_id (str | None) – Reference to AWS connection id
region_name (str | None) – The AWS region where the resources to watch are.
verify (bool | str | None) – Whether or not to verify SSL certificates. See: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config (dict | None) – Configuration dictionary (key-values) for botocore client. See: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- Waiter_delay:
polling period in seconds to check for the status
- class airflow.providers.amazon.aws.triggers.emr.EmrServerlessCancelJobsTrigger(application_id, aws_conn_id, waiter_delay, waiter_max_attempts, region_name=None, verify=None, botocore_config=None)[source]¶
Bases:
airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTriggerTrigger for canceling a list of jobs in an EMR Serverless application.
- Parameters:
application_id (str) – EMR Serverless application ID
aws_conn_id (str | None) – Reference to AWS connection id
waiter_delay (int) – Delay in seconds between each attempt to check the status
waiter_max_attempts (int) – Maximum number of attempts to check the status
region_name (str | None) – The AWS region where the resources to watch are.
verify (bool | str | None) – Whether or not to verify SSL certificates. See: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config (dict | None) – Configuration dictionary (key-values) for botocore client. See: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- property hook_instance: airflow.providers.amazon.aws.hooks.base_aws.AwsGenericHook[source]¶
This property is added for backward compatibility.