docstr: Create Instance and return instance id.
docstr_tok: ["Create","Instance","and","return","instance","id","."]
code: def _create_instance(cls, hook: EC2Hook):
      """Create Instance and return instance id."""
      conn = hook.get_conn()
      try:
          ec2_client = conn.meta.client
      except AttributeError:
          ec2_client = conn
  
      # We need existed AMI Image ID otherwise `moto` will raise DeprecationWarning.
      images = ec2_client.describe_images()["Images"]
      response = ec2_client.run_instances(
          MaxCount=1, MinCount=1, ImageId=images[0]["ImageId"]
      )
      return response["Instances"][0]["InstanceId"]
  
file_path: airflow/tests/providers/amazon/aws/sensors/test_ec2.py
imports: from __future__ import annotations
  import pytest
  from moto import mock_ec2
  from airflow.exceptions import TaskDeferred
  from airflow.providers.amazon.aws.hooks.ec2 import EC2Hook
  from airflow.providers.amazon.aws.sensors.ec2 import EC2InstanceStateSensor
label_desc: Use image node_id 3 for calling the TestEC2InstanceStateSensor obj's underlying member method code with example usage: obj._create_instance(cls, hook) and returns: response