class_docstr: Interact with Amazon Elastic Compute Cloud (EC2).
  
  Provide thick wrapper around :external+boto3:py:class:`boto3.client("ec2") <EC2.Client>`
  or :external+boto3:py:class:`boto3.resource("ec2") <EC2.ServiceResource>`.
  
  :param api_type: If set to ``client_type`` then hook use ``boto3.client("ec2")`` capabilities,
      If set to ``resource_type`` then hook use ``boto3.resource("ec2")`` capabilities.
  
  Additional arguments (such as ``aws_conn_id``) may be specified and
  are passed down to the underlying AwsBaseHook.
  
  .. seealso::
      - :class:`airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook`
class_docstr_tok: ["Interact","with","Amazon","Elastic","Compute","Cloud","(","EC2",")",".","Provide","thick","wrapper","around",":","external+boto3",":","py",":","class",":","`","boto3.client","(","``","ec2","''",")","<","EC2.Client",">","`","or",":","external+boto3",":","py",":","class",":","`","boto3.resource","(","``","ec2","''",")","<","EC2.ServiceResource",">","`",".",":","param","api_type",":","If","set","to","``","client_type","``","then","hook","use","``","boto3.client","(","``","ec2","''",")","``","capabilities",",","If","set","to","``","resource_type","``","then","hook","use","``","boto3.resource","(","``","ec2","''",")","``","capabilities",".","Additional","arguments","(","such","as","``","aws_conn_id","``",")","may","be","specified","and","are","passed","down","to","the","underlying","AwsBaseHook",".","..","seealso",":",":","-",":","class",":","`","airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook","`"]
code: def __init__(self, api_type="resource_type", *args, **kwargs) -> None:
      if api_type not in self.API_TYPES:
          raise AirflowException(
              "api_type can only be one of %s", self.API_TYPES
          )
  
      kwargs[api_type] = "ec2"
  
      self._api_type = api_type
  
      super().__init__(*args, **kwargs)
  
file_path: airflow/airflow/providers/amazon/aws/hooks/ec2.py
imports: from __future__ import annotations
  import functools
  import time
  from typing import Callable, TypeVar
  from airflow.exceptions import AirflowException
  from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
  from airflow.typing_compat import ParamSpec
label_desc: Use image node_id 1 to create a new EC2Hook object from inherited base classes: AwsBaseHook with example: obj = EC2Hook(api_type)