class_docstr: Poll the task state until it reaches a terminal state; raises AirflowException with the failure reason.
  
  .. seealso::
      For more information on how to use this operator, take a look at the guide:
      :ref:`howto/sensor:EcsTaskStateSensor`
  
  :param cluster: The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task.
  :param task: The task ID or full ARN of the task to poll.
  :param target_state: Success state to watch for. (Default: "ACTIVE")
  :param failure_states: Fail if any of these states are reached before
       the Success State. (Default: "STOPPED")
code: def __init__(
      self,
      *,
      cluster: str,
      task: str,
      target_state: EcsTaskStates | None = EcsTaskStates.RUNNING,
      failure_states: set[EcsTaskStates] | None = None,
      **kwargs,
  ):
      super().__init__(**kwargs)
      self.cluster = cluster
      self.task = task
      self.target_state = target_state
      self.failure_states = failure_states or {EcsTaskStates.STOPPED}
  
imports: from __future__ import annotations
  from functools import cached_property
  from typing import TYPE_CHECKING, Sequence
  from airflow.exceptions import AirflowException, AirflowSkipException
  from airflow.providers.amazon.aws.hooks.ecs import EcsClusterStates, EcsHook, EcsTaskDefinitionStates, EcsTaskStates
  from airflow.providers.amazon.aws.sensors.base_aws import AwsBaseSensor
  from airflow.providers.amazon.aws.utils.mixins import aws_template_fields
label_desc: Use image node_id 1 to create a new EcsTaskStateSensor object from inherited base classes: EcsBaseSensor with example: obj = EcsTaskStateSensor()