EC2 / Resource / Instance
Instance#
Note
Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources.
- class EC2.Instance(id)#
A resource representing an Amazon Elastic Compute Cloud (EC2) Instance:
import boto3 ec2 = boto3.resource('ec2') instance = ec2.Instance('id')
- Parameters:
id (string) – 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 Resources Introduction Guide.
These are the resource’s available identifiers:
Attributes#
Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the load()
method.
For more information about attributes refer to the Resources Introduction Guide.
These are the resource’s available attributes:
- ami_launch_index
- architecture
- block_device_mappings
- boot_mode
- 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
- 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
- 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 Resources Introduction Guide.
These are the resource’s available references:
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 Resources Introduction Guide.
These are the resource’s available actions:
- 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 Resources Introduction Guide.
These are the resource’s available collections:
Waiters#
Waiters provide an interface to wait for a resource to reach a specific state. For more information about waiters refer to the Resources Introduction Guide.
These are the resource’s available waiters: