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: Save the task to be executed in the next sync by inserting the commands into a queue.
docstr_tok: ["Save","the","task","to","be","executed","in","the","next","sync","by","inserting","the","commands","into","a","queue","."]
code: def execute_async(
      self,
      key: TaskInstanceKey,
      command: CommandType,
      queue=None,
      executor_config=None,
  ):
      """Save the task to be executed in the next sync by inserting the commands into a queue."""
      if executor_config and (
          "name" in executor_config or "command" in executor_config
      ):
          raise ValueError(
              'Executor Config should never override "name" or "command"'
          )
      self.pending_tasks.append(
          EcsQueuedTask(key, command, queue, executor_config or {}, 1)
      )
  
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 14 for calling the AwsEcsExecutor obj's underlying member method code with example usage: obj.execute_async(key, command, queue, executor_config) without return types