class_docstr: Creates an AWS ECS cluster.
  
  .. seealso::
      For more information on how to use this operator, take a look at the guide:
      :ref:`howto/operator:EcsCreateClusterOperator`
  
  :param cluster_name: The name of your cluster. If you don't specify a name for your
      cluster, you create a cluster that's named default.
  :param create_cluster_kwargs: Extra arguments for Cluster Creation.
  :param wait_for_completion: If True, waits for creation of the cluster to complete. (default: True)
  :param waiter_delay: The amount of time in seconds to wait between attempts,
      if not set then the default waiter value will be used.
  :param waiter_max_attempts: The maximum number of attempts to be made,
      if not set then the default waiter value will be used.
  :param deferrable: If True, the operator will wait asynchronously for the job to complete.
      This implies waiting for completion. This mode requires aiobotocore module to be installed.
      (default: False)
class_docstr_tok: ["Creates","an","AWS","ECS","cluster",".","..","seealso",":",":","For","more","information","on","how","to","use","this","operator",",","take","a","look","at","the","guide",":",":","ref",":","`","howto\/operator",":","EcsCreateClusterOperator","`",":","param","cluster_name",":","The","name","of","your","cluster",".","If","you","do","n't","specify","a","name","for","your","cluster",",","you","create","a","cluster","that","'s","named","default",".",":","param","create_cluster_kwargs",":","Extra","arguments","for","Cluster","Creation",".",":","param","wait_for_completion",":","If","True",",","waits","for","creation","of","the","cluster","to","complete",".","(","default",":","True",")",":","param","waiter_delay",":","The","amount","of","time","in","seconds","to","wait","between","attempts",",","if","not","set","then","the","default","waiter","value","will","be","used",".",":","param","waiter_max_attempts",":","The","maximum","number","of","attempts","to","be","made",",","if","not","set","then","the","default","waiter","value","will","be","used",".",":","param","deferrable",":","If","True",",","the","operator","will","wait","asynchronously","for","the","job","to","complete",".","This","implies","waiting","for","completion",".","This","mode","requires","aiobotocore","module","to","be","installed",".","(","default",":","False",")"]
code: def execute(self, context: Context):
      self.log.info(
          "Creating cluster %r using the following values: %s",
          self.cluster_name,
          self.create_cluster_kwargs,
      )
      result = self.client.create_cluster(
          clusterName=self.cluster_name, **self.create_cluster_kwargs
      )
      cluster_details = result["cluster"]
      cluster_state = cluster_details.get("status")
  
      if cluster_state == EcsClusterStates.ACTIVE:
          # In some circumstances the ECS Cluster is created immediately,
          # and there is no reason to wait for completion.
          self.log.info(
              "Cluster %r in state: %r.",
              self.cluster_name,
              cluster_state,
          )
      elif self.deferrable:
          self.defer(
              trigger=ClusterActiveTrigger(
                  cluster_arn=cluster_details["clusterArn"],
                  waiter_delay=self.waiter_delay,
                  waiter_max_attempts=self.waiter_max_attempts,
                  aws_conn_id=self.aws_conn_id,
                  region_name=self.region,
              ),
              method_name="_complete_exec_with_cluster_desc",
              # timeout is set to ensure that if a trigger dies, the timeout does not restart
              # 60 seconds is added to allow the trigger to exit gracefully (i.e. yield TriggerEvent)
              timeout=timedelta(
                  seconds=self.waiter_max_attempts * self.waiter_delay
                  + 60
              ),
          )
      elif self.wait_for_completion:
          waiter = self.hook.get_waiter("cluster_active")
          waiter.wait(
              clusters=[cluster_details["clusterArn"]],
              WaiterConfig=prune_dict(
                  {
                      "Delay": self.waiter_delay,
                      "MaxAttempts": self.waiter_max_attempts,
                  }
              ),
          )
  
      return cluster_details
  
imports: from __future__ import annotations
  import re
  import warnings
  from datetime import timedelta
  from functools import cached_property
  from typing import TYPE_CHECKING, Sequence
  from airflow.configuration import conf
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.providers.amazon.aws.exceptions import EcsOperatorError, EcsTaskFailToStart
  from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
  from airflow.providers.amazon.aws.hooks.ecs import EcsClusterStates, EcsHook, should_retry_eni
  from airflow.providers.amazon.aws.hooks.logs import AwsLogsHook
  from airflow.providers.amazon.aws.operators.base_aws import AwsBaseOperator
  from airflow.providers.amazon.aws.triggers.ecs import ClusterActiveTrigger, ClusterInactiveTrigger, TaskDoneTrigger
  from airflow.providers.amazon.aws.utils.identifiers import generate_uuid
  from airflow.providers.amazon.aws.utils.mixins import aws_template_fields
  from airflow.providers.amazon.aws.utils.task_log_fetcher import AwsTaskLogFetcher
  from airflow.utils.helpers import prune_dict
label_desc: Use image node_id 2 for calling the EcsCreateClusterOperator obj's underlying member method code with example usage: obj.execute(context) and returns: cluster_details