Airflow Summit 2025 is coming October 07-09. Register now for early bird ticket!

airflow.providers.amazon.aws.operators.ssm

Classes

SsmRunCommandOperator

Executes the SSM Run Command to perform actions on managed instances.

Module Contents

class airflow.providers.amazon.aws.operators.ssm.SsmRunCommandOperator(*, document_name, run_command_kwargs=None, wait_for_completion=True, waiter_delay=120, waiter_max_attempts=75, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), **kwargs)[source]

Bases: airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.ssm.SsmHook]

Executes the SSM Run Command to perform actions on managed instances.

See also

For more information on how to use this operator, take a look at the guide: Runs commands on one or more managed nodes

Parameters:
  • document_name (str) – The name of the Amazon Web Services Systems Manager document (SSM document) to run.

  • run_command_kwargs (dict[str, Any] | None) – Optional parameters to pass to the send_command API.

  • wait_for_completion (bool) – Whether to wait for cluster to stop. (default: True)

  • waiter_delay (int) – Time in seconds to wait between status checks. (default: 120)

  • waiter_max_attempts (int) – Maximum number of attempts to check for job completion. (default: 75)

  • deferrable (bool) – If True, the operator will wait asynchronously for the cluster to stop. This implies waiting for completion. This mode requires aiobotocore module to be installed. (default: False)

  • aws_conn_id – The Airflow connection used for AWS credentials. If this is None or empty then the default boto3 behaviour is used. If running Airflow in a distributed manner and aws_conn_id is None or empty, then default boto3 configuration would be used (and must be maintained on each worker node).

  • region_name – AWS region_name. If not specified then the default boto3 behaviour is used.

  • verify – Whether or not to verify SSL certificates. See: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html

  • botocore_config – Configuration dictionary (key-values) for botocore client. See: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html

aws_hook_class[source]
template_fields: collections.abc.Sequence[str][source]
wait_for_completion = True[source]
waiter_delay = 120[source]
waiter_max_attempts = 75[source]
deferrable = True[source]
document_name[source]
run_command_kwargs[source]
execute_complete(context, event=None)[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

Was this entry helpful?