class_docstr: Executes the provided Airflow command on an ECS instance.
  
  The Airflow Scheduler creates a shell command, and passes it to the executor. This ECS Executor
  runs said Airflow command on a remote Amazon ECS Cluster with a task-definition configured to
  launch the same containers as the Scheduler. It then periodically checks in with the launched
  tasks (via task ARNs) to determine the status.
  
  This allows individual tasks to specify CPU, memory, GPU, env variables, etc. When initializing a task,
  there's an option for "executor config" which should be a dictionary with keys that match the
  ``ContainerOverride`` definition per AWS documentation (see link below).
  
  Prerequisite: proper configuration of Boto3 library
  .. seealso:: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html for
  authentication and access-key management. You can store an environmental variable, setup aws config from
  console, or use IAM roles.
  
  .. seealso:: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ContainerOverride.html for an
   Airflow TaskInstance's executor_config.
class_docstr_tok: ["Executes","the","provided","Airflow","command","on","an","ECS","instance",".","The","Airflow","Scheduler","creates","a","shell","command",",","and","passes","it","to","the","executor",".","This","ECS","Executor","runs","said","Airflow","command","on","a","remote","Amazon","ECS","Cluster","with","a","task-definition","configured","to","launch","the","same","containers","as","the","Scheduler",".","It","then","periodically","checks","in","with","the","launched","tasks","(","via","task","ARNs",")","to","determine","the","status",".","This","allows","individual","tasks","to","specify","CPU",",","memory",",","GPU",",","env","variables",",","etc",".","When","initializing","a","task",",","there","'s","an","option","for","``","executor","config","''","which","should","be","a","dictionary","with","keys","that","match","the","``","ContainerOverride","``","definition","per","AWS","documentation","(","see","link","below",")",".","Prerequisite",":","proper","configuration","of","Boto3","library","..","seealso",":",":","https",":","\/\/boto3.amazonaws.com\/v1\/documentation\/api\/latest\/guide\/configuration.html","for","authentication","and","access-key","management",".","You","can","store","an","environmental","variable",",","setup","aws","config","from","console",",","or","use","IAM","roles",".","..","seealso",":",":","https",":","\/\/docs.aws.amazon.com\/AmazonECS\/latest\/APIReference\/API_ContainerOverride.html","for","an","Airflow","TaskInstance","'s","executor_config","."]
docstr: Run a queued-up Airflow task.
  
  Not to be confused with execute_async() which inserts tasks into the queue.
  The command and executor config will be placed in the container-override
  section of the JSON request before calling Boto3's "run_task" function.
docstr_tok: ["Run","a","queued-up","Airflow","task",".","Not","to","be","confused","with","execute_async","(",")","which","inserts","tasks","into","the","queue",".","The","command","and","executor","config","will","be","placed","in","the","container-override","section","of","the","JSON","request","before","calling","Boto3","'s","``","run_task","''","function","."]
code: def _run_task(
      self,
      task_id: TaskInstanceKey,
      cmd: CommandType,
      queue: str,
      exec_config: ExecutorConfigType,
  ):
      """
      Run a queued-up Airflow task.
  
      Not to be confused with execute_async() which inserts tasks into the queue.
      The command and executor config will be placed in the container-override
      section of the JSON request before calling Boto3's "run_task" function.
      """
      run_task_api = self._run_task_kwargs(
          task_id, cmd, queue, exec_config
      )
      boto_run_task = self.ecs.run_task(**run_task_api)
      run_task_response = BotoRunTaskSchema().load(boto_run_task)
      return run_task_response
  
imports: from __future__ import annotations
  import time
  from collections import defaultdict, deque
  from copy import deepcopy
  from typing import TYPE_CHECKING
  from botocore.exceptions import ClientError, NoCredentialsError
  from airflow.configuration import conf
  from airflow.exceptions import AirflowException
  from airflow.executors.base_executor import BaseExecutor
  from airflow.providers.amazon.aws.executors.ecs.boto_schema import BotoDescribeTasksSchema, BotoRunTaskSchema
  from airflow.providers.amazon.aws.executors.ecs.utils import CONFIG_DEFAULTS, CONFIG_GROUP_NAME, AllEcsConfigKeys, EcsExecutorException, EcsQueuedTask, EcsTaskCollection
  from airflow.providers.amazon.aws.executors.utils.exponential_backoff_retry import exponential_backoff_retry
  from airflow.providers.amazon.aws.hooks.ecs import EcsHook
  from airflow.utils import timezone
  from airflow.utils.state import State
label_desc: Use image node_id 12 for calling the AwsEcsExecutor obj's underlying member method code with example usage: obj._run_task(task_id, cmd, queue, exec_config) and returns: run_task_response