airflow.providers.amazon.aws.triggers.ssm

Classes

SsmRunCommandTrigger

Trigger when a SSM run command is complete.

Module Contents

class airflow.providers.amazon.aws.triggers.ssm.SsmRunCommandTrigger(*, command_id, waiter_delay=120, waiter_max_attempts=75, fail_on_nonzero_exit=True, aws_conn_id=None, region_name=None, verify=None, botocore_config=None)[source]

Bases: airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTrigger

Trigger when a SSM run command is complete.

Parameters:
  • command_id (str) – The ID of the AWS SSM Run Command.

  • waiter_delay (int) – The amount of time in seconds to wait between attempts. (default: 120)

  • waiter_max_attempts (int) – The maximum number of attempts to be made. (default: 75)

  • fail_on_nonzero_exit (bool) – If True (default), the trigger will fail when the command returns a non-zero exit code. If False, the trigger will complete successfully regardless of the command exit code. (default: True)

  • aws_conn_id (str | None) – The Airflow connection used for AWS credentials.

  • region_name (str | None) – AWS region_name. If not specified then the default boto3 behaviour is used.

  • 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

command_id[source]
fail_on_nonzero_exit = True[source]
hook()[source]

Override in subclasses to return the right hook.

async run()[source]

Run 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.

Was this entry helpful?