airflow.providers.amazon.aws.sensors.ec2

Module Contents

Classes

EC2InstanceStateSensor

Check the state of the AWS EC2 instance until

class airflow.providers.amazon.aws.sensors.ec2.EC2InstanceStateSensor(*, target_state, instance_id, aws_conn_id='aws_default', region_name=None, deferrable=False, **kwargs)[source]

Bases: airflow.sensors.base.BaseSensorOperator

Check the state of the AWS EC2 instance until state of the instance become equal to the target state.

See also

For more information on how to use this sensor, take a look at the guide: Wait on an Amazon EC2 instance state

Parameters
  • target_state (str) – target state of instance

  • instance_id (str) – id of the AWS EC2 instance

  • region_name (str | None) – (optional) aws region name associated with the client

  • deferrable (bool) – if True, the sensor will run in deferrable mode

template_fields: Sequence[str] = ('target_state', 'instance_id', 'region_name')[source]
ui_color = '#cc8811'[source]
ui_fgcolor = '#ffffff'[source]
valid_states = ['running', 'stopped', 'terminated'][source]
execute(context)[source]

This is the main method to derive when creating an operator. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

hook()[source]
poke(context)[source]

Function defined by the sensors while deriving this class should override.

execute_complete(context, event=None)[source]

Was this entry helpful?