class_docstr: Poll the state of the AWS EC2 instance until the instance reaches the target state.
  
  .. seealso::
      For more information on how to use this sensor, take a look at the guide:
      :ref:`howto/sensor:EC2InstanceStateSensor`
  
  :param target_state: target state of instance
  :param instance_id: id of the AWS EC2 instance
  :param region_name: (optional) aws region name associated with the client
  :param deferrable: if True, the sensor will run in deferrable mode
code: def hook(self):
      return EC2Hook(
          aws_conn_id=self.aws_conn_id, region_name=self.region_name
      )
  
file_path: airflow/airflow/providers/amazon/aws/sensors/ec2.py
imports: from __future__ import annotations
  from functools import cached_property
  from typing import TYPE_CHECKING, Any, Sequence
  from airflow.configuration import conf
  from airflow.exceptions import AirflowException, AirflowSkipException
  from airflow.providers.amazon.aws.hooks.ec2 import EC2Hook
  from airflow.providers.amazon.aws.triggers.ec2 import EC2StateSensorTrigger
  from airflow.sensors.base import BaseSensorOperator
label_desc: Use image node_id 3 for calling the EC2InstanceStateSensor obj's underlying member method code with example usage: obj.hook() and returns: EC2Hook