airflow.providers.amazon.aws.triggers.rds
¶
Module Contents¶
Classes¶
Trigger for RdsCreateDbInstanceOperator and RdsDeleteDbInstanceOperator. |
- class airflow.providers.amazon.aws.triggers.rds.RdsDbInstanceTrigger(waiter_name, db_instance_identifier, waiter_delay, waiter_max_attempts, aws_conn_id, region_name, response)[source]¶
Bases:
airflow.triggers.base.BaseTrigger
Trigger for RdsCreateDbInstanceOperator and RdsDeleteDbInstanceOperator.
The trigger will asynchronously poll the boto3 API and wait for the DB instance to be in the state specified by the waiter.
- Parameters
waiter_name (str) – Name of the waiter to use, for instance ‘db_instance_available’ or ‘db_instance_deleted’.
db_instance_identifier (str) – The DB instance identifier for the DB instance to be polled.
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) – The Airflow connection used for AWS credentials.
hook_params – The parameters to pass to the RdsHook.
response (dict[str, Any]) – The response from the RdsHook, to be passed back to the operator.
- async run()[source]¶
Runs the trigger in an asynchronous context.
The trigger should yield an Event whenever it wants to fire off an event, and return None if it is finished. Single-event triggers should thus yield and then immediately return.
If it yields, it is likely that it will be resumed very quickly, but it may not be (e.g. if the workload is being moved to another triggerer process, or a multi-event trigger was being used for a single-event task defer).
In either case, Trigger classes should assume they will be persisted, and then rely on cleanup() being called when they are no longer needed.