airflow.providers.amazon.aws.sensors.ecs

Module Contents

Classes

EcsBaseSensor

Contains general sensor behavior for Elastic Container Service.

EcsClusterStateSensor

Polls the cluster state until it reaches a terminal state. Raises an

EcsTaskDefinitionStateSensor

Polls the task definition state until it reaches a terminal state. Raises an

EcsTaskStateSensor

Polls the task state until it reaches a terminal state. Raises an

Attributes

DEFAULT_CONN_ID

airflow.providers.amazon.aws.sensors.ecs.DEFAULT_CONN_ID: str = 'aws_default'[source]
class airflow.providers.amazon.aws.sensors.ecs.EcsBaseSensor(*, aws_conn_id=DEFAULT_CONN_ID, region=None, **kwargs)[source]

Bases: airflow.sensors.base.BaseSensorOperator

Contains general sensor behavior for Elastic Container Service.

hook()[source]

Create and return an EcsHook.

client()[source]

Create and return an EcsHook client.

class airflow.providers.amazon.aws.sensors.ecs.EcsClusterStateSensor(*, cluster_name, target_state=EcsClusterStates.ACTIVE, failure_states=None, **kwargs)[source]

Bases: EcsBaseSensor

Polls the cluster state until it reaches a terminal state. Raises an AirflowException with the failure reason if a failed state is reached.

See also

For more information on how to use this operator, take a look at the guide: AWS ECS Cluster State Sensor

Parameters
  • cluster_name (str) – The name of your cluster.

  • target_state (EcsClusterStates | None) – Success state to watch for. (Default: “ACTIVE”)

  • failure_states (set[EcsClusterStates] | None) – Fail if any of these states are reached before the Success State. (Default: “FAILED” or “INACTIVE”)

template_fields: Sequence[str] = ('cluster_name', 'target_state', 'failure_states')[source]
poke(context)[source]

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

class airflow.providers.amazon.aws.sensors.ecs.EcsTaskDefinitionStateSensor(*, task_definition, target_state=EcsTaskDefinitionStates.ACTIVE, **kwargs)[source]

Bases: EcsBaseSensor

Polls the task definition state until it reaches a terminal state. Raises an AirflowException with the failure reason if a failed state is reached.

See also

For more information on how to use this operator, take a look at the guide: AWS ECS Task Definition State Sensor

Parameters
  • task_definition (str) – The family for the latest ACTIVE revision, family and revision (family:revision ) for a specific revision in the family, or full Amazon Resource Name (ARN) of the task definition.

  • target_state (EcsTaskDefinitionStates | None) – Success state to watch for. (Default: “ACTIVE”)

template_fields: Sequence[str] = ('task_definition', 'target_state', 'failure_states')[source]
poke(context)[source]

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

class airflow.providers.amazon.aws.sensors.ecs.EcsTaskStateSensor(*, cluster, task, target_state=EcsTaskStates.RUNNING, failure_states=None, **kwargs)[source]

Bases: EcsBaseSensor

Polls the task state until it reaches a terminal state. Raises an AirflowException with the failure reason if a failed state is reached.

See also

For more information on how to use this operator, take a look at the guide: AWS ECS Task State Sensor

Parameters
  • cluster (str) – The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task.

  • task (str) – The task ID or full ARN of the task to poll.

  • target_state (EcsTaskStates | None) – Success state to watch for. (Default: “ACTIVE”)

  • failure_states (set[EcsTaskStates] | None) – Fail if any of these states are reached before the Success State. (Default: “STOPPED”)

template_fields: Sequence[str] = ('cluster', 'task', 'target_state', 'failure_states')[source]
poke(context)[source]

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

Was this entry helpful?