:doc:`EC2 <../../ec2>` / Resource / Instance

========
Instance
========



.. note::

  Before using anything on this page, please refer to the resources :doc:`user guide <../../../../guide/resources>` for the most recent guidance on using resources.



.. py:class:: EC2.Instance(id)

  A resource representing an Amazon Elastic Compute Cloud (EC2) Instance::

    
    import boto3
    
    ec2 = boto3.resource('ec2')
    instance = ec2.Instance('id')

  :type id: string
  :param id: The Instance's id identifier. This **must** be set.
  




-----------
Identifiers
-----------



Identifiers are properties of a resource that are set upon instantiation of the resource.
For more information about identifiers refer to the :ref:`Resources Introduction Guide<identifiers_attributes_intro>`.

These are the resource's available identifiers:

.. toctree::
  :maxdepth: 1
  :titlesonly:

  id



----------
Attributes
----------



Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the :py:meth:`load` method.
For more information about attributes refer to the :ref:`Resources Introduction Guide<identifiers_attributes_intro>`.

These are the resource's available attributes:

.. toctree::
  :maxdepth: 1
  :titlesonly:

  ami_launch_index
  architecture
  block_device_mappings
  boot_mode
  capacity_block_id
  capacity_reservation_id
  capacity_reservation_specification
  client_token
  cpu_options
  current_instance_boot_mode
  ebs_optimized
  elastic_gpu_associations
  elastic_inference_accelerator_associations
  ena_support
  enclave_options
  hibernation_options
  hypervisor
  iam_instance_profile
  image_id
  instance_id
  instance_lifecycle
  instance_type
  ipv6_address
  kernel_id
  key_name
  launch_time
  licenses
  maintenance_options
  metadata_options
  monitoring
  network_interfaces_attribute
  network_performance_options
  operator
  outpost_arn
  placement
  platform
  platform_details
  private_dns_name
  private_dns_name_options
  private_ip_address
  product_codes
  public_dns_name
  public_ip_address
  ramdisk_id
  root_device_name
  root_device_type
  secondary_interfaces
  security_groups
  source_dest_check
  spot_instance_request_id
  sriov_net_support
  state
  state_reason
  state_transition_reason
  subnet_id
  tags
  tpm_support
  usage_operation
  usage_operation_update_time
  virtualization_type
  vpc_id



----------
References
----------



References are related resource instances that have a belongs-to relationship.
For more information about references refer to the :ref:`Resources Introduction Guide<references_intro>`.

These are the resource's available references:

.. toctree::
  :maxdepth: 1
  :titlesonly:

  classic_address
  image
  key_pair
  network_interfaces
  placement_group
  subnet
  vpc



-------
Actions
-------



Actions call operations on resources.  They may automatically handle the passing in of arguments set from identifiers and some attributes.
For more information about actions refer to the :ref:`Resources Introduction Guide<actions_intro>`.

These are the resource's available actions:

.. toctree::
  :maxdepth: 1
  :titlesonly:

  attach_classic_link_vpc
  attach_volume
  console_output
  create_image
  create_tags
  delete_tags
  describe_attribute
  detach_classic_link_vpc
  detach_volume
  get_available_subresources
  load
  modify_attribute
  monitor
  password_data
  reboot
  reload
  report_status
  reset_attribute
  reset_kernel
  reset_ramdisk
  reset_source_dest_check
  start
  stop
  terminate
  unmonitor



-----------
Collections
-----------



Collections provide an interface to iterate over and manipulate groups of resources. 
For more information about collections refer to the :ref:`Resources Introduction Guide<guide_collections>`.

These are the resource's available collections:

.. toctree::
  :maxdepth: 1
  :titlesonly:

  volumes
  vpc_addresses



-------
Waiters
-------



Waiters provide an interface to wait for a resource to reach a specific state.
For more information about waiters refer to the :ref:`Resources Introduction Guide<waiters_intro>`.

These are the resource's available waiters:

.. toctree::
  :maxdepth: 1
  :titlesonly:

  wait_until_exists
  wait_until_running
  wait_until_stopped
  wait_until_terminated
