EC2¶
Client¶
- class EC2.Client¶
A low-level client representing Amazon Elastic Compute Cloud (EC2)
This is the Amazon EC2 API Reference. It provides descriptions, API request parameters, and the XML response for each of the Amazon EC2 Query API actions. Note that the Amazon EC2 API includes actions for Amazon EC2 plus additional services, such as Amazon EBS and Amazon VPC.
Learn more
To learn about using the Query API, see Using the API for Amazon EC2.
To learn about the permissions required to call an Amazon EC2 API action, see Actions, resources, and condition keys for Amazon EC2.
To get the list of API actions by service and resource, see Actions by service.
To get the alphabetical list of API actions, see .
To get descriptions of the API error codes, see Error codes for the Amazon EC2 API.
Alternatively, use one of the following methods to access the Amazon EC2 API, instead of using the Query API directly:
import boto3 client = boto3.client('ec2')
These are the available methods:
- accept_address_transfer
- accept_capacity_reservation_billing_ownership
- accept_reserved_instances_exchange_quote
- accept_transit_gateway_client_vpn_attachment
- accept_transit_gateway_multicast_domain_associations
- accept_transit_gateway_peering_attachment
- accept_transit_gateway_vpc_attachment
- accept_vpc_endpoint_connections
- accept_vpc_peering_connection
- advertise_byoip_cidr
- allocate_address
- allocate_hosts
- allocate_ipam_pool_cidr
- apply_security_groups_to_client_vpn_target_network
- assign_ipv6_addresses
- assign_private_ip_addresses
- assign_private_nat_gateway_address
- associate_address
- associate_application_status_check
- associate_capacity_reservation_billing_owner
- associate_client_vpn_target_network
- associate_dhcp_options
- associate_enclave_certificate_iam_role
- associate_iam_instance_profile
- associate_instance_event_window
- associate_ipam_byoasn
- associate_ipam_resource_discovery
- associate_nat_gateway_address
- associate_route_server
- associate_route_table
- associate_security_group_vpc
- associate_subnet_cidr_block
- associate_transit_gateway_multicast_domain
- associate_transit_gateway_policy_table
- associate_transit_gateway_route_table
- associate_trunk_interface
- associate_vpc_cidr_block
- attach_classic_link_vpc
- attach_image_watermark
- attach_internet_gateway
- attach_network_interface
- attach_verified_access_trust_provider
- attach_volume
- attach_vpn_gateway
- authorize_client_vpn_ingress
- authorize_security_group_egress
- authorize_security_group_ingress
- batch_modify_ipam_routing_policy_registrations
- bundle_instance
- can_paginate
- cancel_bundle_task
- cancel_capacity_reservation
- cancel_capacity_reservation_fleets
- cancel_conversion_task
- cancel_declarative_policies_report
- cancel_export_task
- cancel_image_launch_permission
- cancel_import_task
- cancel_reserved_instances_listing
- cancel_spot_fleet_requests
- cancel_spot_instance_requests
- close
- confirm_product_instance
- copy_fpga_image
- copy_image
- copy_snapshot
- copy_volumes
- create_application_status_check
- create_capacity_manager_data_export
- create_capacity_reservation
- create_capacity_reservation_by_splitting
- create_capacity_reservation_cancellation_quote
- create_capacity_reservation_fleet
- create_carrier_gateway
- create_client_vpn_endpoint
- create_client_vpn_route
- create_coip_cidr
- create_coip_pool
- create_customer_gateway
- create_default_subnet
- create_default_vpc
- create_delegate_mac_volume_ownership_task
- create_dhcp_options
- create_egress_only_internet_gateway
- create_fleet
- create_flow_logs
- create_fpga_image
- create_image
- create_image_usage_report
- create_instance_connect_endpoint
- create_instance_event_window
- create_instance_export_task
- create_internet_gateway
- create_interruptible_capacity_reservation_allocation
- create_ipam
- create_ipam_external_resource_verification_token
- create_ipam_internet_registry_association
- create_ipam_policy
- create_ipam_pool
- create_ipam_prefix_list_resolver
- create_ipam_prefix_list_resolver_target
- create_ipam_resource_discovery
- create_ipam_routing_policy_registration
- create_ipam_scope
- create_key_pair
- create_launch_template
- create_launch_template_version
- create_local_gateway_route
- create_local_gateway_route_table
- create_local_gateway_route_table_virtual_interface_group_association
- create_local_gateway_route_table_vpc_association
- create_local_gateway_virtual_interface
- create_local_gateway_virtual_interface_group
- create_mac_system_integrity_protection_modification_task
- create_managed_prefix_list
- create_nat_gateway
- create_network_acl
- create_network_acl_entry
- create_network_insights_access_scope
- create_network_insights_path
- create_network_interface
- create_network_interface_permission
- create_placement_group
- create_public_ipv4_pool
- create_replace_root_volume_task
- create_reserved_instances_listing
- create_restore_image_task
- create_route
- create_route_server
- create_route_server_endpoint
- create_route_server_peer
- create_route_table
- create_secondary_network
- create_secondary_subnet
- create_security_group
- create_snapshot
- create_snapshots
- create_spot_datafeed_subscription
- create_store_image_task
- create_subnet
- create_subnet_cidr_reservation
- create_tags
- create_traffic_mirror_filter
- create_traffic_mirror_filter_rule
- create_traffic_mirror_session
- create_traffic_mirror_target
- create_transit_gateway
- create_transit_gateway_connect
- create_transit_gateway_connect_peer
- create_transit_gateway_metering_policy
- create_transit_gateway_metering_policy_entry
- create_transit_gateway_multicast_domain
- create_transit_gateway_peering_attachment
- create_transit_gateway_policy_table
- create_transit_gateway_policy_table_entry
- create_transit_gateway_prefix_list_reference
- create_transit_gateway_route
- create_transit_gateway_route_table
- create_transit_gateway_route_table_announcement
- create_transit_gateway_vpc_attachment
- create_verified_access_endpoint
- create_verified_access_group
- create_verified_access_instance
- create_verified_access_trust_provider
- create_volume
- create_vpc
- create_vpc_block_public_access_exclusion
- create_vpc_encryption_control
- create_vpc_endpoint
- create_vpc_endpoint_connection_notification
- create_vpc_endpoint_service_configuration
- create_vpc_peering_connection
- create_vpn_concentrator
- create_vpn_connection
- create_vpn_connection_route
- create_vpn_gateway
- delete_application_status_check
- delete_capacity_manager_data_export
- delete_carrier_gateway
- delete_client_vpn_endpoint
- delete_client_vpn_route
- delete_coip_cidr
- delete_coip_pool
- delete_customer_gateway
- delete_dhcp_options
- delete_egress_only_internet_gateway
- delete_fleets
- delete_flow_logs
- delete_fpga_image
- delete_image_usage_report
- delete_instance_connect_endpoint
- delete_instance_event_window
- delete_internet_gateway
- delete_ipam
- delete_ipam_external_resource_verification_token
- delete_ipam_internet_registry_association
- delete_ipam_policy
- delete_ipam_pool
- delete_ipam_prefix_list_resolver
- delete_ipam_prefix_list_resolver_target
- delete_ipam_resource_discovery
- delete_ipam_routing_policy_registration
- delete_ipam_scope
- delete_key_pair
- delete_launch_template
- delete_launch_template_versions
- delete_local_gateway_route
- delete_local_gateway_route_table
- delete_local_gateway_route_table_virtual_interface_group_association
- delete_local_gateway_route_table_vpc_association
- delete_local_gateway_virtual_interface
- delete_local_gateway_virtual_interface_group
- delete_managed_prefix_list
- delete_nat_gateway
- delete_network_acl
- delete_network_acl_entry
- delete_network_insights_access_scope
- delete_network_insights_access_scope_analysis
- delete_network_insights_analysis
- delete_network_insights_path
- delete_network_interface
- delete_network_interface_permission
- delete_placement_group
- delete_public_ipv4_pool
- delete_queued_reserved_instances
- delete_route
- delete_route_server
- delete_route_server_endpoint
- delete_route_server_peer
- delete_route_table
- delete_secondary_network
- delete_secondary_subnet
- delete_security_group
- delete_snapshot
- delete_spot_datafeed_subscription
- delete_subnet
- delete_subnet_cidr_reservation
- delete_tags
- delete_traffic_mirror_filter
- delete_traffic_mirror_filter_rule
- delete_traffic_mirror_session
- delete_traffic_mirror_target
- delete_transit_gateway
- delete_transit_gateway_client_vpn_attachment
- delete_transit_gateway_connect
- delete_transit_gateway_connect_peer
- delete_transit_gateway_metering_policy
- delete_transit_gateway_metering_policy_entry
- delete_transit_gateway_multicast_domain
- delete_transit_gateway_peering_attachment
- delete_transit_gateway_policy_table
- delete_transit_gateway_policy_table_entry
- delete_transit_gateway_prefix_list_reference
- delete_transit_gateway_route
- delete_transit_gateway_route_table
- delete_transit_gateway_route_table_announcement
- delete_transit_gateway_vpc_attachment
- delete_verified_access_endpoint
- delete_verified_access_group
- delete_verified_access_instance
- delete_verified_access_trust_provider
- delete_volume
- delete_vpc
- delete_vpc_block_public_access_exclusion
- delete_vpc_encryption_control
- delete_vpc_endpoint_connection_notifications
- delete_vpc_endpoint_service_configurations
- delete_vpc_endpoints
- delete_vpc_peering_connection
- delete_vpn_concentrator
- delete_vpn_connection
- delete_vpn_connection_route
- delete_vpn_gateway
- deprovision_byoip_cidr
- deprovision_ipam_byoasn
- deprovision_ipam_pool_cidr
- deprovision_public_ipv4_pool_cidr
- deregister_image
- deregister_instance_event_notification_attributes
- deregister_transit_gateway_multicast_group_members
- deregister_transit_gateway_multicast_group_sources
- describe_account_attributes
- describe_account_vpc_encryption_control
- describe_address_transfers
- describe_addresses
- describe_addresses_attribute
- describe_aggregate_id_format
- describe_application_status
- describe_application_status_check_associations
- describe_application_status_checks
- describe_availability_zones
- describe_aws_network_performance_metric_subscriptions
- describe_bundle_tasks
- describe_byoip_cidrs
- describe_capacity_block_extension_history
- describe_capacity_block_extension_offerings
- describe_capacity_block_offerings
- describe_capacity_block_status
- describe_capacity_blocks
- describe_capacity_manager_data_exports
- describe_capacity_reservation_billing_requests
- describe_capacity_reservation_cancellation_quotes
- describe_capacity_reservation_fleets
- describe_capacity_reservation_topology
- describe_capacity_reservations
- describe_carrier_gateways
- describe_classic_link_instances
- describe_client_vpn_authorization_rules
- describe_client_vpn_connections
- describe_client_vpn_endpoints
- describe_client_vpn_routes
- describe_client_vpn_target_networks
- describe_coip_pools
- describe_conversion_tasks
- describe_customer_gateways
- describe_declarative_policies_reports
- describe_dhcp_options
- describe_egress_only_internet_gateways
- describe_elastic_gpus
- describe_export_image_tasks
- describe_export_tasks
- describe_fast_launch_images
- describe_fast_snapshot_restores
- describe_fleet_history
- describe_fleet_instances
- describe_fleets
- describe_flow_logs
- describe_fpga_image_attribute
- describe_fpga_images
- describe_host_reservation_offerings
- describe_host_reservations
- describe_hosts
- describe_iam_instance_profile_associations
- describe_id_format
- describe_identity_id_format
- describe_image_attribute
- describe_image_references
- describe_image_usage_report_entries
- describe_image_usage_reports
- describe_images
- describe_import_image_tasks