Table of Contents
A low-level client representing Amazon Elastic Compute Cloud (EC2):
import boto3
client = boto3.client('ec2')
These are the available methods:
Accepts the Convertible Reserved Instance exchange quote described in the GetReservedInstancesExchangeQuote call.
See also: AWS API Documentation
Request Syntax
response = client.accept_reserved_instances_exchange_quote(
DryRun=True|False,
ReservedInstanceIds=[
'string',
],
TargetConfigurations=[
{
'InstanceCount': 123,
'OfferingId': 'string'
},
]
)
[REQUIRED]
The IDs of the Convertible Reserved Instances to exchange for another Convertible Reserved Instance of the same or higher value.
The configuration of the target Convertible Reserved Instance to exchange for your current Convertible Reserved Instances.
Details about the target configuration.
The number of instances the Covertible Reserved Instance offering can be applied to. This parameter is reserved and cannot be specified in a request
The Convertible Reserved Instance offering ID.
dict
Response Syntax
{
'ExchangeId': 'string'
}
Response Structure
(dict) --
The result of the exchange and whether it was successful .
ExchangeId (string) --
The ID of the successful exchange.
Accepts a request to attach a VPC to a transit gateway.
The VPC attachment must be in the pendingAcceptance state. Use DescribeTransitGatewayVpcAttachments to view your pending VPC attachment requests. Use RejectTransitGatewayVpcAttachment to reject a VPC attachment request.
See also: AWS API Documentation
Request Syntax
response = client.accept_transit_gateway_vpc_attachment(
TransitGatewayAttachmentId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the attachment.
dict
Response Syntax
{
'TransitGatewayVpcAttachment': {
'TransitGatewayAttachmentId': 'string',
'TransitGatewayId': 'string',
'VpcId': 'string',
'VpcOwnerId': 'string',
'State': 'pendingAcceptance'|'rollingBack'|'pending'|'available'|'modifying'|'deleting'|'deleted'|'failed'|'rejected'|'rejecting'|'failing',
'SubnetIds': [
'string',
],
'CreationTime': datetime(2015, 1, 1),
'Options': {
'DnsSupport': 'enable'|'disable',
'Ipv6Support': 'enable'|'disable'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
TransitGatewayVpcAttachment (dict) --
The VPC attachment.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
TransitGatewayId (string) --
The ID of the transit gateway.
VpcId (string) --
The ID of the VPC.
VpcOwnerId (string) --
The ID of the AWS account that owns the VPC.
State (string) --
The state of the VPC attachment.
SubnetIds (list) --
The IDs of the subnets.
CreationTime (datetime) --
The creation time.
Options (dict) --
The VPC attachment options.
DnsSupport (string) --
Indicates whether DNS support is enabled.
Ipv6Support (string) --
Indicates whether IPv6 support is enabled.
Tags (list) --
The tags for the VPC attachment.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Accepts one or more interface VPC endpoint connection requests to your VPC endpoint service.
See also: AWS API Documentation
Request Syntax
response = client.accept_vpc_endpoint_connections(
DryRun=True|False,
ServiceId='string',
VpcEndpointIds=[
'string',
]
)
[REQUIRED]
The ID of the endpoint service.
[REQUIRED]
The IDs of one or more interface VPC endpoints.
dict
Response Syntax
{
'Unsuccessful': [
{
'Error': {
'Code': 'string',
'Message': 'string'
},
'ResourceId': 'string'
},
]
}
Response Structure
(dict) --
Unsuccessful (list) --
Information about the interface endpoints that were not accepted, if applicable.
(dict) --
Information about items that were not successfully processed in a batch call.
Error (dict) --
Information about the error.
Code (string) --
The error code.
Message (string) --
The error message accompanying the error code.
ResourceId (string) --
The ID of the resource.
Accept a VPC peering connection request. To accept a request, the VPC peering connection must be in the pending-acceptance state, and you must be the owner of the peer VPC. Use DescribeVpcPeeringConnections to view your outstanding VPC peering connection requests.
For an inter-Region VPC peering connection request, you must accept the VPC peering connection in the Region of the accepter VPC.
See also: AWS API Documentation
Request Syntax
response = client.accept_vpc_peering_connection(
DryRun=True|False,
VpcPeeringConnectionId='string'
)
dict
Response Syntax
{
'VpcPeeringConnection': {
'AccepterVpcInfo': {
'CidrBlock': 'string',
'Ipv6CidrBlockSet': [
{
'Ipv6CidrBlock': 'string'
},
],
'CidrBlockSet': [
{
'CidrBlock': 'string'
},
],
'OwnerId': 'string',
'PeeringOptions': {
'AllowDnsResolutionFromRemoteVpc': True|False,
'AllowEgressFromLocalClassicLinkToRemoteVpc': True|False,
'AllowEgressFromLocalVpcToRemoteClassicLink': True|False
},
'VpcId': 'string',
'Region': 'string'
},
'ExpirationTime': datetime(2015, 1, 1),
'RequesterVpcInfo': {
'CidrBlock': 'string',
'Ipv6CidrBlockSet': [
{
'Ipv6CidrBlock': 'string'
},
],
'CidrBlockSet': [
{
'CidrBlock': 'string'
},
],
'OwnerId': 'string',
'PeeringOptions': {
'AllowDnsResolutionFromRemoteVpc': True|False,
'AllowEgressFromLocalClassicLinkToRemoteVpc': True|False,
'AllowEgressFromLocalVpcToRemoteClassicLink': True|False
},
'VpcId': 'string',
'Region': 'string'
},
'Status': {
'Code': 'initiating-request'|'pending-acceptance'|'active'|'deleted'|'rejected'|'failed'|'expired'|'provisioning'|'deleting',
'Message': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VpcPeeringConnectionId': 'string'
}
}
Response Structure
(dict) --
VpcPeeringConnection (dict) --
Information about the VPC peering connection.
AccepterVpcInfo (dict) --
Information about the accepter VPC. CIDR block information is only returned when describing an active VPC peering connection.
CidrBlock (string) --
The IPv4 CIDR block for the VPC.
Ipv6CidrBlockSet (list) --
The IPv6 CIDR block for the VPC.
(dict) --
Describes an IPv6 CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
CidrBlockSet (list) --
Information about the IPv4 CIDR blocks for the VPC.
(dict) --
Describes an IPv4 CIDR block.
CidrBlock (string) --
The IPv4 CIDR block.
OwnerId (string) --
The AWS account ID of the VPC owner.
PeeringOptions (dict) --
Information about the VPC peering connection options for the accepter or requester VPC.
AllowDnsResolutionFromRemoteVpc (boolean) --
Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
AllowEgressFromLocalClassicLinkToRemoteVpc (boolean) --
Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection.
AllowEgressFromLocalVpcToRemoteClassicLink (boolean) --
Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection.
VpcId (string) --
The ID of the VPC.
Region (string) --
The Region in which the VPC is located.
ExpirationTime (datetime) --
The time that an unaccepted VPC peering connection will expire.
RequesterVpcInfo (dict) --
Information about the requester VPC. CIDR block information is only returned when describing an active VPC peering connection.
CidrBlock (string) --
The IPv4 CIDR block for the VPC.
Ipv6CidrBlockSet (list) --
The IPv6 CIDR block for the VPC.
(dict) --
Describes an IPv6 CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
CidrBlockSet (list) --
Information about the IPv4 CIDR blocks for the VPC.
(dict) --
Describes an IPv4 CIDR block.
CidrBlock (string) --
The IPv4 CIDR block.
OwnerId (string) --
The AWS account ID of the VPC owner.
PeeringOptions (dict) --
Information about the VPC peering connection options for the accepter or requester VPC.
AllowDnsResolutionFromRemoteVpc (boolean) --
Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
AllowEgressFromLocalClassicLinkToRemoteVpc (boolean) --
Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection.
AllowEgressFromLocalVpcToRemoteClassicLink (boolean) --
Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection.
VpcId (string) --
The ID of the VPC.
Region (string) --
The Region in which the VPC is located.
Status (dict) --
The status of the VPC peering connection.
Code (string) --
The status of the VPC peering connection.
Message (string) --
A message that provides more information about the status, if applicable.
Tags (list) --
Any tags assigned to the resource.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VpcPeeringConnectionId (string) --
The ID of the VPC peering connection.
Advertises an IPv4 address range that is provisioned for use with your AWS resources through bring your own IP addresses (BYOIP).
You can perform this operation at most once every 10 seconds, even if you specify different address ranges each time.
We recommend that you stop advertising the BYOIP CIDR from other locations when you advertise it from AWS. To minimize down time, you can configure your AWS resources to use an address from a BYOIP CIDR before it is advertised, and then simultaneously stop advertising it from the current location and start advertising it through AWS.
It can take a few minutes before traffic to the specified addresses starts routing to AWS because of BGP propagation delays.
To stop advertising the BYOIP CIDR, use WithdrawByoipCidr .
See also: AWS API Documentation
Request Syntax
response = client.advertise_byoip_cidr(
Cidr='string',
DryRun=True|False
)
[REQUIRED]
The IPv4 address range, in CIDR notation. This must be the exact range that you provisioned. You can't advertise only a portion of the provisioned range.
dict
Response Syntax
{
'ByoipCidr': {
'Cidr': 'string',
'Description': 'string',
'StatusMessage': 'string',
'State': 'advertised'|'deprovisioned'|'failed-deprovision'|'failed-provision'|'pending-deprovision'|'pending-provision'|'provisioned'
}
}
Response Structure
(dict) --
ByoipCidr (dict) --
Information about the address range.
Cidr (string) --
The public IPv4 address range, in CIDR notation.
Description (string) --
The description of the address range.
StatusMessage (string) --
Upon success, contains the ID of the address pool. Otherwise, contains an error message.
State (string) --
The state of the address pool.
Allocates an Elastic IP address to your AWS account. After you allocate the Elastic IP address you can associate it with an instance or network interface. After you release an Elastic IP address, it is released to the IP address pool and can be allocated to a different AWS account.
You can allocate an Elastic IP address from an address pool owned by AWS or from an address pool created from a public IPv4 address range that you have brought to AWS for use with your AWS resources using bring your own IP addresses (BYOIP). For more information, see Bring Your Own IP Addresses (BYOIP) in the Amazon Elastic Compute Cloud User Guide .
[EC2-VPC] If you release an Elastic IP address, you might be able to recover it. You cannot recover an Elastic IP address that you released after it is allocated to another AWS account. You cannot recover an Elastic IP address for EC2-Classic. To attempt to recover an Elastic IP address that you released, specify it in this operation.
An Elastic IP address is for use either in the EC2-Classic platform or in a VPC. By default, you can allocate 5 Elastic IP addresses for EC2-Classic per Region and 5 Elastic IP addresses for EC2-VPC per Region.
For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.allocate_address(
Domain='vpc'|'standard',
Address='string',
PublicIpv4Pool='string',
DryRun=True|False
)
Set to vpc to allocate the address for use with instances in a VPC.
Default: The address is for use with instances in EC2-Classic.
dict
Response Syntax
{
'PublicIp': 'string',
'AllocationId': 'string',
'PublicIpv4Pool': 'string',
'Domain': 'vpc'|'standard'
}
Response Structure
(dict) --
PublicIp (string) --
The Elastic IP address.
AllocationId (string) --
[EC2-VPC] The ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.
PublicIpv4Pool (string) --
The ID of an address pool.
Domain (string) --
Indicates whether this Elastic IP address is for use with instances in EC2-Classic (standard ) or instances in a VPC (vpc ).
Examples
This example allocates an Elastic IP address to use with an instance in a VPC.
response = client.allocate_address(
Domain='vpc',
)
print(response)
Expected Output:
{
'AllocationId': 'eipalloc-64d5890a',
'Domain': 'vpc',
'PublicIp': '203.0.113.0',
'ResponseMetadata': {
'...': '...',
},
}
This example allocates an Elastic IP address to use with an instance in EC2-Classic.
response = client.allocate_address(
)
print(response)
Expected Output:
{
'Domain': 'standard',
'PublicIp': '198.51.100.0',
'ResponseMetadata': {
'...': '...',
},
}
Allocates a Dedicated Host to your account. At a minimum, specify the instance size type, Availability Zone, and quantity of hosts to allocate.
See also: AWS API Documentation
Request Syntax
response = client.allocate_hosts(
AutoPlacement='on'|'off',
AvailabilityZone='string',
ClientToken='string',
InstanceType='string',
Quantity=123,
TagSpecifications=[
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
HostRecovery='on'|'off'
)
Indicates whether the host accepts any untargeted instance launches that match its instance type configuration, or if it only accepts Host tenancy instance launches that specify its unique host ID. For more information, see Understanding Instance Placement and Host Affinity in the Amazon EC2 User Guide for Linux Instances .
Default: on
[REQUIRED]
The Availability Zone in which to allocate the Dedicated Host.
[REQUIRED]
Specifies the instance type for which to configure your Dedicated Hosts. When you specify the instance type, that is the only instance type that you can launch onto that host.
[REQUIRED]
The number of Dedicated Hosts to allocate to your account with these parameters.
The tags to apply to the Dedicated Host during creation.
The tags to apply to a resource when the resource is being created.
The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default. For more information, see Host Recovery in the Amazon Elastic Compute Cloud User Guide .
Default: off
dict
Response Syntax
{
'HostIds': [
'string',
]
}
Response Structure
(dict) --
Contains the output of AllocateHosts.
HostIds (list) --
The ID of the allocated Dedicated Host. This is used to launch an instance onto a specific host.
Applies a security group to the association between the target network and the Client VPN endpoint. This action replaces the existing security groups with the specified security groups.
See also: AWS API Documentation
Request Syntax
response = client.apply_security_groups_to_client_vpn_target_network(
ClientVpnEndpointId='string',
VpcId='string',
SecurityGroupIds=[
'string',
],
DryRun=True|False
)
[REQUIRED]
The ID of the Client VPN endpoint.
[REQUIRED]
The ID of the VPC in which the associated target network is located.
[REQUIRED]
The IDs of the security groups to apply to the associated target network. Up to 5 security groups can be applied to an associated target network.
dict
Response Syntax
{
'SecurityGroupIds': [
'string',
]
}
Response Structure
(dict) --
SecurityGroupIds (list) --
The IDs of the applied security groups.
Assigns one or more IPv6 addresses to the specified network interface. You can specify one or more specific IPv6 addresses, or you can specify the number of IPv6 addresses to be automatically assigned from within the subnet's IPv6 CIDR block range. You can assign as many IPv6 addresses to a network interface as you can assign private IPv4 addresses, and the limit varies per instance type. For information, see IP Addresses Per Network Interface Per Instance Type in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.assign_ipv6_addresses(
Ipv6AddressCount=123,
Ipv6Addresses=[
'string',
],
NetworkInterfaceId='string'
)
One or more specific IPv6 addresses to be assigned to the network interface. You can't use this option if you're specifying a number of IPv6 addresses.
[REQUIRED]
The ID of the network interface.
dict
Response Syntax
{
'AssignedIpv6Addresses': [
'string',
],
'NetworkInterfaceId': 'string'
}
Response Structure
(dict) --
AssignedIpv6Addresses (list) --
The IPv6 addresses assigned to the network interface.
NetworkInterfaceId (string) --
The ID of the network interface.
Assigns one or more secondary private IP addresses to the specified network interface.
You can specify one or more specific secondary IP addresses, or you can specify the number of secondary IP addresses to be automatically assigned within the subnet's CIDR block range. The number of secondary IP addresses that you can assign to an instance varies by instance type. For information about instance types, see Instance Types in the Amazon Elastic Compute Cloud User Guide . For more information about Elastic IP addresses, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide .
When you move a secondary private IP address to another network interface, any Elastic IP address that is associated with the IP address is also moved.
Remapping an IP address is an asynchronous operation. When you move an IP address from one network interface to another, check network/interfaces/macs/mac/local-ipv4s in the instance metadata to confirm that the remapping is complete.
See also: AWS API Documentation
Request Syntax
response = client.assign_private_ip_addresses(
AllowReassignment=True|False,
NetworkInterfaceId='string',
PrivateIpAddresses=[
'string',
],
SecondaryPrivateIpAddressCount=123
)
[REQUIRED]
The ID of the network interface.
One or more IP addresses to be assigned as a secondary private IP address to the network interface. You can't specify this parameter when also specifying a number of secondary IP addresses.
If you don't specify an IP address, Amazon EC2 automatically selects an IP address within the subnet range.
dict
Response Syntax
{
'NetworkInterfaceId': 'string',
'AssignedPrivateIpAddresses': [
{
'PrivateIpAddress': 'string'
},
]
}
Response Structure
(dict) --
NetworkInterfaceId (string) --
The ID of the network interface.
AssignedPrivateIpAddresses (list) --
The private IP addresses assigned to the network interface.
(dict) --
Describes the private IP addresses assigned to a network interface.
PrivateIpAddress (string) --
The private IP address assigned to the network interface.
Examples
This example assigns the specified secondary private IP address to the specified network interface.
response = client.assign_private_ip_addresses(
NetworkInterfaceId='eni-e5aa89a3',
PrivateIpAddresses=[
'10.0.0.82',
],
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
This example assigns two secondary private IP addresses to the specified network interface. Amazon EC2 automatically assigns these IP addresses from the available IP addresses in the CIDR block range of the subnet the network interface is associated with.
response = client.assign_private_ip_addresses(
NetworkInterfaceId='eni-e5aa89a3',
SecondaryPrivateIpAddressCount=2,
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Associates an Elastic IP address with an instance or a network interface. Before you can use an Elastic IP address, you must allocate it to your account.
An Elastic IP address is for use in either the EC2-Classic platform or in a VPC. For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide .
[EC2-Classic, VPC in an EC2-VPC-only account] If the Elastic IP address is already associated with a different instance, it is disassociated from that instance and associated with the specified instance. If you associate an Elastic IP address with an instance that has an existing Elastic IP address, the existing address is disassociated from the instance, but remains allocated to your account.
[VPC in an EC2-Classic account] If you don't specify a private IP address, the Elastic IP address is associated with the primary IP address. If the Elastic IP address is already associated with a different instance or a network interface, you get an error unless you allow reassociation. You cannot associate an Elastic IP address with an instance or network interface that has an existing Elastic IP address.
Warning
This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error, and you may be charged for each time the Elastic IP address is remapped to the same instance. For more information, see the Elastic IP Addresses section of Amazon EC2 Pricing .
See also: AWS API Documentation
Request Syntax
response = client.associate_address(
AllocationId='string',
InstanceId='string',
PublicIp='string',
AllowReassociation=True|False,
DryRun=True|False,
NetworkInterfaceId='string',
PrivateIpAddress='string'
)
[EC2-VPC] The ID of the network interface. If the instance has more than one network interface, you must specify a network interface ID.
For EC2-VPC, you can specify either the instance ID or the network interface ID, but not both.
dict
Response Syntax
{
'AssociationId': 'string'
}
Response Structure
(dict) --
AssociationId (string) --
[EC2-VPC] The ID that represents the association of the Elastic IP address with an instance.
Examples
This example associates the specified Elastic IP address with the specified instance in a VPC.
response = client.associate_address(
AllocationId='eipalloc-64d5890a',
InstanceId='i-0b263919b6498b123',
)
print(response)
Expected Output:
{
'AssociationId': 'eipassoc-2bebb745',
'ResponseMetadata': {
'...': '...',
},
}
This example associates the specified Elastic IP address with the specified network interface.
response = client.associate_address(
AllocationId='eipalloc-64d5890a',
NetworkInterfaceId='eni-1a2b3c4d',
)
print(response)
Expected Output:
{
'AssociationId': 'eipassoc-2bebb745',
'ResponseMetadata': {
'...': '...',
},
}
This example associates an Elastic IP address with an instance in EC2-Classic.
response = client.associate_address(
InstanceId='i-07ffe74c7330ebf53',
PublicIp='198.51.100.0',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Associates a target network with a Client VPN endpoint. A target network is a subnet in a VPC. You can associate multiple subnets from the same VPC with a Client VPN endpoint. You can associate only one subnet in each Availability Zone. We recommend that you associate at least two subnets to provide Availability Zone redundancy.
See also: AWS API Documentation
Request Syntax
response = client.associate_client_vpn_target_network(
ClientVpnEndpointId='string',
SubnetId='string',
ClientToken='string',
DryRun=True|False
)
[REQUIRED]
The ID of the Client VPN endpoint.
[REQUIRED]
The ID of the subnet to associate with the Client VPN endpoint.
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency .
This field is autopopulated if not provided.
dict
Response Syntax
{
'AssociationId': 'string',
'Status': {
'Code': 'associating'|'associated'|'association-failed'|'disassociating'|'disassociated',
'Message': 'string'
}
}
Response Structure
(dict) --
AssociationId (string) --
The unique ID of the target network association.
Status (dict) --
The current state of the target network association.
Code (string) --
The state of the target network association.
Message (string) --
A message about the status of the target network association, if applicable.
Associates a set of DHCP options (that you've previously created) with the specified VPC, or associates no DHCP options with the VPC.
After you associate the options with the VPC, any existing instances and all new instances that you launch in that VPC use the options. You don't need to restart or relaunch the instances. They automatically pick up the changes within a few hours, depending on how frequently the instance renews its DHCP lease. You can explicitly renew the lease using the operating system on the instance.
For more information, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.associate_dhcp_options(
DhcpOptionsId='string',
VpcId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the DHCP options set, or default to associate no DHCP options with the VPC.
[REQUIRED]
The ID of the VPC.
None
Examples
This example associates the specified DHCP options set with the specified VPC.
response = client.associate_dhcp_options(
DhcpOptionsId='dopt-d9070ebb',
VpcId='vpc-a01106c2',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
This example associates the default DHCP options set with the specified VPC.
response = client.associate_dhcp_options(
DhcpOptionsId='default',
VpcId='vpc-a01106c2',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Associates an IAM instance profile with a running or stopped instance. You cannot associate more than one IAM instance profile with an instance.
See also: AWS API Documentation
Request Syntax
response = client.associate_iam_instance_profile(
IamInstanceProfile={
'Arn': 'string',
'Name': 'string'
},
InstanceId='string'
)
[REQUIRED]
The IAM instance profile.
The Amazon Resource Name (ARN) of the instance profile.
The name of the instance profile.
[REQUIRED]
The ID of the instance.
dict
Response Syntax
{
'IamInstanceProfileAssociation': {
'AssociationId': 'string',
'InstanceId': 'string',
'IamInstanceProfile': {
'Arn': 'string',
'Id': 'string'
},
'State': 'associating'|'associated'|'disassociating'|'disassociated',
'Timestamp': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
IamInstanceProfileAssociation (dict) --
Information about the IAM instance profile association.
AssociationId (string) --
The ID of the association.
InstanceId (string) --
The ID of the instance.
IamInstanceProfile (dict) --
The IAM instance profile.
Arn (string) --
The Amazon Resource Name (ARN) of the instance profile.
Id (string) --
The ID of the instance profile.
State (string) --
The state of the association.
Timestamp (datetime) --
The time the IAM instance profile was associated with the instance.
Associates a subnet with a route table. The subnet and route table must be in the same VPC. This association causes traffic originating from the subnet to be routed according to the routes in the route table. The action returns an association ID, which you need in order to disassociate the route table from the subnet later. A route table can be associated with multiple subnets.
For more information, see Route Tables in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.associate_route_table(
DryRun=True|False,
RouteTableId='string',
SubnetId='string'
)
[REQUIRED]
The ID of the route table.
[REQUIRED]
The ID of the subnet.
dict
Response Syntax
{
'AssociationId': 'string'
}
Response Structure
(dict) --
AssociationId (string) --
The route table association ID. This ID is required for disassociating the route table.
Examples
This example associates the specified route table with the specified subnet.
response = client.associate_route_table(
RouteTableId='rtb-22574640',
SubnetId='subnet-9d4a7b6',
)
print(response)
Expected Output:
{
'AssociationId': 'rtbassoc-781d0d1a',
'ResponseMetadata': {
'...': '...',
},
}
Associates a CIDR block with your subnet. You can only associate a single IPv6 CIDR block with your subnet. An IPv6 CIDR block must have a prefix length of /64.
See also: AWS API Documentation
Request Syntax
response = client.associate_subnet_cidr_block(
Ipv6CidrBlock='string',
SubnetId='string'
)
[REQUIRED]
The IPv6 CIDR block for your subnet. The subnet must have a /64 prefix length.
[REQUIRED]
The ID of your subnet.
dict
Response Syntax
{
'Ipv6CidrBlockAssociation': {
'AssociationId': 'string',
'Ipv6CidrBlock': 'string',
'Ipv6CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
}
},
'SubnetId': 'string'
}
Response Structure
(dict) --
Ipv6CidrBlockAssociation (dict) --
Information about the IPv6 CIDR block association.
AssociationId (string) --
The association ID for the CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
Ipv6CidrBlockState (dict) --
Information about the state of the CIDR block.
State (string) --
The state of a CIDR block.
StatusMessage (string) --
A message about the status of the CIDR block, if applicable.
SubnetId (string) --
The ID of the subnet.
Associates the specified attachment with the specified transit gateway route table. You can associate only one route table with an attachment.
See also: AWS API Documentation
Request Syntax
response = client.associate_transit_gateway_route_table(
TransitGatewayRouteTableId='string',
TransitGatewayAttachmentId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the transit gateway route table.
[REQUIRED]
The ID of the attachment.
dict
Response Syntax
{
'Association': {
'TransitGatewayRouteTableId': 'string',
'TransitGatewayAttachmentId': 'string',
'ResourceId': 'string',
'ResourceType': 'vpc'|'vpn'|'direct-connect-gateway',
'State': 'associating'|'associated'|'disassociating'|'disassociated'
}
}
Response Structure
(dict) --
Association (dict) --
The ID of the association.
TransitGatewayRouteTableId (string) --
The ID of the transit gateway route table.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
ResourceId (string) --
The ID of the resource.
ResourceType (string) --
The resource type.
State (string) --
The state of the association.
Associates a CIDR block with your VPC. You can associate a secondary IPv4 CIDR block, or you can associate an Amazon-provided IPv6 CIDR block. The IPv6 CIDR block size is fixed at /56.
For more information about associating CIDR blocks with your VPC and applicable restrictions, see VPC and Subnet Sizing in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.associate_vpc_cidr_block(
AmazonProvidedIpv6CidrBlock=True|False,
CidrBlock='string',
VpcId='string'
)
[REQUIRED]
The ID of the VPC.
dict
Response Syntax
{
'Ipv6CidrBlockAssociation': {
'AssociationId': 'string',
'Ipv6CidrBlock': 'string',
'Ipv6CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
}
},
'CidrBlockAssociation': {
'AssociationId': 'string',
'CidrBlock': 'string',
'CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
}
},
'VpcId': 'string'
}
Response Structure
(dict) --
Ipv6CidrBlockAssociation (dict) --
Information about the IPv6 CIDR block association.
AssociationId (string) --
The association ID for the IPv6 CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
Ipv6CidrBlockState (dict) --
Information about the state of the CIDR block.
State (string) --
The state of the CIDR block.
StatusMessage (string) --
A message about the status of the CIDR block, if applicable.
CidrBlockAssociation (dict) --
Information about the IPv4 CIDR block association.
AssociationId (string) --
The association ID for the IPv4 CIDR block.
CidrBlock (string) --
The IPv4 CIDR block.
CidrBlockState (dict) --
Information about the state of the CIDR block.
State (string) --
The state of the CIDR block.
StatusMessage (string) --
A message about the status of the CIDR block, if applicable.
VpcId (string) --
The ID of the VPC.
Links an EC2-Classic instance to a ClassicLink-enabled VPC through one or more of the VPC's security groups. You cannot link an EC2-Classic instance to more than one VPC at a time. You can only link an instance that's in the running state. An instance is automatically unlinked from a VPC when it's stopped - you can link it to the VPC again when you restart it.
After you've linked an instance, you cannot change the VPC security groups that are associated with it. To change the security groups, you must first unlink the instance, and then link it again.
Linking your instance to a VPC is sometimes referred to as attaching your instance.
See also: AWS API Documentation
Request Syntax
response = client.attach_classic_link_vpc(
DryRun=True|False,
Groups=[
'string',
],
InstanceId='string',
VpcId='string'
)
[REQUIRED]
The ID of one or more of the VPC's security groups. You cannot specify security groups from a different VPC.
[REQUIRED]
The ID of an EC2-Classic instance to link to the ClassicLink-enabled VPC.
[REQUIRED]
The ID of a ClassicLink-enabled VPC.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Attaches an internet gateway to a VPC, enabling connectivity between the internet and the VPC. For more information about your VPC and internet gateway, see the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.attach_internet_gateway(
DryRun=True|False,
InternetGatewayId='string',
VpcId='string'
)
[REQUIRED]
The ID of the internet gateway.
[REQUIRED]
The ID of the VPC.
None
Examples
This example attaches the specified Internet gateway to the specified VPC.
response = client.attach_internet_gateway(
InternetGatewayId='igw-c0a643a9',
VpcId='vpc-a01106c2',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Attaches a network interface to an instance.
See also: AWS API Documentation
Request Syntax
response = client.attach_network_interface(
DeviceIndex=123,
DryRun=True|False,
InstanceId='string',
NetworkInterfaceId='string'
)
[REQUIRED]
The index of the device for the network interface attachment.
[REQUIRED]
The ID of the instance.
[REQUIRED]
The ID of the network interface.
dict
Response Syntax
{
'AttachmentId': 'string'
}
Response Structure
(dict) --
Contains the output of AttachNetworkInterface.
AttachmentId (string) --
The ID of the network interface attachment.
Examples
This example attaches the specified network interface to the specified instance.
response = client.attach_network_interface(
DeviceIndex=1,
InstanceId='i-1234567890abcdef0',
NetworkInterfaceId='eni-e5aa89a3',
)
print(response)
Expected Output:
{
'AttachmentId': 'eni-attach-66c4350a',
'ResponseMetadata': {
'...': '...',
},
}
Attaches an EBS volume to a running or stopped instance and exposes it to the instance with the specified device name.
Encrypted EBS volumes must be attached to instances that support Amazon EBS encryption. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
After you attach an EBS volume, you must make it available. For more information, see Making an EBS Volume Available For Use .
If a volume has an AWS Marketplace product code:
For more information, see Attaching Amazon EBS Volumes in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.attach_volume(
Device='string',
InstanceId='string',
VolumeId='string',
DryRun=True|False
)
[REQUIRED]
The device name (for example, /dev/sdh or xvdh ).
[REQUIRED]
The ID of the instance.
[REQUIRED]
The ID of the EBS volume. The volume and instance must be within the same Availability Zone.
dict
Response Syntax
{
'AttachTime': datetime(2015, 1, 1),
'Device': 'string',
'InstanceId': 'string',
'State': 'attaching'|'attached'|'detaching'|'detached'|'busy',
'VolumeId': 'string',
'DeleteOnTermination': True|False
}
Response Structure
(dict) --
Describes volume attachment details.
AttachTime (datetime) --
The time stamp when the attachment initiated.
Device (string) --
The device name.
InstanceId (string) --
The ID of the instance.
State (string) --
The attachment state of the volume.
VolumeId (string) --
The ID of the volume.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
Examples
This example attaches a volume (vol-1234567890abcdef0) to an instance (i-01474ef662b89480) as /dev/sdf.
response = client.attach_volume(
Device='/dev/sdf',
InstanceId='i-01474ef662b89480',
VolumeId='vol-1234567890abcdef0',
)
print(response)
Expected Output:
{
'AttachTime': datetime(2016, 8, 29, 18, 52, 32, 0, 242, 0),
'Device': '/dev/sdf',
'InstanceId': 'i-01474ef662b89480',
'State': 'attaching',
'VolumeId': 'vol-1234567890abcdef0',
'ResponseMetadata': {
'...': '...',
},
}
Attaches a virtual private gateway to a VPC. You can attach one virtual private gateway to one VPC at a time.
For more information, see AWS Site-to-Site VPN in the AWS Site-to-Site VPN User Guide .
See also: AWS API Documentation
Request Syntax
response = client.attach_vpn_gateway(
VpcId='string',
VpnGatewayId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the VPC.
[REQUIRED]
The ID of the virtual private gateway.
dict
Response Syntax
{
'VpcAttachment': {
'State': 'attaching'|'attached'|'detaching'|'detached',
'VpcId': 'string'
}
}
Response Structure
(dict) --
Contains the output of AttachVpnGateway.
VpcAttachment (dict) --
Information about the attachment.
State (string) --
The current state of the attachment.
VpcId (string) --
The ID of the VPC.
Adds an ingress authorization rule to a Client VPN endpoint. Ingress authorization rules act as firewall rules that grant access to networks. You must configure ingress authorization rules to enable clients to access resources in AWS or on-premises networks.
See also: AWS API Documentation
Request Syntax
response = client.authorize_client_vpn_ingress(
ClientVpnEndpointId='string',
TargetNetworkCidr='string',
AccessGroupId='string',
AuthorizeAllGroups=True|False,
Description='string',
ClientToken='string',
DryRun=True|False
)
[REQUIRED]
The ID of the Client VPN endpoint.
[REQUIRED]
The IPv4 address range, in CIDR notation, of the network for which access is being authorized.
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency .
This field is autopopulated if not provided.
dict
Response Syntax
{
'Status': {
'Code': 'authorizing'|'active'|'failed'|'revoking',
'Message': 'string'
}
}
Response Structure
(dict) --
Status (dict) --
The current state of the authorization rule.
Code (string) --
The state of the authorization rule.
Message (string) --
A message about the status of the authorization rule, if applicable.
[VPC only] Adds the specified egress rules to a security group for use with a VPC.
An outbound rule permits instances to send traffic to the specified IPv4 or IPv6 CIDR address ranges, or to the instances associated with the specified destination security groups.
You specify a protocol for each rule (for example, TCP). For the TCP and UDP protocols, you must also specify the destination port or port range. For the ICMP protocol, you must also specify the ICMP type and code. You can use -1 for the type or code to mean all types or all codes.
Rule changes are propagated to affected instances as quickly as possible. However, a small delay might occur.
For more information about VPC security group limits, see Amazon VPC Limits .
See also: AWS API Documentation
Request Syntax
response = client.authorize_security_group_egress(
DryRun=True|False,
GroupId='string',
IpPermissions=[
{
'FromPort': 123,
'IpProtocol': 'string',
'IpRanges': [
{
'CidrIp': 'string',
'Description': 'string'
},
],
'Ipv6Ranges': [
{
'CidrIpv6': 'string',
'Description': 'string'
},
],
'PrefixListIds': [
{
'Description': 'string',
'PrefixListId': 'string'
},
],
'ToPort': 123,
'UserIdGroupPairs': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'PeeringStatus': 'string',
'UserId': 'string',
'VpcId': 'string',
'VpcPeeringConnectionId': 'string'
},
]
},
],
CidrIp='string',
FromPort=123,
IpProtocol='string',
ToPort=123,
SourceSecurityGroupName='string',
SourceSecurityGroupOwnerId='string'
)
[REQUIRED]
The ID of the security group.
The sets of IP permissions. You can't specify a destination security group and a CIDR IP address range in the same set of permissions.
Describes a set of permissions for a security group rule.
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The IP protocol name (tcp , udp , icmp , icmpv6 ) or number (see Protocol Numbers ).
[VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp , udp , icmp , or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp , udp , and icmp , you must specify a port range. For icmpv6 , the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
The IPv4 ranges.
Describes an IPv4 range.
The IPv4 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv4 address, use the /32 prefix length.
A description for the security group rule that references this IPv4 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The IPv6 ranges.
[EC2-VPC only] Describes an IPv6 range.
The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv6 address, use the /128 prefix length.
A description for the security group rule that references this IPv6 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The prefix list IDs for an AWS service. With outbound rules, this is the AWS service to access through a VPC endpoint from instances associated with the security group.
Describes a prefix list ID.
A description for the security group rule that references this prefix list ID.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the prefix.
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The security group and AWS account ID pairs.
Describes a security group and AWS account ID pair.
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the security group.
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
The status of a VPC peering connection, if applicable.
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
The ID of the VPC for the referenced security group, if applicable.
The ID of the VPC peering connection, if applicable.
None
Adds the specified ingress rules to a security group.
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 CIDR address ranges, or from the instances associated with the specified destination security groups.
You specify a protocol for each rule (for example, TCP). For TCP and UDP, you must also specify the destination port or port range. For ICMP/ICMPv6, you must also specify the ICMP/ICMPv6 type and code. You can use -1 to mean all types or all codes.
Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay might occur.
For more information about VPC security group limits, see Amazon VPC Limits .
See also: AWS API Documentation
Request Syntax
response = client.authorize_security_group_ingress(
CidrIp='string',
FromPort=123,
GroupId='string',
GroupName='string',
IpPermissions=[
{
'FromPort': 123,
'IpProtocol': 'string',
'IpRanges': [
{
'CidrIp': 'string',
'Description': 'string'
},
],
'Ipv6Ranges': [
{
'CidrIpv6': 'string',
'Description': 'string'
},
],
'PrefixListIds': [
{
'Description': 'string',
'PrefixListId': 'string'
},
],
'ToPort': 123,
'UserIdGroupPairs': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'PeeringStatus': 'string',
'UserId': 'string',
'VpcId': 'string',
'VpcPeeringConnectionId': 'string'
},
]
},
],
IpProtocol='string',
SourceSecurityGroupName='string',
SourceSecurityGroupOwnerId='string',
ToPort=123,
DryRun=True|False
)
The IPv4 address range, in CIDR format. You can't specify this parameter when specifying a source security group. To specify an IPv6 address range, use a set of IP permissions.
Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.
The start of port range for the TCP and UDP protocols, or an ICMP type number. For the ICMP type number, use -1 to specify all types. If you specify all ICMP types, you must specify all codes.
Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.
The sets of IP permissions.
Describes a set of permissions for a security group rule.
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The IP protocol name (tcp , udp , icmp , icmpv6 ) or number (see Protocol Numbers ).
[VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp , udp , icmp , or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp , udp , and icmp , you must specify a port range. For icmpv6 , the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
The IPv4 ranges.
Describes an IPv4 range.
The IPv4 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv4 address, use the /32 prefix length.
A description for the security group rule that references this IPv4 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The IPv6 ranges.
[EC2-VPC only] Describes an IPv6 range.
The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv6 address, use the /128 prefix length.
A description for the security group rule that references this IPv6 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The prefix list IDs for an AWS service. With outbound rules, this is the AWS service to access through a VPC endpoint from instances associated with the security group.
Describes a prefix list ID.
A description for the security group rule that references this prefix list ID.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the prefix.
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The security group and AWS account ID pairs.
Describes a security group and AWS account ID pair.
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the security group.
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
The status of a VPC peering connection, if applicable.
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
The ID of the VPC for the referenced security group, if applicable.
The ID of the VPC peering connection, if applicable.
The IP protocol name (tcp , udp , icmp ) or number (see Protocol Numbers ). To specify icmpv6 , use a set of IP permissions.
[VPC only] Use -1 to specify all protocols. If you specify -1 or a protocol other than tcp , udp , or icmp , traffic on all ports is allowed, regardless of any ports you specify.
Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.
The end of port range for the TCP and UDP protocols, or an ICMP code number. For the ICMP code number, use -1 to specify all codes. If you specify all ICMP types, you must specify all codes.
Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.
None
Bundles an Amazon instance store-backed Windows instance.
During bundling, only the root device volume (C:) is bundled. Data on other instance store volumes is not preserved.
Note
This action is not applicable for Linux/Unix instances or Windows instances that are backed by Amazon EBS.
See also: AWS API Documentation
Request Syntax
response = client.bundle_instance(
InstanceId='string',
Storage={
'S3': {
'AWSAccessKeyId': 'string',
'Bucket': 'string',
'Prefix': 'string',
'UploadPolicy': b'bytes',
'UploadPolicySignature': 'string'
}
},
DryRun=True|False
)
[REQUIRED]
The ID of the instance to bundle.
Type: String
Default: None
Required: Yes
[REQUIRED]
The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.
An Amazon S3 storage location.
The access key ID of the owner of the bucket. Before you specify a value for your access key ID, review and follow the guidance in Best Practices for Managing AWS Access Keys .
The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.
The beginning of the file name of the AMI.
An Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.
The signature of the JSON document.
dict
Response Syntax
{
'BundleTask': {
'BundleId': 'string',
'BundleTaskError': {
'Code': 'string',
'Message': 'string'
},
'InstanceId': 'string',
'Progress': 'string',
'StartTime': datetime(2015, 1, 1),
'State': 'pending'|'waiting-for-shutdown'|'bundling'|'storing'|'cancelling'|'complete'|'failed',
'Storage': {
'S3': {
'AWSAccessKeyId': 'string',
'Bucket': 'string',
'Prefix': 'string',
'UploadPolicy': b'bytes',
'UploadPolicySignature': 'string'
}
},
'UpdateTime': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
Contains the output of BundleInstance.
BundleTask (dict) --
Information about the bundle task.
BundleId (string) --
The ID of the bundle task.
BundleTaskError (dict) --
If the task fails, a description of the error.
Code (string) --
The error code.
Message (string) --
The error message.
InstanceId (string) --
The ID of the instance associated with this bundle task.
Progress (string) --
The level of task completion, as a percent (for example, 20%).
StartTime (datetime) --
The time this task started.
State (string) --
The state of the task.
Storage (dict) --
The Amazon S3 storage locations.
S3 (dict) --
An Amazon S3 storage location.
AWSAccessKeyId (string) --
The access key ID of the owner of the bucket. Before you specify a value for your access key ID, review and follow the guidance in Best Practices for Managing AWS Access Keys .
Bucket (string) --
The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.
Prefix (string) --
The beginning of the file name of the AMI.
UploadPolicy (bytes) --
An Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.
UploadPolicySignature (string) --
The signature of the JSON document.
UpdateTime (datetime) --
The time of the most recent update for the task.
Check if an operation can be paginated.
Cancels a bundling operation for an instance store-backed Windows instance.
See also: AWS API Documentation
Request Syntax
response = client.cancel_bundle_task(
BundleId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the bundle task.
dict
Response Syntax
{
'BundleTask': {
'BundleId': 'string',
'BundleTaskError': {
'Code': 'string',
'Message': 'string'
},
'InstanceId': 'string',
'Progress': 'string',
'StartTime': datetime(2015, 1, 1),
'State': 'pending'|'waiting-for-shutdown'|'bundling'|'storing'|'cancelling'|'complete'|'failed',
'Storage': {
'S3': {
'AWSAccessKeyId': 'string',
'Bucket': 'string',
'Prefix': 'string',
'UploadPolicy': b'bytes',
'UploadPolicySignature': 'string'
}
},
'UpdateTime': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
Contains the output of CancelBundleTask.
BundleTask (dict) --
Information about the bundle task.
BundleId (string) --
The ID of the bundle task.
BundleTaskError (dict) --
If the task fails, a description of the error.
Code (string) --
The error code.
Message (string) --
The error message.
InstanceId (string) --
The ID of the instance associated with this bundle task.
Progress (string) --
The level of task completion, as a percent (for example, 20%).
StartTime (datetime) --
The time this task started.
State (string) --
The state of the task.
Storage (dict) --
The Amazon S3 storage locations.
S3 (dict) --
An Amazon S3 storage location.
AWSAccessKeyId (string) --
The access key ID of the owner of the bucket. Before you specify a value for your access key ID, review and follow the guidance in Best Practices for Managing AWS Access Keys .
Bucket (string) --
The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.
Prefix (string) --
The beginning of the file name of the AMI.
UploadPolicy (bytes) --
An Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.
UploadPolicySignature (string) --
The signature of the JSON document.
UpdateTime (datetime) --
The time of the most recent update for the task.
Cancels the specified Capacity Reservation, releases the reserved capacity, and changes the Capacity Reservation's state to cancelled .
Instances running in the reserved capacity continue running until you stop them. Stopped instances that target the Capacity Reservation can no longer launch. Modify these instances to either target a different Capacity Reservation, launch On-Demand Instance capacity, or run in any open Capacity Reservation that has matching attributes and sufficient capacity.
See also: AWS API Documentation
Request Syntax
response = client.cancel_capacity_reservation(
CapacityReservationId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the Capacity Reservation to be cancelled.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Cancels an active conversion task. The task can be the import of an instance or volume. The action removes all artifacts of the conversion, including a partially uploaded volume or instance. If the conversion is complete or is in the process of transferring the final disk image, the command fails and returns an exception.
For more information, see Importing a Virtual Machine Using the Amazon EC2 CLI .
See also: AWS API Documentation
Request Syntax
response = client.cancel_conversion_task(
ConversionTaskId='string',
DryRun=True|False,
ReasonMessage='string'
)
[REQUIRED]
The ID of the conversion task.
None
Cancels an active export task. The request removes all artifacts of the export, including any partially-created Amazon S3 objects. If the export task is complete or is in the process of transferring the final disk image, the command fails and returns an error.
See also: AWS API Documentation
Request Syntax
response = client.cancel_export_task(
ExportTaskId='string'
)
[REQUIRED]
The ID of the export task. This is the ID returned by CreateInstanceExportTask .
Cancels an in-process import virtual machine or import snapshot task.
See also: AWS API Documentation
Request Syntax
response = client.cancel_import_task(
CancelReason='string',
DryRun=True|False,
ImportTaskId='string'
)
dict
Response Syntax
{
'ImportTaskId': 'string',
'PreviousState': 'string',
'State': 'string'
}
Response Structure
(dict) --
ImportTaskId (string) --
The ID of the task being canceled.
PreviousState (string) --
The current state of the task being canceled.
State (string) --
The current state of the task being canceled.
Cancels the specified Reserved Instance listing in the Reserved Instance Marketplace.
For more information, see Reserved Instance Marketplace in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.cancel_reserved_instances_listing(
ReservedInstancesListingId='string'
)
[REQUIRED]
The ID of the Reserved Instance listing.
{
'ReservedInstancesListings': [
{
'ClientToken': 'string',
'CreateDate': datetime(2015, 1, 1),
'InstanceCounts': [
{
'InstanceCount': 123,
'State': 'available'|'sold'|'cancelled'|'pending'
},
],
'PriceSchedules': [
{
'Active': True|False,
'CurrencyCode': 'USD',
'Price': 123.0,
'Term': 123
},
],
'ReservedInstancesId': 'string',
'ReservedInstancesListingId': 'string',
'Status': 'active'|'pending'|'cancelled'|'closed',
'StatusMessage': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'UpdateDate': datetime(2015, 1, 1)
},
]
}
Response Structure
Contains the output of CancelReservedInstancesListing.
The Reserved Instance listing.
Describes a Reserved Instance listing.
A unique, case-sensitive key supplied by the client to ensure that the request is idempotent. For more information, see Ensuring Idempotency .
The time the listing was created.
The number of instances in this state.
Describes a Reserved Instance listing state.
The number of listed Reserved Instances in the state specified by the state .
The states of the listed Reserved Instances.
The price of the Reserved Instance listing.
Describes the price for a Reserved Instance.
The current price schedule, as determined by the term remaining for the Reserved Instance in the listing.
A specific price schedule is always in effect, but only one price schedule can be active at any time. Take, for example, a Reserved Instance listing that has five months remaining in its term. When you specify price schedules for five months and two months, this means that schedule 1, covering the first three months of the remaining term, will be active during months 5, 4, and 3. Then schedule 2, covering the last two months of the term, will be active for months 2 and 1.
The currency for transacting the Reserved Instance resale. At this time, the only supported currency is USD .
The fixed price for the term.
The number of months remaining in the reservation. For example, 2 is the second to the last month before the capacity reservation expires.
The ID of the Reserved Instance.
The ID of the Reserved Instance listing.
The status of the Reserved Instance listing.
The reason for the current status of the Reserved Instance listing. The response can be blank.
Any tags assigned to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
The last modified timestamp of the listing.
Cancels the specified Spot Fleet requests.
After you cancel a Spot Fleet request, the Spot Fleet launches no new Spot Instances. You must specify whether the Spot Fleet should also terminate its Spot Instances. If you terminate the instances, the Spot Fleet request enters the cancelled_terminating state. Otherwise, the Spot Fleet request enters the cancelled_running state and the instances continue to run until they are interrupted or you terminate them manually.
See also: AWS API Documentation
Request Syntax
response = client.cancel_spot_fleet_requests(
DryRun=True|False,
SpotFleetRequestIds=[
'string',
],
TerminateInstances=True|False
)
[REQUIRED]
The IDs of the Spot Fleet requests.
[REQUIRED]
Indicates whether to terminate instances for a Spot Fleet request if it is canceled successfully.
dict
Response Syntax
{
'SuccessfulFleetRequests': [
{
'CurrentSpotFleetRequestState': 'submitted'|'active'|'cancelled'|'failed'|'cancelled_running'|'cancelled_terminating'|'modifying',
'PreviousSpotFleetRequestState': 'submitted'|'active'|'cancelled'|'failed'|'cancelled_running'|'cancelled_terminating'|'modifying',
'SpotFleetRequestId': 'string'
},
],
'UnsuccessfulFleetRequests': [
{
'Error': {
'Code': 'fleetRequestIdDoesNotExist'|'fleetRequestIdMalformed'|'fleetRequestNotInCancellableState'|'unexpectedError',
'Message': 'string'
},
'SpotFleetRequestId': 'string'
},
]
}
Response Structure
(dict) --
Contains the output of CancelSpotFleetRequests.
SuccessfulFleetRequests (list) --
Information about the Spot Fleet requests that are successfully canceled.
(dict) --
Describes a Spot Fleet request that was successfully canceled.
CurrentSpotFleetRequestState (string) --
The current state of the Spot Fleet request.
PreviousSpotFleetRequestState (string) --
The previous state of the Spot Fleet request.
SpotFleetRequestId (string) --
The ID of the Spot Fleet request.
UnsuccessfulFleetRequests (list) --
Information about the Spot Fleet requests that are not successfully canceled.
(dict) --
Describes a Spot Fleet request that was not successfully canceled.
Error (dict) --
The error.
Code (string) --
The error code.
Message (string) --
The description for the error code.
SpotFleetRequestId (string) --
The ID of the Spot Fleet request.
Examples
This example cancels the specified Spot fleet request and terminates its associated Spot Instances.
response = client.cancel_spot_fleet_requests(
SpotFleetRequestIds=[
'sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE',
],
TerminateInstances=True,
)
print(response)
Expected Output:
{
'SuccessfulFleetRequests': [
{
'CurrentSpotFleetRequestState': 'cancelled_running',
'PreviousSpotFleetRequestState': 'active',
'SpotFleetRequestId': 'sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE',
},
],
'ResponseMetadata': {
'...': '...',
},
}
This example cancels the specified Spot fleet request without terminating its associated Spot Instances.
response = client.cancel_spot_fleet_requests(
SpotFleetRequestIds=[
'sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE',
],
TerminateInstances=False,
)
print(response)
Expected Output:
{
'SuccessfulFleetRequests': [
{
'CurrentSpotFleetRequestState': 'cancelled_terminating',
'PreviousSpotFleetRequestState': 'active',
'SpotFleetRequestId': 'sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Cancels one or more Spot Instance requests.
Warning
Canceling a Spot Instance request does not terminate running Spot Instances associated with the request.
See also: AWS API Documentation
Request Syntax
response = client.cancel_spot_instance_requests(
DryRun=True|False,
SpotInstanceRequestIds=[
'string',
]
)
[REQUIRED]
One or more Spot Instance request IDs.
dict
Response Syntax
{
'CancelledSpotInstanceRequests': [
{
'SpotInstanceRequestId': 'string',
'State': 'active'|'open'|'closed'|'cancelled'|'completed'
},
]
}
Response Structure
(dict) --
Contains the output of CancelSpotInstanceRequests.
CancelledSpotInstanceRequests (list) --
One or more Spot Instance requests.
(dict) --
Describes a request to cancel a Spot Instance.
SpotInstanceRequestId (string) --
The ID of the Spot Instance request.
State (string) --
The state of the Spot Instance request.
Examples
This example cancels a Spot Instance request.
response = client.cancel_spot_instance_requests(
SpotInstanceRequestIds=[
'sir-08b93456',
],
)
print(response)
Expected Output:
{
'CancelledSpotInstanceRequests': [
{
'SpotInstanceRequestId': 'sir-08b93456',
'State': 'cancelled',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Determines whether a product code is associated with an instance. This action can only be used by the owner of the product code. It is useful when a product code owner must verify whether another user's instance is eligible for support.
See also: AWS API Documentation
Request Syntax
response = client.confirm_product_instance(
InstanceId='string',
ProductCode='string',
DryRun=True|False
)
[REQUIRED]
The ID of the instance.
[REQUIRED]
The product code. This must be a product code that you own.
dict
Response Syntax
{
'OwnerId': 'string',
'Return': True|False
}
Response Structure
(dict) --
OwnerId (string) --
The AWS account ID of the instance owner. This is only present if the product code is attached to the instance.
Return (boolean) --
The return value of the request. Returns true if the specified product code is owned by the requester and associated with the specified instance.
Examples
This example determines whether the specified product code is associated with the specified instance.
response = client.confirm_product_instance(
InstanceId='i-1234567890abcdef0',
ProductCode='774F4FF8',
)
print(response)
Expected Output:
{
'OwnerId': '123456789012',
'ResponseMetadata': {
'...': '...',
},
}
Copies the specified Amazon FPGA Image (AFI) to the current Region.
See also: AWS API Documentation
Request Syntax
response = client.copy_fpga_image(
DryRun=True|False,
SourceFpgaImageId='string',
Description='string',
Name='string',
SourceRegion='string',
ClientToken='string'
)
[REQUIRED]
The ID of the source AFI.
[REQUIRED]
The Region that contains the source AFI.
dict
Response Syntax
{
'FpgaImageId': 'string'
}
Response Structure
(dict) --
FpgaImageId (string) --
The ID of the new AFI.
Initiates the copy of an AMI from the specified source Region to the current Region. You specify the destination Region by using its endpoint when making the request.
Copies of encrypted backing snapshots for the AMI are encrypted. Copies of unencrypted backing snapshots remain unencrypted, unless you set Encrypted during the copy operation. You cannot create an unencrypted copy of an encrypted backing snapshot.
For more information about the prerequisites and limits when copying an AMI, see Copying an AMI in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.copy_image(
ClientToken='string',
Description='string',
Encrypted=True|False,
KmsKeyId='string',
Name='string',
SourceImageId='string',
SourceRegion='string',
DryRun=True|False
)
An identifier for the AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted volume. This parameter is only required if you want to use a non-default CMK; if this parameter is not specified, the default CMK for EBS is used. If a KmsKeyId is specified, the Encrypted flag must also be set.
To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. When using an alias name, prefix it with "alias/". For example:
AWS parses KmsKeyId asynchronously, meaning that the action you call may appear to complete even though you provided an invalid identifier. This action will eventually report failure.
The specified CMK must exist in the Region that the snapshot is being copied to.
[REQUIRED]
The name of the new AMI in the destination Region.
[REQUIRED]
The ID of the AMI to copy.
[REQUIRED]
The name of the Region that contains the AMI to copy.
dict
Response Syntax
{
'ImageId': 'string'
}
Response Structure
(dict) --
Contains the output of CopyImage.
ImageId (string) --
The ID of the new AMI.
Copies a point-in-time snapshot of an EBS volume and stores it in Amazon S3. You can copy the snapshot within the same Region or from one Region to another. You can use the snapshot to create EBS volumes or Amazon Machine Images (AMIs).
Copies of encrypted EBS snapshots remain encrypted. Copies of unencrypted snapshots remain unencrypted, unless you enable encryption for the snapshot copy operation. By default, encrypted snapshot copies use the default AWS Key Management Service (AWS KMS) customer master key (CMK); however, you can specify a different CMK.
To copy an encrypted snapshot that has been shared from another account, you must have permissions for the CMK used to encrypt the snapshot.
Snapshots created by copying another snapshot have an arbitrary volume ID that should not be used for any purpose.
For more information, see Copying an Amazon EBS Snapshot in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.copy_snapshot(
Description='string',
Encrypted=True|False,
KmsKeyId='string',
SourceRegion='string',
SourceSnapshotId='string',
DryRun=True|False
)
The destination Region to use in the PresignedUrl parameter of a snapshot copy operation. This parameter is only valid for specifying the destination Region in a PresignedUrl parameter, where it is required.
The snapshot copy is sent to the regional endpoint that you sent the HTTP request to (for example, ec2.us-east-1.amazonaws.com ). With the AWS CLI, this is specified using the --region parameter or the default Region in your AWS configuration file.
Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required
The identifier of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use for Amazon EBS encryption. If this parameter is not specified, your AWS managed CMK for EBS is used. If KmsKeyId is specified, the encrypted state must be true .
You can specify the CMK using any of the following:
AWS authenticates the CMK asynchronously. Therefore, if you specify an ID, alias, or ARN that is not valid, the action can appear to complete, but eventually fails.
When you copy an encrypted source snapshot using the Amazon EC2 Query API, you must supply a pre-signed URL. This parameter is optional for unencrypted snapshots. For more information, see Query Requests .
The PresignedUrl should use the snapshot source endpoint, the CopySnapshot action, and include the SourceRegion , SourceSnapshotId , and DestinationRegion parameters. The PresignedUrl must be signed using AWS Signature Version 4. Because EBS snapshots are stored in Amazon S3, the signing algorithm for this parameter uses the same logic that is described in Authenticating Requests by Using Query Parameters (AWS Signature Version 4) in the Amazon Simple Storage Service API Reference . An invalid or improperly signed PresignedUrl will cause the copy operation to fail asynchronously, and the snapshot will move to an error state.
Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required
[REQUIRED]
The ID of the Region that contains the snapshot to be copied.
[REQUIRED]
The ID of the EBS snapshot to copy.
dict
Response Syntax
{
'SnapshotId': 'string'
}
Response Structure
(dict) --
Contains the output of CopySnapshot.
SnapshotId (string) --
The ID of the new snapshot.
Examples
This example copies a snapshot with the snapshot ID of snap-066877671789bd71b from the us-west-2 region to the us-east-1 region and adds a short description to identify the snapshot.
response = client.copy_snapshot(
Description='This is my copied snapshot.',
DestinationRegion='us-east-1',
SourceRegion='us-west-2',
SourceSnapshotId='snap-066877671789bd71b',
)
print(response)
Expected Output:
{
'SnapshotId': 'snap-066877671789bd71b',
'ResponseMetadata': {
'...': '...',
},
}
Creates a new Capacity Reservation with the specified attributes.
Capacity Reservations enable you to reserve capacity for your Amazon EC2 instances in a specific Availability Zone for any duration. This gives you the flexibility to selectively add capacity reservations and still get the Regional RI discounts for that usage. By creating Capacity Reservations, you ensure that you always have access to Amazon EC2 capacity when you need it, for as long as you need it. For more information, see Capacity Reservations in the Amazon Elastic Compute Cloud User Guide .
Your request to create a Capacity Reservation could fail if Amazon EC2 does not have sufficient capacity to fulfill the request. If your request fails due to Amazon EC2 capacity constraints, either try again at a later time, try in a different Availability Zone, or request a smaller capacity reservation. If your application is flexible across instance types and sizes, try to create a Capacity Reservation with different instance attributes.
Your request could also fail if the requested quantity exceeds your On-Demand Instance limit for the selected instance type. If your request fails due to limit constraints, increase your On-Demand Instance limit for the required instance type and try again. For more information about increasing your instance limits, see Amazon EC2 Service Limits in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_capacity_reservation(
ClientToken='string',
InstanceType='string',
InstancePlatform='Linux/UNIX'|'Red Hat Enterprise Linux'|'SUSE Linux'|'Windows'|'Windows with SQL Server'|'Windows with SQL Server Enterprise'|'Windows with SQL Server Standard'|'Windows with SQL Server Web'|'Linux with SQL Server Standard'|'Linux with SQL Server Web'|'Linux with SQL Server Enterprise',
AvailabilityZone='string',
Tenancy='default'|'dedicated',
InstanceCount=123,
EbsOptimized=True|False,
EphemeralStorage=True|False,
EndDate=datetime(2015, 1, 1),
EndDateType='unlimited'|'limited',
InstanceMatchCriteria='open'|'targeted',
TagSpecifications=[
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
DryRun=True|False
)
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency .
Constraint: Maximum 64 ASCII characters.
[REQUIRED]
The instance type for which to reserve capacity. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide .
[REQUIRED]
The type of operating system for which to reserve capacity.
[REQUIRED]
The Availability Zone in which to create the Capacity Reservation.
Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy settings:
[REQUIRED]
The number of instances for which to reserve capacity.
The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to expired when it reaches its end date and time.
You must provide an EndDate value if EndDateType is limited . Omit EndDate if EndDateType is unlimited .
If the EndDateType is limited , the Capacity Reservation is cancelled within an hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55 on 5/31/2019.
Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following end types:
Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
Default: open
The tags to apply to the Capacity Reservation during launch.
The tags to apply to a resource when the resource is being created.
The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
dict
Response Syntax
{
'CapacityReservation': {
'CapacityReservationId': 'string',
'InstanceType': 'string',
'InstancePlatform': 'Linux/UNIX'|'Red Hat Enterprise Linux'|'SUSE Linux'|'Windows'|'Windows with SQL Server'|'Windows with SQL Server Enterprise'|'Windows with SQL Server Standard'|'Windows with SQL Server Web'|'Linux with SQL Server Standard'|'Linux with SQL Server Web'|'Linux with SQL Server Enterprise',
'AvailabilityZone': 'string',
'Tenancy': 'default'|'dedicated',
'TotalInstanceCount': 123,
'AvailableInstanceCount': 123,
'EbsOptimized': True|False,
'EphemeralStorage': True|False,
'State': 'active'|'expired'|'cancelled'|'pending'|'failed',
'EndDate': datetime(2015, 1, 1),
'EndDateType': 'unlimited'|'limited',
'InstanceMatchCriteria': 'open'|'targeted',
'CreateDate': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
CapacityReservation (dict) --
Information about the Capacity Reservation.
CapacityReservationId (string) --
The ID of the Capacity Reservation.
InstanceType (string) --
The type of instance for which the Capacity Reservation reserves capacity.
InstancePlatform (string) --
The type of operating system for which the Capacity Reservation reserves capacity.
AvailabilityZone (string) --
The Availability Zone in which the capacity is reserved.
Tenancy (string) --
Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy settings:
TotalInstanceCount (integer) --
The number of instances for which the Capacity Reservation reserves capacity.
AvailableInstanceCount (integer) --
The remaining capacity. Indicates the number of instances that can be launched in the Capacity Reservation.
EbsOptimized (boolean) --
Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized instance.
EphemeralStorage (boolean) --
Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.
State (string) --
The current state of the Capacity Reservation. A Capacity Reservation can be in one of the following states:
EndDate (datetime) --
The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to expired when it reaches its end date and time.
EndDateType (string) --
Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following end types:
InstanceMatchCriteria (string) --
Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
CreateDate (datetime) --
The date and time at which the Capacity Reservation was created.
Tags (list) --
Any tags assigned to the Capacity Reservation.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Creates a Client VPN endpoint. A Client VPN endpoint is the resource you create and configure to enable and manage client VPN sessions. It is the destination endpoint at which all client VPN sessions are terminated.
See also: AWS API Documentation
Request Syntax
response = client.create_client_vpn_endpoint(
ClientCidrBlock='string',
ServerCertificateArn='string',
AuthenticationOptions=[
{
'Type': 'certificate-authentication'|'directory-service-authentication',
'ActiveDirectory': {
'DirectoryId': 'string'
},
'MutualAuthentication': {
'ClientRootCertificateChainArn': 'string'
}
},
],
ConnectionLogOptions={
'Enabled': True|False,
'CloudwatchLogGroup': 'string',
'CloudwatchLogStream': 'string'
},
DnsServers=[
'string',
],
TransportProtocol='tcp'|'udp',
Description='string',
DryRun=True|False,
ClientToken='string',
TagSpecifications=[
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
]
)
[REQUIRED]
The IPv4 address range, in CIDR notation, from which to assign client IP addresses. The address range cannot overlap with the local CIDR of the VPC in which the associated subnet is located, or the routes that you add manually. The address range cannot be changed after the Client VPN endpoint has been created. The CIDR block should be /22 or greater.
[REQUIRED]
The ARN of the server certificate. For more information, see the AWS Certificate Manager User Guide .
[REQUIRED]
Information about the authentication method to be used to authenticate clients.
Describes the authentication method to be used by a Client VPN endpoint. Client VPN supports Active Directory and mutual authentication. For more information, see Authentication in the AWS Client VPN Administrator Guide .
The type of client authentication to be used. Specify certificate-authentication to use certificate-based authentication, or directory-service-authentication to use Active Directory authentication.
Information about the Active Directory to be used, if applicable. You must provide this information if Type is directory-service-authentication .
The ID of the Active Directory to be used for authentication.
Information about the authentication certificates to be used, if applicable. You must provide this information if Type is certificate-authentication .
The ARN of the client certificate. The certificate must be signed by a certificate authority (CA) and it must be provisioned in AWS Certificate Manager (ACM).
[REQUIRED]
Information about the client connection logging options.
If you enable client connection logging, data about client connections is sent to a Cloudwatch Logs log stream. The following information is logged:
Indicates whether connection logging is enabled.
The name of the CloudWatch Logs log group.
The name of the CloudWatch Logs log stream to which the connection data is published.
Information about the DNS servers to be used for DNS resolution. A Client VPN endpoint can have up to two DNS servers. If no DNS server is specified, the DNS address of the VPC that is to be associated with Client VPN endpoint is used as the DNS server.
The transport protocol to be used by the VPN session.
Default value: udp
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency .
This field is autopopulated if not provided.
The tags to apply to the Client VPN endpoint during creation.
The tags to apply to a resource when the resource is being created.
The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
dict
Response Syntax
{
'ClientVpnEndpointId': 'string',
'Status': {
'Code': 'pending-associate'|'available'|'deleting'|'deleted',
'Message': 'string'
},
'DnsName': 'string'
}
Response Structure
(dict) --
ClientVpnEndpointId (string) --
The ID of the Client VPN endpoint.
Status (dict) --
The current state of the Client VPN endpoint.
Code (string) --
The state of the Client VPN endpoint. Possible states include:
Message (string) --
A message about the status of the Client VPN endpoint.
DnsName (string) --
The DNS name to be used by clients when establishing their VPN session.
Adds a route to a network to a Client VPN endpoint. Each Client VPN endpoint has a route table that describes the available destination network routes. Each route in the route table specifies the path for traffic to specific resources or networks.
See also: AWS API Documentation
Request Syntax
response = client.create_client_vpn_route(
ClientVpnEndpointId='string',
DestinationCidrBlock='string',
TargetVpcSubnetId='string',
Description='string',
ClientToken='string',
DryRun=True|False
)
[REQUIRED]
The ID of the Client VPN endpoint to which to add the route.
[REQUIRED]
The IPv4 address range, in CIDR notation, of the route destination. For example:
Route address ranges cannot overlap with the CIDR range specified for client allocation.
[REQUIRED]
The ID of the subnet through which you want to route traffic. The specified subnet must be an existing target network of the Client VPN endpoint.
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency .
This field is autopopulated if not provided.
dict
Response Syntax
{
'Status': {
'Code': 'creating'|'active'|'failed'|'deleting',
'Message': 'string'
}
}
Response Structure
(dict) --
Status (dict) --
The current state of the route.
Code (string) --
The state of the Client VPN endpoint route.
Message (string) --
A message about the status of the Client VPN endpoint route, if applicable.
Provides information to AWS about your VPN customer gateway device. The customer gateway is the appliance at your end of the VPN connection. (The device on the AWS side of the VPN connection is the virtual private gateway.) You must provide the Internet-routable IP address of the customer gateway's external interface. The IP address must be static and may be behind a device performing network address translation (NAT).
For devices that use Border Gateway Protocol (BGP), you can also provide the device's BGP Autonomous System Number (ASN). You can use an existing ASN assigned to your network. If you don't have an ASN already, you can use a private ASN (in the 64512 - 65534 range).
Note
Amazon EC2 supports all 2-byte ASN numbers in the range of 1 - 65534, with the exception of 7224, which is reserved in the us-east-1 Region, and 9059, which is reserved in the eu-west-1 Region.
For more information, see AWS Site-to-Site VPN in the AWS Site-to-Site VPN User Guide .
Warning
You cannot create more than one customer gateway with the same VPN type, IP address, and BGP ASN parameter values. If you run an identical request more than one time, the first request creates the customer gateway, and subsequent requests return information about the existing customer gateway. The subsequent requests do not create new customer gateway resources.
See also: AWS API Documentation
Request Syntax
response = client.create_customer_gateway(
BgpAsn=123,
PublicIp='string',
Type='ipsec.1',
DryRun=True|False
)
[REQUIRED]
For devices that support BGP, the customer gateway's BGP ASN.
Default: 65000
[REQUIRED]
The Internet-routable IP address for the customer gateway's outside interface. The address must be static.
[REQUIRED]
The type of VPN connection that this customer gateway supports (ipsec.1 ).
dict
Response Syntax
{
'CustomerGateway': {
'BgpAsn': 'string',
'CustomerGatewayId': 'string',
'IpAddress': 'string',
'State': 'string',
'Type': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
Contains the output of CreateCustomerGateway.
CustomerGateway (dict) --
Information about the customer gateway.
BgpAsn (string) --
The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
CustomerGatewayId (string) --
The ID of the customer gateway.
IpAddress (string) --
The Internet-routable IP address of the customer gateway's outside interface.
State (string) --
The current state of the customer gateway (pending | available | deleting | deleted ).
Type (string) --
The type of VPN connection the customer gateway supports (ipsec.1 ).
Tags (list) --
Any tags assigned to the customer gateway.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Examples
This example creates a customer gateway with the specified IP address for its outside interface.
response = client.create_customer_gateway(
BgpAsn=65534,
PublicIp='12.1.2.3',
Type='ipsec.1',
)
print(response)
Expected Output:
{
'CustomerGateway': {
'BgpAsn': '65534',
'CustomerGatewayId': 'cgw-0e11f167',
'IpAddress': '12.1.2.3',
'State': 'available',
'Type': 'ipsec.1',
},
'ResponseMetadata': {
'...': '...',
},
}
Creates a default subnet with a size /20 IPv4 CIDR block in the specified Availability Zone in your default VPC. You can have only one default subnet per Availability Zone. For more information, see Creating a Default Subnet in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_default_subnet(
AvailabilityZone='string',
DryRun=True|False
)
[REQUIRED]
The Availability Zone in which to create the default subnet.
dict
Response Syntax
{
'Subnet': {
'AvailabilityZone': 'string',
'AvailabilityZoneId': 'string',
'AvailableIpAddressCount': 123,
'CidrBlock': 'string',
'DefaultForAz': True|False,
'MapPublicIpOnLaunch': True|False,
'State': 'pending'|'available',
'SubnetId': 'string',
'VpcId': 'string',
'OwnerId': 'string',
'AssignIpv6AddressOnCreation': True|False,
'Ipv6CidrBlockAssociationSet': [
{
'AssociationId': 'string',
'Ipv6CidrBlock': 'string',
'Ipv6CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
}
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'SubnetArn': 'string'
}
}
Response Structure
(dict) --
Subnet (dict) --
Information about the subnet.
AvailabilityZone (string) --
The Availability Zone of the subnet.
AvailabilityZoneId (string) --
The AZ ID of the subnet.
AvailableIpAddressCount (integer) --
The number of unused private IPv4 addresses in the subnet. The IPv4 addresses for any stopped instances are considered unavailable.
CidrBlock (string) --
The IPv4 CIDR block assigned to the subnet.
DefaultForAz (boolean) --
Indicates whether this is the default subnet for the Availability Zone.
MapPublicIpOnLaunch (boolean) --
Indicates whether instances launched in this subnet receive a public IPv4 address.
State (string) --
The current state of the subnet.
SubnetId (string) --
The ID of the subnet.
VpcId (string) --
The ID of the VPC the subnet is in.
OwnerId (string) --
The ID of the AWS account that owns the subnet.
AssignIpv6AddressOnCreation (boolean) --
Indicates whether a network interface created in this subnet (including a network interface created by RunInstances ) receives an IPv6 address.
Ipv6CidrBlockAssociationSet (list) --
Information about the IPv6 CIDR blocks associated with the subnet.
(dict) --
Describes an IPv6 CIDR block associated with a subnet.
AssociationId (string) --
The association ID for the CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
Ipv6CidrBlockState (dict) --
Information about the state of the CIDR block.
State (string) --
The state of a CIDR block.
StatusMessage (string) --
A message about the status of the CIDR block, if applicable.
Tags (list) --
Any tags assigned to the subnet.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
SubnetArn (string) --
The Amazon Resource Name (ARN) of the subnet.
Creates a default VPC with a size /16 IPv4 CIDR block and a default subnet in each Availability Zone. For more information about the components of a default VPC, see Default VPC and Default Subnets in the Amazon Virtual Private Cloud User Guide . You cannot specify the components of the default VPC yourself.
If you deleted your previous default VPC, you can create a default VPC. You cannot have more than one default VPC per Region.
If your account supports EC2-Classic, you cannot use this action to create a default VPC in a Region that supports EC2-Classic. If you want a default VPC in a Region that supports EC2-Classic, see "I really want a default VPC for my existing EC2 account. Is that possible?" in the Default VPCs FAQ .
See also: AWS API Documentation
Request Syntax
response = client.create_default_vpc(
DryRun=True|False
)
{
'Vpc': {
'CidrBlock': 'string',
'DhcpOptionsId': 'string',
'State': 'pending'|'available',
'VpcId': 'string',
'OwnerId': 'string',
'InstanceTenancy': 'default'|'dedicated'|'host',
'Ipv6CidrBlockAssociationSet': [
{
'AssociationId': 'string',
'Ipv6CidrBlock': 'string',
'Ipv6CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
}
},
],
'CidrBlockAssociationSet': [
{
'AssociationId': 'string',
'CidrBlock': 'string',
'CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
}
},
],
'IsDefault': True|False,
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
Information about the VPC.
The primary IPv4 CIDR block for the VPC.
The ID of the set of DHCP options you've associated with the VPC (or default if the default options are associated with the VPC).
The current state of the VPC.
The ID of the VPC.
The ID of the AWS account that owns the VPC.
The allowed tenancy of instances launched into the VPC.
Information about the IPv6 CIDR blocks associated with the VPC.
Describes an IPv6 CIDR block associated with a VPC.
The association ID for the IPv6 CIDR block.
The IPv6 CIDR block.
Information about the state of the CIDR block.
The state of the CIDR block.
A message about the status of the CIDR block, if applicable.
Information about the IPv4 CIDR blocks associated with the VPC.
Describes an IPv4 CIDR block associated with a VPC.
The association ID for the IPv4 CIDR block.
The IPv4 CIDR block.
Information about the state of the CIDR block.
The state of the CIDR block.
A message about the status of the CIDR block, if applicable.
Indicates whether the VPC is the default VPC.
Any tags assigned to the VPC.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Creates a set of DHCP options for your VPC. After creating the set, you must associate it with the VPC, causing all existing and new instances that you launch in the VPC to use this set of DHCP options. The following are the individual DHCP options you can specify. For more information about the options, see RFC 2132 .
Your VPC automatically starts out with a set of DHCP options that includes only a DNS server that we provide (AmazonProvidedDNS). If you create a set of options, and if your VPC has an internet gateway, make sure to set the domain-name-servers option either to AmazonProvidedDNS or to a domain name server of your choice. For more information, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_dhcp_options(
DhcpConfigurations=[
{
'Key': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False
)
[REQUIRED]
A DHCP configuration option.
dict
Response Syntax
{
'DhcpOptions': {
'DhcpConfigurations': [
{
'Key': 'string',
'Values': [
{
'Value': 'string'
},
]
},
],
'DhcpOptionsId': 'string',
'OwnerId': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
DhcpOptions (dict) --
A set of DHCP options.
DhcpConfigurations (list) --
One or more DHCP options in the set.
(dict) --
Describes a DHCP configuration option.
Key (string) --
The name of a DHCP option.
Values (list) --
One or more values for the DHCP option.
(dict) --
Describes a value for a resource attribute that is a String.
Value (string) --
The attribute value. The value is case-sensitive.
DhcpOptionsId (string) --
The ID of the set of DHCP options.
OwnerId (string) --
The ID of the AWS account that owns the DHCP options set.
Tags (list) --
Any tags assigned to the DHCP options set.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Examples
This example creates a DHCP options set.
response = client.create_dhcp_options(
DhcpConfigurations=[
{
'Key': 'domain-name-servers',
'Values': [
'10.2.5.1',
'10.2.5.2',
],
},
],
)
print(response)
Expected Output:
{
'DhcpOptions': {
'DhcpConfigurations': [
{
'Key': 'domain-name-servers',
'Values': [
{
'Value': '10.2.5.2',
},
{
'Value': '10.2.5.1',
},
],
},
],
'DhcpOptionsId': 'dopt-d9070ebb',
},
'ResponseMetadata': {
'...': '...',
},
}
[IPv6 only] Creates an egress-only internet gateway for your VPC. An egress-only internet gateway is used to enable outbound communication over IPv6 from instances in your VPC to the internet, and prevents hosts outside of your VPC from initiating an IPv6 connection with your instance.
See also: AWS API Documentation
Request Syntax
response = client.create_egress_only_internet_gateway(
ClientToken='string',
DryRun=True|False,
VpcId='string'
)
[REQUIRED]
The ID of the VPC for which to create the egress-only internet gateway.
dict
Response Syntax
{
'ClientToken': 'string',
'EgressOnlyInternetGateway': {
'Attachments': [
{
'State': 'attaching'|'attached'|'detaching'|'detached',
'VpcId': 'string'
},
],
'EgressOnlyInternetGatewayId': 'string'
}
}
Response Structure
(dict) --
ClientToken (string) --
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
EgressOnlyInternetGateway (dict) --
Information about the egress-only internet gateway.
Attachments (list) --
Information about the attachment of the egress-only internet gateway.
(dict) --
Describes the attachment of a VPC to an internet gateway or an egress-only internet gateway.
State (string) --
The current state of the attachment. For an internet gateway, the state is available when attached to a VPC; otherwise, this value is not returned.
VpcId (string) --
The ID of the VPC.
EgressOnlyInternetGatewayId (string) --
The ID of the egress-only internet gateway.
Launches an EC2 Fleet.
You can create a single EC2 Fleet that includes multiple launch specifications that vary by instance type, AMI, Availability Zone, or subnet.
For more information, see Launching an EC2 Fleet in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_fleet(
DryRun=True|False,
ClientToken='string',
SpotOptions={
'AllocationStrategy': 'lowest-price'|'diversified',
'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate',
'InstancePoolsToUseCount': 123,
'SingleInstanceType': True|False,
'SingleAvailabilityZone': True|False,
'MinTargetCapacity': 123,
'MaxTotalPrice': 'string'
},
OnDemandOptions={
'AllocationStrategy': 'lowest-price'|'prioritized',
'SingleInstanceType': True|False,
'SingleAvailabilityZone': True|False,
'MinTargetCapacity': 123,
'MaxTotalPrice': 'string'
},
ExcessCapacityTerminationPolicy='no-termination'|'termination',
LaunchTemplateConfigs=[
{
'LaunchTemplateSpecification': {
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'Version': 'string'
},
'Overrides': [
{
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'MaxPrice': 'string',
'SubnetId': 'string',
'AvailabilityZone': 'string',
'WeightedCapacity': 123.0,
'Priority': 123.0,
'Placement': {
'AvailabilityZone': 'string',
'Affinity': 'string',
'GroupName': 'string',
'PartitionNumber': 123,
'HostId': 'string',
'Tenancy': 'default'|'dedicated'|'host',
'SpreadDomain': 'string'
}
},
]
},
],
TargetCapacitySpecification={
'TotalTargetCapacity': 123,
'OnDemandTargetCapacity': 123,
'SpotTargetCapacity': 123,
'DefaultTargetCapacityType': 'spot'|'on-demand'
},
TerminateInstancesWithExpiration=True|False,
Type='request'|'maintain'|'instant',
ValidFrom=datetime(2015, 1, 1),
ValidUntil=datetime(2015, 1, 1),
ReplaceUnhealthyInstances=True|False,
TagSpecifications=[
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
]
)
Describes the configuration of Spot Instances in an EC2 Fleet.
Indicates how to allocate the target capacity across the Spot pools specified by the Spot Fleet request. The default is lowestPrice .
The behavior when a Spot Instance is interrupted. The default is terminate .
The number of Spot pools across which to allocate your target Spot capacity. Valid only when Spot AllocationStrategy is set to lowest-price . EC2 Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify.
Indicates that the fleet uses a single instance type to launch all Spot Instances in the fleet.
Indicates that the fleet launches all Spot Instances into a single Availability Zone.
The minimum target capacity for Spot Instances in the fleet. If the minimum target capacity is not reached, the fleet launches no instances.
The maximum amount per hour for Spot Instances that you're willing to pay.
Describes the configuration of On-Demand Instances in an EC2 Fleet.
The order of the launch template overrides to use in fulfilling On-Demand capacity. If you specify lowest-price , EC2 Fleet uses price to determine the order, launching the lowest price first. If you specify prioritized , EC2 Fleet uses the priority that you assigned to each launch template override, launching the highest priority first. If you do not specify a value, EC2 Fleet defaults to lowest-price .
Indicates that the fleet uses a single instance type to launch all On-Demand Instances in the fleet.
Indicates that the fleet launches all On-Demand Instances into a single Availability Zone.
The minimum target capacity for On-Demand Instances in the fleet. If the minimum target capacity is not reached, the fleet launches no instances.
The maximum amount per hour for On-Demand Instances that you're willing to pay.
[REQUIRED]
The configuration for the EC2 Fleet.
Describes a launch template and overrides.
The launch template to use. You must specify either the launch template ID or launch template name in the request.
The ID of the launch template.
The name of the launch template.
The version number of the launch template. Note: This is a required parameter and will be updated soon.
Any parameters that you specify override the same parameters in the launch template.
Describes overrides for a launch template.
The instance type.
The maximum price per unit hour that you are willing to pay for a Spot Instance.
The ID of the subnet in which to launch the instances.
The Availability Zone in which to launch the instances.
The number of units provided by the specified instance type.
The priority for the launch template override. If AllocationStrategy is set to prioritized , EC2 Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity. The highest priority is launched first. Valid values are whole numbers starting at 0 . The lower the number, the higher the priority. If no number is set, the launch template override has the lowest priority.
The location where the instance launched, if applicable.
The Availability Zone of the instance.
If not specified, an Availability Zone will be automatically chosen for you based on the load balancing criteria for the Region.
The affinity setting for the instance on the Dedicated Host. This parameter is not supported for the ImportInstance command.
The name of the placement group the instance is in.
The number of the partition the instance is in. Valid only if the placement group strategy is set to partition .
The ID of the Dedicated Host on which the instance resides. This parameter is not supported for the ImportInstance command.
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for the ImportInstance command.
Reserved for future use.
[REQUIRED]
The number of units to request.
The number of units to request, filled using DefaultTargetCapacityType .
The number of On-Demand units to request.
The number of Spot units to request.
The default TotalTargetCapacity , which is either Spot or On-Demand .
The key-value pair for tagging the EC2 Fleet request on creation. The value for ResourceType must be fleet , otherwise the fleet request fails. To tag instances at launch, specify the tags in the launch template . For information about tagging after launch, see Tagging Your Resources .
The tags to apply to a resource when the resource is being created.
The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
dict
Response Syntax
{
'FleetId': 'string',
'Errors': [
{
'LaunchTemplateAndOverrides': {
'LaunchTemplateSpecification': {
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'Version': 'string'
},
'Overrides': {
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'MaxPrice': 'string',
'SubnetId': 'string',
'AvailabilityZone': 'string',
'WeightedCapacity': 123.0,
'Priority': 123.0,
'Placement': {
'GroupName': 'string'
}
}
},
'Lifecycle': 'spot'|'on-demand',
'ErrorCode': 'string',
'ErrorMessage': 'string'
},
],
'Instances': [
{
'LaunchTemplateAndOverrides': {
'LaunchTemplateSpecification': {
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'Version': 'string'
},
'Overrides': {
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'MaxPrice': 'string',
'SubnetId': 'string',
'AvailabilityZone': 'string',
'WeightedCapacity': 123.0,
'Priority': 123.0,
'Placement': {
'GroupName': 'string'
}
}
},
'Lifecycle': 'spot'|'on-demand',
'InstanceIds': [
'string',
],
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'Platform': 'Windows'
},
]
}
Response Structure
(dict) --
FleetId (string) --
The ID of the EC2 Fleet.
Errors (list) --
Information about the instances that could not be launched by the fleet. Valid only when Type is set to instant .
(dict) --
Describes the instances that could not be launched by the fleet.
LaunchTemplateAndOverrides (dict) --
The launch templates and overrides that were used for launching the instances. Any parameters that you specify in the Overrides override the same parameters in the launch template.
LaunchTemplateSpecification (dict) --
The launch template.
LaunchTemplateId (string) --
The ID of the launch template. You must specify either a template ID or a template name.
LaunchTemplateName (string) --
The name of the launch template. You must specify either a template name or a template ID.
Version (string) --
The version number of the launch template. You must specify a version number.
Overrides (dict) --
Any parameters that you specify override the same parameters in the launch template.
InstanceType (string) --
The instance type.
MaxPrice (string) --
The maximum price per unit hour that you are willing to pay for a Spot Instance.
SubnetId (string) --
The ID of the subnet in which to launch the instances.
AvailabilityZone (string) --
The Availability Zone in which to launch the instances.
WeightedCapacity (float) --
The number of units provided by the specified instance type.
Priority (float) --
The priority for the launch template override. If AllocationStrategy is set to prioritized , EC2 Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity. The highest priority is launched first. Valid values are whole numbers starting at 0 . The lower the number, the higher the priority. If no number is set, the override has the lowest priority.
Placement (dict) --
The location where the instance launched, if applicable.
GroupName (string) --
The name of the placement group the instance is in.
Lifecycle (string) --
Indicates if the instance that could not be launched was a Spot Instance or On-Demand Instance.
ErrorCode (string) --
The error code that indicates why the instance could not be launched. For more information about error codes, see Error Codes .
ErrorMessage (string) --
The error message that describes why the instance could not be launched. For more information about error messages, see ee Error Codes .
Instances (list) --
Information about the instances that were launched by the fleet. Valid only when Type is set to instant .
(dict) --
Describes the instances that were launched by the fleet.
LaunchTemplateAndOverrides (dict) --
The launch templates and overrides that were used for launching the instances. Any parameters that you specify in the Overrides override the same parameters in the launch template.
LaunchTemplateSpecification (dict) --
The launch template.
LaunchTemplateId (string) --
The ID of the launch template. You must specify either a template ID or a template name.
LaunchTemplateName (string) --
The name of the launch template. You must specify either a template name or a template ID.
Version (string) --
The version number of the launch template. You must specify a version number.
Overrides (dict) --
Any parameters that you specify override the same parameters in the launch template.
InstanceType (string) --
The instance type.
MaxPrice (string) --
The maximum price per unit hour that you are willing to pay for a Spot Instance.
SubnetId (string) --
The ID of the subnet in which to launch the instances.
AvailabilityZone (string) --
The Availability Zone in which to launch the instances.
WeightedCapacity (float) --
The number of units provided by the specified instance type.
Priority (float) --
The priority for the launch template override. If AllocationStrategy is set to prioritized , EC2 Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity. The highest priority is launched first. Valid values are whole numbers starting at 0 . The lower the number, the higher the priority. If no number is set, the override has the lowest priority.
Placement (dict) --
The location where the instance launched, if applicable.
GroupName (string) --
The name of the placement group the instance is in.
Lifecycle (string) --
Indicates if the instance that was launched is a Spot Instance or On-Demand Instance.
InstanceIds (list) --
The IDs of the instances.
InstanceType (string) --
The instance type.
Platform (string) --
The value is Windows for Windows instances; otherwise blank.
Creates one or more flow logs to capture information about IP traffic for a specific network interface, subnet, or VPC.
Flow log data for a monitored network interface is recorded as flow log records, which are log events consisting of fields that describe the traffic flow. For more information, see Flow Log Records in the Amazon Virtual Private Cloud User Guide .
When publishing to CloudWatch Logs, flow log records are published to a log group, and each network interface has a unique log stream in the log group. When publishing to Amazon S3, flow log records for all of the monitored network interfaces are published to a single log file object that is stored in the specified bucket.
For more information, see VPC Flow Logs in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_flow_logs(
DryRun=True|False,
ClientToken='string',
DeliverLogsPermissionArn='string',
LogGroupName='string',
ResourceIds=[
'string',
],
ResourceType='VPC'|'Subnet'|'NetworkInterface',
TrafficType='ACCEPT'|'REJECT'|'ALL',
LogDestinationType='cloud-watch-logs'|'s3',
LogDestination='string'
)
The ARN for the IAM role that permits Amazon EC2 to publish flow logs to a CloudWatch Logs log group in your account.
If you specify LogDestinationType as s3 , do not specify DeliverLogsPermissionArn or LogGroupName .
The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs.
If you specify LogDestinationType as s3 , do not specify DeliverLogsPermissionArn or LogGroupName .
[REQUIRED]
The ID of the subnet, network interface, or VPC for which you want to create a flow log.
Constraints: Maximum of 1000 resources
[REQUIRED]
The type of resource for which to create the flow log. For example, if you specified a VPC ID for the ResourceId property, specify VPC for this property.
[REQUIRED]
The type of traffic to log. You can log traffic that the resource accepts or rejects, or all traffic.
Specifies the type of destination to which the flow log data is to be published. Flow log data can be published to CloudWatch Logs or Amazon S3. To publish flow log data to CloudWatch Logs, specify cloud-watch-logs . To publish flow log data to Amazon S3, specify s3 .
If you specify LogDestinationType as s3 , do not specify DeliverLogsPermissionArn or LogGroupName .
Default: cloud-watch-logs
Specifies the destination to which the flow log data is to be published. Flow log data can be published to a CloudWatch Logs log group or an Amazon S3 bucket. The value specified for this parameter depends on the value specified for LogDestinationType .
If LogDestinationType is not specified or cloud-watch-logs , specify the Amazon Resource Name (ARN) of the CloudWatch Logs log group.
If LogDestinationType is s3 , specify the ARN of the Amazon S3 bucket. You can also specify a subfolder in the bucket. To specify a subfolder in the bucket, use the following ARN format: bucket_ARN/subfolder_name/ . For example, to specify a subfolder named my-logs in a bucket named my-bucket , use the following ARN: arn:aws:s3:::my-bucket/my-logs/ . You cannot use AWSLogs as a subfolder name. This is a reserved term.
dict
Response Syntax
{
'ClientToken': 'string',
'FlowLogIds': [
'string',
],
'Unsuccessful': [
{
'Error': {
'Code': 'string',
'Message': 'string'
},
'ResourceId': 'string'
},
]
}
Response Structure
(dict) --
ClientToken (string) --
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
FlowLogIds (list) --
The IDs of the flow logs.
Unsuccessful (list) --
Information about the flow logs that could not be created successfully.
(dict) --
Information about items that were not successfully processed in a batch call.
Error (dict) --
Information about the error.
Code (string) --
The error code.
Message (string) --
The error message accompanying the error code.
ResourceId (string) --
The ID of the resource.
Creates an Amazon FPGA Image (AFI) from the specified design checkpoint (DCP).
The create operation is asynchronous. To verify that the AFI is ready for use, check the output logs.
An AFI contains the FPGA bitstream that is ready to download to an FPGA. You can securely deploy an AFI on multiple FPGA-accelerated instances. For more information, see the AWS FPGA Hardware Development Kit .
See also: AWS API Documentation
Request Syntax
response = client.create_fpga_image(
DryRun=True|False,
InputStorageLocation={
'Bucket': 'string',
'Key': 'string'
},
LogsStorageLocation={
'Bucket': 'string',
'Key': 'string'
},
Description='string',
Name='string',
ClientToken='string'
)
[REQUIRED]
The location of the encrypted design checkpoint in Amazon S3. The input must be a tarball.
The name of the S3 bucket.
The key.
The location in Amazon S3 for the output logs.
The name of the S3 bucket.
The key.
dict
Response Syntax
{
'FpgaImageId': 'string',
'FpgaImageGlobalId': 'string'
}
Response Structure
(dict) --
FpgaImageId (string) --
The FPGA image identifier (AFI ID).
FpgaImageGlobalId (string) --
The global FPGA image identifier (AGFI ID).
Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is either running or stopped.
If you customized your instance with instance store volumes or EBS volumes in addition to the root device volume, the new AMI contains block device mapping information for those volumes. When you launch an instance from this new AMI, the instance automatically launches with those additional volumes.
For more information, see Creating Amazon EBS-Backed Linux AMIs in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_image(
BlockDeviceMappings=[
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'Iops': 123,
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Encrypted': True|False,
'KmsKeyId': 'string'
},
'NoDevice': 'string'
},
],
Description='string',
DryRun=True|False,
InstanceId='string',
Name='string',
NoReboot=True|False
)
The block device mappings. This parameter cannot be used to modify the encryption status of existing volumes or snapshots. To create an AMI with encrypted snapshots, use the CopyImage action.
Describes a block device mapping.
The device name (for example, /dev/sdh or xvdh ).
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Parameters used to automatically set up EBS volumes when the instance is launched.
Indicates whether the EBS volume is deleted on instance termination.
The number of I/O operations per second (IOPS) that the volume supports. For io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
The ID of the snapshot.
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Constraints: 1-16384 for General Purpose SSD (gp2 ), 4-16384 for Provisioned IOPS SSD (io1 ), 500-16384 for Throughput Optimized HDD (st1 ), 500-16384 for Cold HDD (sc1 ), and 1-1024 for Magnetic (standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
The volume type. If you set the type to io1 , you must also set the Iops property.
Default: standard
Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
In no case can you remove encryption from an encrypted volume.
Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is encrypted.
This parameter is only supported on BlockDeviceMapping objects called by RunInstances , RequestSpotFleet , and RequestSpotInstances .
Suppresses the specified device included in the block device mapping of the AMI.
[REQUIRED]
The ID of the instance.
[REQUIRED]
A name for the new image.
Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)
dict
Response Syntax
{
'ImageId': 'string'
}
Response Structure
(dict) --
ImageId (string) --
The ID of the new AMI.
Exports a running or stopped instance to an S3 bucket.
For information about the supported operating systems, image formats, and known limitations for the types of instances you can export, see Exporting an Instance as a VM Using VM Import/Export in the VM Import/Export User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_instance_export_task(
Description='string',
ExportToS3Task={
'ContainerFormat': 'ova',
'DiskImageFormat': 'VMDK'|'RAW'|'VHD',
'S3Bucket': 'string',
'S3Prefix': 'string'
},
InstanceId='string',
TargetEnvironment='citrix'|'vmware'|'microsoft'
)
The format and location for an instance export task.
The container format used to combine disk images with metadata (such as OVF). If absent, only the disk image is exported.
The format for the exported image.
The S3 bucket for the destination image. The destination bucket must exist and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com .
The image is written to a single object in the S3 bucket at the S3 key s3prefix + exportTaskId + '.' + diskImageFormat.
[REQUIRED]
The ID of the instance.
dict
Response Syntax
{
'ExportTask': {
'Description': 'string',
'ExportTaskId': 'string',
'ExportToS3Task': {
'ContainerFormat': 'ova',
'DiskImageFormat': 'VMDK'|'RAW'|'VHD',
'S3Bucket': 'string',
'S3Key': 'string'
},
'InstanceExportDetails': {
'InstanceId': 'string',
'TargetEnvironment': 'citrix'|'vmware'|'microsoft'
},
'State': 'active'|'cancelling'|'cancelled'|'completed',
'StatusMessage': 'string'
}
}
Response Structure
(dict) --
ExportTask (dict) --
Information about the instance export task.
Description (string) --
A description of the resource being exported.
ExportTaskId (string) --
The ID of the export task.
ExportToS3Task (dict) --
Information about the export task.
ContainerFormat (string) --
The container format used to combine disk images with metadata (such as OVF). If absent, only the disk image is exported.
DiskImageFormat (string) --
The format for the exported image.
S3Bucket (string) --
The S3 bucket for the destination image. The destination bucket must exist and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com .
S3Key (string) --
The encryption key for your S3 bucket.
InstanceExportDetails (dict) --
Information about the instance to export.
InstanceId (string) --
The ID of the resource being exported.
TargetEnvironment (string) --
The target virtualization environment.
State (string) --
The state of the export task.
StatusMessage (string) --
The status message related to the export task.
Creates an internet gateway for use with a VPC. After creating the internet gateway, you attach it to a VPC using AttachInternetGateway .
For more information about your VPC and internet gateway, see the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_internet_gateway(
DryRun=True|False
)
{
'InternetGateway': {
'Attachments': [
{
'State': 'attaching'|'attached'|'detaching'|'detached',
'VpcId': 'string'
},
],
'InternetGatewayId': 'string',
'OwnerId': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
Information about the internet gateway.
Any VPCs attached to the internet gateway.
Describes the attachment of a VPC to an internet gateway or an egress-only internet gateway.
The current state of the attachment. For an internet gateway, the state is available when attached to a VPC; otherwise, this value is not returned.
The ID of the VPC.
The ID of the internet gateway.
The ID of the AWS account that owns the internet gateway.
Any tags assigned to the internet gateway.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Examples
This example creates an Internet gateway.
response = client.create_internet_gateway(
)
print(response)
Expected Output:
{
'InternetGateway': {
'Attachments': [
],
'InternetGatewayId': 'igw-c0a643a9',
'Tags': [
],
},
'ResponseMetadata': {
'...': '...',
},
}
Creates a 2048-bit RSA key pair with the specified name. Amazon EC2 stores the public key and displays the private key for you to save to a file. The private key is returned as an unencrypted PEM encoded PKCS#1 private key. If a key with the specified name already exists, Amazon EC2 returns an error.
You can have up to five thousand key pairs per Region.
The key pair returned to you is available only in the Region in which you create it. If you prefer, you can create your own key pair using a third-party tool and upload it to any Region using ImportKeyPair .
For more information, see Key Pairs in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_key_pair(
KeyName='string',
DryRun=True|False
)
[REQUIRED]
A unique name for the key pair.
Constraints: Up to 255 ASCII characters
dict
Response Syntax
{
'KeyFingerprint': 'string',
'KeyMaterial': 'string',
'KeyName': 'string'
}
Response Structure
(dict) --
Describes a key pair.
KeyFingerprint (string) --
The SHA-1 digest of the DER encoded private key.
KeyMaterial (string) --
An unencrypted PEM encoded RSA private key.
KeyName (string) --
The name of the key pair.
Examples
This example creates a key pair named my-key-pair.
response = client.create_key_pair(
KeyName='my-key-pair',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Creates a launch template. A launch template contains the parameters to launch an instance. When you launch an instance using RunInstances , you can specify a launch template instead of providing the launch parameters in the request.
See also: AWS API Documentation
Request Syntax
response = client.create_launch_template(
DryRun=True|False,
ClientToken='string',
LaunchTemplateName='string',
VersionDescription='string',
LaunchTemplateData={
'KernelId': 'string',
'EbsOptimized': True|False,
'IamInstanceProfile': {
'Arn': 'string',
'Name': 'string'
},
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'Encrypted': True|False,
'DeleteOnTermination': True|False,
'Iops': 123,
'KmsKeyId': 'string',
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1'
},
'NoDevice': 'string'
},
],
'NetworkInterfaces': [
{
'AssociatePublicIpAddress': True|False,
'DeleteOnTermination': True|False,
'Description': 'string',
'DeviceIndex': 123,
'Groups': [
'string',
],
'InterfaceType': 'string',
'Ipv6AddressCount': 123,
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'NetworkInterfaceId': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
'SecondaryPrivateIpAddressCount': 123,
'SubnetId': 'string'
},
],
'ImageId': 'string',
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'KeyName': 'string',
'Monitoring': {
'Enabled': True|False
},
'Placement': {
'AvailabilityZone': 'string',
'Affinity': 'string',
'GroupName': 'string',
'HostId': 'string',
'Tenancy': 'default'|'dedicated'|'host',
'SpreadDomain': 'string'
},
'RamDiskId': 'string',
'DisableApiTermination': True|False,
'InstanceInitiatedShutdownBehavior': 'stop'|'terminate',
'UserData': 'string',
'TagSpecifications': [
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'ElasticGpuSpecifications': [
{
'Type': 'string'
},
],
'ElasticInferenceAccelerators': [
{
'Type': 'string'
},
],
'SecurityGroupIds': [
'string',
],
'SecurityGroups': [
'string',
],
'InstanceMarketOptions': {
'MarketType': 'spot',
'SpotOptions': {
'MaxPrice': 'string',
'SpotInstanceType': 'one-time'|'persistent',
'BlockDurationMinutes': 123,
'ValidUntil': datetime(2015, 1, 1),
'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate'
}
},
'CreditSpecification': {
'CpuCredits': 'string'
},
'CpuOptions': {
'CoreCount': 123,
'ThreadsPerCore': 123
},
'CapacityReservationSpecification': {
'CapacityReservationPreference': 'open'|'none',
'CapacityReservationTarget': {
'CapacityReservationId': 'string'
}
},
'LicenseSpecifications': [
{
'LicenseConfigurationArn': 'string'
},
],
'HibernationOptions': {
'Configured': True|False
}
}
)
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency .
Constraint: Maximum 128 ASCII characters.
[REQUIRED]
A name for the launch template.
[REQUIRED]
The information for the launch template.
The ID of the kernel.
Warning
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User Provided Kernels in the Amazon Elastic Compute Cloud User Guide .
Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.
The IAM instance profile.
The Amazon Resource Name (ARN) of the instance profile.
The name of the instance profile.
The block device mapping.
Warning
Supplying both a snapshot ID and an encryption value as arguments for block-device mapping results in an error. This is because only blank volumes can be encrypted on start, and these are not created from a snapshot. If a snapshot is the basis for the volume, it contains data by definition and its encryption status cannot be changed using this action.
Describes a block device mapping.
The device name (for example, /dev/sdh or xvdh).
The virtual device name (ephemeralN). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1. The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
Parameters used to automatically set up EBS volumes when the instance is launched.
Indicates whether the EBS volume is encrypted. Encrypted volumes can only be attached to instances that support Amazon EBS encryption. If you are creating a volume from a snapshot, you can't specify an encryption value.
Indicates whether the EBS volume is deleted on instance termination.
The number of I/O operations per second (IOPS) that the volume supports. For io1, this represents the number of IOPS that are provisioned for the volume. For gp2, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information about General Purpose SSD baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2, st1, sc1, or standard volumes.
The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption.
The ID of the snapshot.
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
The volume type.
Suppresses the specified device included in the block device mapping of the AMI.
One or more network interfaces. If you specify a network interface, you must specify any security groups and subnets as part of the network interface.
The parameters for a network interface.
Associates a public IPv4 address with eth0 for a new network interface.
Indicates whether the network interface is deleted when the instance is terminated.
A description for the network interface.
The device index for the network interface attachment.
The IDs of one or more security groups.
The type of network interface. To create an Elastic Fabric Adapter (EFA), specify efa . For more information, see Elastic Fabric Adapter in the Amazon Elastic Compute Cloud User Guide .
If you are not creating an EFA, specify interface or omit this parameter.
Valid values: interface | efa
The number of IPv6 addresses to assign to a network interface. Amazon EC2 automatically selects the IPv6 addresses from the subnet range. You can't use this option if specifying specific IPv6 addresses.
One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. You can't use this option if you're specifying a number of IPv6 addresses.
Describes an IPv6 address.
The IPv6 address.
The ID of the network interface.
The primary private IPv4 address of the network interface.
One or more private IPv4 addresses.
Describes a secondary private IPv4 address for a network interface.
Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.
The private IPv4 addresses.
The number of secondary private IPv4 addresses to assign to a network interface.
The ID of the subnet for the network interface.
The ID of the AMI.
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide .
The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair .
Warning
If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.
The monitoring for the instance.
Specify true to enable detailed monitoring. Otherwise, basic monitoring is enabled.
The placement for the instance.
The Availability Zone for the instance.
The affinity setting for an instance on a Dedicated Host.
The name of the placement group for the instance.
The ID of the Dedicated Host for the instance.
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware.
Reserved for future use.
The ID of the RAM disk.
Warning
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User Provided Kernels in the Amazon Elastic Compute Cloud User Guide .
If you set this parameter to true , you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. To change this attribute after launch, use ModifyInstanceAttribute . Alternatively, if you set InstanceInitiatedShutdownBehavior to terminate , you can terminate the instance by running the shutdown command from the instance.
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
Default: stop
The Base64-encoded user data to make available to the instance. For more information, see Running Commands on Your Linux Instance at Launch (Linux) and Adding User Data (Windows).
The tags to apply to the resources during launch. You can only tag instances and volumes on launch. The specified tags are applied to all instances or volumes that are created during launch. To tag a resource after it has been created, see CreateTags .
The tags specification for the launch template.
The type of resource to tag. Currently, the resource types that support tagging on creation are instance and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
An elastic GPU to associate with the instance.
A specification for an Elastic Graphics accelerator.
The type of Elastic Graphics accelerator.
The elastic inference accelerator for the instance.
Describes an elastic inference accelerator.
The type of elastic inference accelerator. The possible values are eia1.medium, eia1.large, and eia1.xlarge.
One or more security group IDs. You can create a security group using CreateSecurityGroup . You cannot specify both a security group ID and security name in the same request.
[EC2-Classic, default VPC] One or more security group names. For a nondefault VPC, you must use security group IDs instead. You cannot specify both a security group ID and security name in the same request.
The market (purchasing) option for the instances.
The market type.
The options for Spot Instances.
The maximum hourly price you're willing to pay for the Spot Instances.
The Spot Instance request type.
The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).
The end date of the request. For a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached. The default end date is 7 days from the current date.
The behavior when a Spot Instance is interrupted. The default is terminate .
The credit option for CPU usage of the instance. Valid for T2 or T3 instances only.
The credit option for CPU usage of a T2 or T3 instance. Valid values are standard and unlimited .
The CPU options for the instance. For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide .
The number of CPU cores for the instance.
The number of threads per CPU core. To disable Intel Hyper-Threading Technology for the instance, specify a value of 1. Otherwise, specify the default value of 2.
The Capacity Reservation targeting option. If you do not specify this parameter, the instance's Capacity Reservation preference defaults to open , which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
Information about the target Capacity Reservation.
The ID of the Capacity Reservation.
The license configurations.
Describes a license configuration.
The Amazon Resource Name (ARN) of the license configuration.
Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the hibernation prerequisites . Hibernation is currently supported only for Amazon Linux. For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
If you set this parameter to true , the instance is enabled for hibernation.
Default: false
dict
Response Syntax
{
'LaunchTemplate': {
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'CreateTime': datetime(2015, 1, 1),
'CreatedBy': 'string',
'DefaultVersionNumber': 123,
'LatestVersionNumber': 123,
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
LaunchTemplate (dict) --
Information about the launch template.
LaunchTemplateId (string) --
The ID of the launch template.
LaunchTemplateName (string) --
The name of the launch template.
CreateTime (datetime) --
The time launch template was created.
CreatedBy (string) --
The principal that created the launch template.
DefaultVersionNumber (integer) --
The version number of the default version of the launch template.
LatestVersionNumber (integer) --
The version number of the latest version of the launch template.
Tags (list) --
The tags for the launch template.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Creates a new version for a launch template. You can specify an existing version of launch template from which to base the new version.
Launch template versions are numbered in the order in which they are created. You cannot specify, change, or replace the numbering of launch template versions.
See also: AWS API Documentation
Request Syntax
response = client.create_launch_template_version(
DryRun=True|False,
ClientToken='string',
LaunchTemplateId='string',
LaunchTemplateName='string',
SourceVersion='string',
VersionDescription='string',
LaunchTemplateData={
'KernelId': 'string',
'EbsOptimized': True|False,
'IamInstanceProfile': {
'Arn': 'string',
'Name': 'string'
},
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'Encrypted': True|False,
'DeleteOnTermination': True|False,
'Iops': 123,
'KmsKeyId': 'string',
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1'
},
'NoDevice': 'string'
},
],
'NetworkInterfaces': [
{
'AssociatePublicIpAddress': True|False,
'DeleteOnTermination': True|False,
'Description': 'string',
'DeviceIndex': 123,
'Groups': [
'string',
],
'InterfaceType': 'string',
'Ipv6AddressCount': 123,
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'NetworkInterfaceId': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
'SecondaryPrivateIpAddressCount': 123,
'SubnetId': 'string'
},
],
'ImageId': 'string',
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'KeyName': 'string',
'Monitoring': {
'Enabled': True|False
},
'Placement': {
'AvailabilityZone': 'string',
'Affinity': 'string',
'GroupName': 'string',
'HostId': 'string',
'Tenancy': 'default'|'dedicated'|'host',
'SpreadDomain': 'string'
},
'RamDiskId': 'string',
'DisableApiTermination': True|False,
'InstanceInitiatedShutdownBehavior': 'stop'|'terminate',
'UserData': 'string',
'TagSpecifications': [
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'ElasticGpuSpecifications': [
{
'Type': 'string'
},
],
'ElasticInferenceAccelerators': [
{
'Type': 'string'
},
],
'SecurityGroupIds': [
'string',
],
'SecurityGroups': [
'string',
],
'InstanceMarketOptions': {
'MarketType': 'spot',
'SpotOptions': {
'MaxPrice': 'string',
'SpotInstanceType': 'one-time'|'persistent',
'BlockDurationMinutes': 123,
'ValidUntil': datetime(2015, 1, 1),
'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate'
}
},
'CreditSpecification': {
'CpuCredits': 'string'
},
'CpuOptions': {
'CoreCount': 123,
'ThreadsPerCore': 123
},
'CapacityReservationSpecification': {
'CapacityReservationPreference': 'open'|'none',
'CapacityReservationTarget': {
'CapacityReservationId': 'string'
}
},
'LicenseSpecifications': [
{
'LicenseConfigurationArn': 'string'
},
],
'HibernationOptions': {
'Configured': True|False
}
}
)
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency .
Constraint: Maximum 128 ASCII characters.
[REQUIRED]
The information for the launch template.
The ID of the kernel.
Warning
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User Provided Kernels in the Amazon Elastic Compute Cloud User Guide .
Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.
The IAM instance profile.
The Amazon Resource Name (ARN) of the instance profile.
The name of the instance profile.
The block device mapping.
Warning
Supplying both a snapshot ID and an encryption value as arguments for block-device mapping results in an error. This is because only blank volumes can be encrypted on start, and these are not created from a snapshot. If a snapshot is the basis for the volume, it contains data by definition and its encryption status cannot be changed using this action.
Describes a block device mapping.
The device name (for example, /dev/sdh or xvdh).
The virtual device name (ephemeralN). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1. The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
Parameters used to automatically set up EBS volumes when the instance is launched.
Indicates whether the EBS volume is encrypted. Encrypted volumes can only be attached to instances that support Amazon EBS encryption. If you are creating a volume from a snapshot, you can't specify an encryption value.
Indicates whether the EBS volume is deleted on instance termination.
The number of I/O operations per second (IOPS) that the volume supports. For io1, this represents the number of IOPS that are provisioned for the volume. For gp2, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information about General Purpose SSD baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2, st1, sc1, or standard volumes.
The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption.
The ID of the snapshot.
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
The volume type.
Suppresses the specified device included in the block device mapping of the AMI.
One or more network interfaces. If you specify a network interface, you must specify any security groups and subnets as part of the network interface.
The parameters for a network interface.
Associates a public IPv4 address with eth0 for a new network interface.
Indicates whether the network interface is deleted when the instance is terminated.
A description for the network interface.
The device index for the network interface attachment.
The IDs of one or more security groups.
The type of network interface. To create an Elastic Fabric Adapter (EFA), specify efa . For more information, see Elastic Fabric Adapter in the Amazon Elastic Compute Cloud User Guide .
If you are not creating an EFA, specify interface or omit this parameter.
Valid values: interface | efa
The number of IPv6 addresses to assign to a network interface. Amazon EC2 automatically selects the IPv6 addresses from the subnet range. You can't use this option if specifying specific IPv6 addresses.
One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. You can't use this option if you're specifying a number of IPv6 addresses.
Describes an IPv6 address.
The IPv6 address.
The ID of the network interface.
The primary private IPv4 address of the network interface.
One or more private IPv4 addresses.
Describes a secondary private IPv4 address for a network interface.
Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.
The private IPv4 addresses.
The number of secondary private IPv4 addresses to assign to a network interface.
The ID of the subnet for the network interface.
The ID of the AMI.
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide .
The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair .
Warning
If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.
The monitoring for the instance.
Specify true to enable detailed monitoring. Otherwise, basic monitoring is enabled.
The placement for the instance.
The Availability Zone for the instance.
The affinity setting for an instance on a Dedicated Host.
The name of the placement group for the instance.
The ID of the Dedicated Host for the instance.
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware.
Reserved for future use.
The ID of the RAM disk.
Warning
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User Provided Kernels in the Amazon Elastic Compute Cloud User Guide .
If you set this parameter to true , you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. To change this attribute after launch, use ModifyInstanceAttribute . Alternatively, if you set InstanceInitiatedShutdownBehavior to terminate , you can terminate the instance by running the shutdown command from the instance.
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
Default: stop
The Base64-encoded user data to make available to the instance. For more information, see Running Commands on Your Linux Instance at Launch (Linux) and Adding User Data (Windows).
The tags to apply to the resources during launch. You can only tag instances and volumes on launch. The specified tags are applied to all instances or volumes that are created during launch. To tag a resource after it has been created, see CreateTags .
The tags specification for the launch template.
The type of resource to tag. Currently, the resource types that support tagging on creation are instance and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
An elastic GPU to associate with the instance.
A specification for an Elastic Graphics accelerator.
The type of Elastic Graphics accelerator.
The elastic inference accelerator for the instance.
Describes an elastic inference accelerator.
The type of elastic inference accelerator. The possible values are eia1.medium, eia1.large, and eia1.xlarge.
One or more security group IDs. You can create a security group using CreateSecurityGroup . You cannot specify both a security group ID and security name in the same request.
[EC2-Classic, default VPC] One or more security group names. For a nondefault VPC, you must use security group IDs instead. You cannot specify both a security group ID and security name in the same request.
The market (purchasing) option for the instances.
The market type.
The options for Spot Instances.
The maximum hourly price you're willing to pay for the Spot Instances.
The Spot Instance request type.
The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).
The end date of the request. For a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached. The default end date is 7 days from the current date.
The behavior when a Spot Instance is interrupted. The default is terminate .
The credit option for CPU usage of the instance. Valid for T2 or T3 instances only.
The credit option for CPU usage of a T2 or T3 instance. Valid values are standard and unlimited .
The CPU options for the instance. For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide .
The number of CPU cores for the instance.
The number of threads per CPU core. To disable Intel Hyper-Threading Technology for the instance, specify a value of 1. Otherwise, specify the default value of 2.
The Capacity Reservation targeting option. If you do not specify this parameter, the instance's Capacity Reservation preference defaults to open , which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
Information about the target Capacity Reservation.
The ID of the Capacity Reservation.
The license configurations.
Describes a license configuration.
The Amazon Resource Name (ARN) of the license configuration.
Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the hibernation prerequisites . Hibernation is currently supported only for Amazon Linux. For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
If you set this parameter to true , the instance is enabled for hibernation.
Default: false
dict
Response Syntax
{
'LaunchTemplateVersion': {
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'VersionNumber': 123,
'VersionDescription': 'string',
'CreateTime': datetime(2015, 1, 1),
'CreatedBy': 'string',
'DefaultVersion': True|False,
'LaunchTemplateData': {
'KernelId': 'string',
'EbsOptimized': True|False,
'IamInstanceProfile': {
'Arn': 'string',
'Name': 'string'
},
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'Encrypted': True|False,
'DeleteOnTermination': True|False,
'Iops': 123,
'KmsKeyId': 'string',
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1'
},
'NoDevice': 'string'
},
],
'NetworkInterfaces': [
{
'AssociatePublicIpAddress': True|False,
'DeleteOnTermination': True|False,
'Description': 'string',
'DeviceIndex': 123,
'Groups': [
'string',
],
'InterfaceType': 'string',
'Ipv6AddressCount': 123,
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'NetworkInterfaceId': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
'SecondaryPrivateIpAddressCount': 123,
'SubnetId': 'string'
},
],
'ImageId': 'string',
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'KeyName': 'string',
'Monitoring': {
'Enabled': True|False
},
'Placement': {
'AvailabilityZone': 'string',
'Affinity': 'string',
'GroupName': 'string',
'HostId': 'string',
'Tenancy': 'default'|'dedicated'|'host',
'SpreadDomain': 'string'
},
'RamDiskId': 'string',
'DisableApiTermination': True|False,
'InstanceInitiatedShutdownBehavior': 'stop'|'terminate',
'UserData': 'string',
'TagSpecifications': [
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'ElasticGpuSpecifications': [
{
'Type': 'string'
},
],
'ElasticInferenceAccelerators': [
{
'Type': 'string'
},
],
'SecurityGroupIds': [
'string',
],
'SecurityGroups': [
'string',
],
'InstanceMarketOptions': {
'MarketType': 'spot',
'SpotOptions': {
'MaxPrice': 'string',
'SpotInstanceType': 'one-time'|'persistent',
'BlockDurationMinutes': 123,
'ValidUntil': datetime(2015, 1, 1),
'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate'
}
},
'CreditSpecification': {
'CpuCredits': 'string'
},
'CpuOptions': {
'CoreCount': 123,
'ThreadsPerCore': 123
},
'CapacityReservationSpecification': {
'CapacityReservationPreference': 'open'|'none',
'CapacityReservationTarget': {
'CapacityReservationId': 'string'
}
},
'LicenseSpecifications': [
{
'LicenseConfigurationArn': 'string'
},
],
'HibernationOptions': {
'Configured': True|False
}
}
}
}
Response Structure
(dict) --
LaunchTemplateVersion (dict) --
Information about the launch template version.
LaunchTemplateId (string) --
The ID of the launch template.
LaunchTemplateName (string) --
The name of the launch template.
VersionNumber (integer) --
The version number.
VersionDescription (string) --
The description for the version.
CreateTime (datetime) --
The time the version was created.
CreatedBy (string) --
The principal that created the version.
DefaultVersion (boolean) --
Indicates whether the version is the default version.
LaunchTemplateData (dict) --
Information about the launch template.
KernelId (string) --
The ID of the kernel, if applicable.
EbsOptimized (boolean) --
Indicates whether the instance is optimized for Amazon EBS I/O.
IamInstanceProfile (dict) --
The IAM instance profile.
Arn (string) --
The Amazon Resource Name (ARN) of the instance profile.
Name (string) --
The name of the instance profile.
BlockDeviceMappings (list) --
The block device mappings.
(dict) --
Describes a block device mapping.
DeviceName (string) --
The device name.
VirtualName (string) --
The virtual device name (ephemeralN).
Ebs (dict) --
Information about the block device for an EBS volume.
Encrypted (boolean) --
Indicates whether the EBS volume is encrypted.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports.
KmsKeyId (string) --
The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption.
SnapshotId (string) --
The ID of the snapshot.
VolumeSize (integer) --
The size of the volume, in GiB.
VolumeType (string) --
The volume type.
NoDevice (string) --
Suppresses the specified device included in the block device mapping of the AMI.
NetworkInterfaces (list) --
The network interfaces.
(dict) --
Describes a network interface.
AssociatePublicIpAddress (boolean) --
Indicates whether to associate a public IPv4 address with eth0 for a new network interface.
DeleteOnTermination (boolean) --
Indicates whether the network interface is deleted when the instance is terminated.
Description (string) --
A description for the network interface.
DeviceIndex (integer) --
The device index for the network interface attachment.
Groups (list) --
The IDs of one or more security groups.
InterfaceType (string) --
The type of network interface.
Ipv6AddressCount (integer) --
The number of IPv6 addresses for the network interface.
Ipv6Addresses (list) --
The IPv6 addresses for the network interface.
(dict) --
Describes an IPv6 address.
Ipv6Address (string) --
The IPv6 address.
NetworkInterfaceId (string) --
The ID of the network interface.
PrivateIpAddress (string) --
The primary private IPv4 address of the network interface.
PrivateIpAddresses (list) --
One or more private IPv4 addresses.
(dict) --
Describes a secondary private IPv4 address for a network interface.
Primary (boolean) --
Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.
PrivateIpAddress (string) --
The private IPv4 addresses.
SecondaryPrivateIpAddressCount (integer) --
The number of secondary private IPv4 addresses for the network interface.
SubnetId (string) --
The ID of the subnet for the network interface.
ImageId (string) --
The ID of the AMI that was used to launch the instance.
InstanceType (string) --
The instance type.
KeyName (string) --
The name of the key pair.
Monitoring (dict) --
The monitoring for the instance.
Enabled (boolean) --
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
Placement (dict) --
The placement of the instance.
AvailabilityZone (string) --
The Availability Zone of the instance.
Affinity (string) --
The affinity setting for the instance on the Dedicated Host.
GroupName (string) --
The name of the placement group for the instance.
HostId (string) --
The ID of the Dedicated Host for the instance.
Tenancy (string) --
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware.
SpreadDomain (string) --
Reserved for future use.
RamDiskId (string) --
The ID of the RAM disk, if applicable.
DisableApiTermination (boolean) --
If set to true , indicates that the instance cannot be terminated using the Amazon EC2 console, command line tool, or API.
InstanceInitiatedShutdownBehavior (string) --
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
UserData (string) --
The user data for the instance.
TagSpecifications (list) --
The tags.
(dict) --
The tag specification for the launch template.
ResourceType (string) --
The type of resource.
Tags (list) --
The tags for the resource.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
ElasticGpuSpecifications (list) --
The elastic GPU specification.
(dict) --
Describes an elastic GPU.
Type (string) --
The elastic GPU type.
ElasticInferenceAccelerators (list) --
The elastic inference accelerator for the instance.
(dict) --
Describes an elastic inference accelerator.
Type (string) --
The type of elastic inference accelerator. The possible values are eia1.medium, eia1.large, and eia1.xlarge.
SecurityGroupIds (list) --
The security group IDs.
SecurityGroups (list) --
The security group names.
InstanceMarketOptions (dict) --
The market (purchasing) option for the instances.
MarketType (string) --
The market type.
SpotOptions (dict) --
The options for Spot Instances.
MaxPrice (string) --
The maximum hourly price you're willing to pay for the Spot Instances.
SpotInstanceType (string) --
The Spot Instance request type.
BlockDurationMinutes (integer) --
The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).
ValidUntil (datetime) --
The end date of the request. For a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached.
InstanceInterruptionBehavior (string) --
The behavior when a Spot Instance is interrupted.
CreditSpecification (dict) --
The credit option for CPU usage of the instance.
CpuCredits (string) --
The credit option for CPU usage of a T2 or T3 instance. Valid values are standard and unlimited .
CpuOptions (dict) --
The CPU options for the instance. For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide .
CoreCount (integer) --
The number of CPU cores for the instance.
ThreadsPerCore (integer) --
The number of threads per CPU core.
CapacityReservationSpecification (dict) --
Information about the Capacity Reservation targeting option.
CapacityReservationPreference (string) --
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
CapacityReservationTarget (dict) --
Information about the target Capacity Reservation.
CapacityReservationId (string) --
The ID of the Capacity Reservation.
LicenseSpecifications (list) --
The license configurations.
(dict) --
Describes a license configuration.
LicenseConfigurationArn (string) --
The Amazon Resource Name (ARN) of the license configuration.
HibernationOptions (dict) --
Indicates whether an instance is configured for hibernation. For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
Configured (boolean) --
If this parameter is set to true , the instance is enabled for hibernation; otherwise, it is not enabled for hibernation.
Creates a NAT gateway in the specified public subnet. This action creates a network interface in the specified subnet with a private IP address from the IP address range of the subnet. Internet-bound traffic from a private subnet can be routed to the NAT gateway, therefore enabling instances in the private subnet to connect to the internet. For more information, see NAT Gateways in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_nat_gateway(
AllocationId='string',
ClientToken='string',
SubnetId='string'
)
[REQUIRED]
The allocation ID of an Elastic IP address to associate with the NAT gateway. If the Elastic IP address is associated with another resource, you must first disassociate it.
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency .
Constraint: Maximum 64 ASCII characters.
[REQUIRED]
The subnet in which to create the NAT gateway.
dict
Response Syntax
{
'ClientToken': 'string',
'NatGateway': {
'CreateTime': datetime(2015, 1, 1),
'DeleteTime': datetime(2015, 1, 1),
'FailureCode': 'string',
'FailureMessage': 'string',
'NatGatewayAddresses': [
{
'AllocationId': 'string',
'NetworkInterfaceId': 'string',
'PrivateIp': 'string',
'PublicIp': 'string'
},
],
'NatGatewayId': 'string',
'ProvisionedBandwidth': {
'ProvisionTime': datetime(2015, 1, 1),
'Provisioned': 'string',
'RequestTime': datetime(2015, 1, 1),
'Requested': 'string',
'Status': 'string'
},
'State': 'pending'|'failed'|'available'|'deleting'|'deleted',
'SubnetId': 'string',
'VpcId': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
ClientToken (string) --
Unique, case-sensitive identifier to ensure the idempotency of the request. Only returned if a client token was provided in the request.
NatGateway (dict) --
Information about the NAT gateway.
CreateTime (datetime) --
The date and time the NAT gateway was created.
DeleteTime (datetime) --
The date and time the NAT gateway was deleted, if applicable.
FailureCode (string) --
If the NAT gateway could not be created, specifies the error code for the failure. (InsufficientFreeAddressesInSubnet | Gateway.NotAttached | InvalidAllocationID.NotFound | Resource.AlreadyAssociated | InternalError | InvalidSubnetID.NotFound )
FailureMessage (string) --
If the NAT gateway could not be created, specifies the error message for the failure, that corresponds to the error code.
NatGatewayAddresses (list) --
Information about the IP addresses and network interface associated with the NAT gateway.
(dict) --
Describes the IP addresses and network interface associated with a NAT gateway.
AllocationId (string) --
The allocation ID of the Elastic IP address that's associated with the NAT gateway.
NetworkInterfaceId (string) --
The ID of the network interface associated with the NAT gateway.
PrivateIp (string) --
The private IP address associated with the Elastic IP address.
PublicIp (string) --
The Elastic IP address associated with the NAT gateway.
NatGatewayId (string) --
The ID of the NAT gateway.
ProvisionedBandwidth (dict) --
Reserved. If you need to sustain traffic greater than the documented limits , contact us through the Support Center .
ProvisionTime (datetime) --
Reserved. If you need to sustain traffic greater than the documented limits , contact us through the Support Center .
Provisioned (string) --
Reserved. If you need to sustain traffic greater than the documented limits , contact us through the Support Center .
RequestTime (datetime) --
Reserved. If you need to sustain traffic greater than the documented limits , contact us through the Support Center .
Requested (string) --
Reserved. If you need to sustain traffic greater than the documented limits , contact us through the Support Center .
Status (string) --
Reserved. If you need to sustain traffic greater than the documented limits , contact us through the Support Center .
State (string) --
The state of the NAT gateway.
SubnetId (string) --
The ID of the subnet in which the NAT gateway is located.
VpcId (string) --
The ID of the VPC in which the NAT gateway is located.
Tags (list) --
The tags for the NAT gateway.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Examples
This example creates a NAT gateway in subnet subnet-1a2b3c4d and associates an Elastic IP address with the allocation ID eipalloc-37fc1a52 with the NAT gateway.
response = client.create_nat_gateway(
AllocationId='eipalloc-37fc1a52',
SubnetId='subnet-1a2b3c4d',
)
print(response)
Expected Output:
{
'NatGateway': {
'CreateTime': datetime(2015, 12, 17, 12, 45, 26, 3, 351, 0),
'NatGatewayAddresses': [
{
'AllocationId': 'eipalloc-37fc1a52',
},
],
'NatGatewayId': 'nat-08d48af2a8e83edfd',
'State': 'pending',
'SubnetId': 'subnet-1a2b3c4d',
'VpcId': 'vpc-1122aabb',
},
'ResponseMetadata': {
'...': '...',
},
}
Creates a network ACL in a VPC. Network ACLs provide an optional layer of security (in addition to security groups) for the instances in your VPC.
For more information, see Network ACLs in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_network_acl(
DryRun=True|False,
VpcId='string'
)
[REQUIRED]
The ID of the VPC.
dict
Response Syntax
{
'NetworkAcl': {
'Associations': [
{
'NetworkAclAssociationId': 'string',
'NetworkAclId': 'string',
'SubnetId': 'string'
},
],
'Entries': [
{
'CidrBlock': 'string',
'Egress': True|False,
'IcmpTypeCode': {
'Code': 123,
'Type': 123
},
'Ipv6CidrBlock': 'string',
'PortRange': {
'From': 123,
'To': 123
},
'Protocol': 'string',
'RuleAction': 'allow'|'deny',
'RuleNumber': 123
},
],
'IsDefault': True|False,
'NetworkAclId': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VpcId': 'string',
'OwnerId': 'string'
}
}
Response Structure
(dict) --
NetworkAcl (dict) --
Information about the network ACL.
Associations (list) --
Any associations between the network ACL and one or more subnets
(dict) --
Describes an association between a network ACL and a subnet.
NetworkAclAssociationId (string) --
The ID of the association between a network ACL and a subnet.
NetworkAclId (string) --
The ID of the network ACL.
SubnetId (string) --
The ID of the subnet.
Entries (list) --
One or more entries (rules) in the network ACL.
(dict) --
Describes an entry in a network ACL.
CidrBlock (string) --
The IPv4 network range to allow or deny, in CIDR notation.
Egress (boolean) --
Indicates whether the rule is an egress rule (applied to traffic leaving the subnet).
IcmpTypeCode (dict) --
ICMP protocol: The ICMP type and code.
Code (integer) --
The ICMP code. A value of -1 means all codes for the specified ICMP type.
Type (integer) --
The ICMP type. A value of -1 means all types.
Ipv6CidrBlock (string) --
The IPv6 network range to allow or deny, in CIDR notation.
PortRange (dict) --
TCP or UDP protocols: The range of ports the rule applies to.
From (integer) --
The first port in the range.
To (integer) --
The last port in the range.
Protocol (string) --
The protocol number. A value of "-1" means all protocols.
RuleAction (string) --
Indicates whether to allow or deny the traffic that matches the rule.
RuleNumber (integer) --
The rule number for the entry. ACL entries are processed in ascending order by rule number.
IsDefault (boolean) --
Indicates whether this is the default network ACL for the VPC.
NetworkAclId (string) --
The ID of the network ACL.
Tags (list) --
Any tags assigned to the network ACL.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VpcId (string) --
The ID of the VPC for the network ACL.
OwnerId (string) --
The ID of the AWS account that owns the network ACL.
Examples
This example creates a network ACL for the specified VPC.
response = client.create_network_acl(
VpcId='vpc-a01106c2',
)
print(response)
Expected Output:
{
'NetworkAcl': {
'Associations': [
],
'Entries': [
{
'CidrBlock': '0.0.0.0/0',
'Egress': True,
'Protocol': '-1',
'RuleAction': 'deny',
'RuleNumber': 32767,
},
{
'CidrBlock': '0.0.0.0/0',
'Egress': False,
'Protocol': '-1',
'RuleAction': 'deny',
'RuleNumber': 32767,
},
],
'IsDefault': False,
'NetworkAclId': 'acl-5fb85d36',
'Tags': [
],
'VpcId': 'vpc-a01106c2',
},
'ResponseMetadata': {
'...': '...',
},
}
Creates an entry (a rule) in a network ACL with the specified rule number. Each network ACL has a set of numbered ingress rules and a separate set of numbered egress rules. When determining whether a packet should be allowed in or out of a subnet associated with the ACL, we process the entries in the ACL according to the rule numbers, in ascending order. Each network ACL has a set of ingress rules and a separate set of egress rules.
We recommend that you leave room between the rule numbers (for example, 100, 110, 120, ...), and not number them one right after the other (for example, 101, 102, 103, ...). This makes it easier to add a rule between existing ones without having to renumber the rules.
After you add an entry, you can't modify it; you must either replace it, or create an entry and delete the old one.
For more information about network ACLs, see Network ACLs in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_network_acl_entry(
CidrBlock='string',
DryRun=True|False,
Egress=True|False,
IcmpTypeCode={
'Code': 123,
'Type': 123
},
Ipv6CidrBlock='string',
NetworkAclId='string',
PortRange={
'From': 123,
'To': 123
},
Protocol='string',
RuleAction='allow'|'deny',
RuleNumber=123
)
[REQUIRED]
Indicates whether this is an egress rule (rule is applied to traffic leaving the subnet).
ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol 1 (ICMP) or protocol 58 (ICMPv6) with an IPv6 CIDR block.
The ICMP code. A value of -1 means all codes for the specified ICMP type.
The ICMP type. A value of -1 means all types.
[REQUIRED]
The ID of the network ACL.
TCP or UDP protocols: The range of ports the rule applies to. Required if specifying protocol 6 (TCP) or 17 (UDP).
The first port in the range.
The last port in the range.
[REQUIRED]
The protocol number. A value of "-1" means all protocols. If you specify "-1" or a protocol number other than "6" (TCP), "17" (UDP), or "1" (ICMP), traffic on all ports is allowed, regardless of any ports or ICMP types or codes that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR block, traffic for all ICMP types and codes allowed, regardless of any that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv6 CIDR block, you must specify an ICMP type and code.
[REQUIRED]
Indicates whether to allow or deny the traffic that matches the rule.
[REQUIRED]
The rule number for the entry (for example, 100). ACL entries are processed in ascending order by rule number.
Constraints: Positive integer from 1 to 32766. The range 32767 to 65535 is reserved for internal use.
None
Examples
This example creates an entry for the specified network ACL. The rule allows ingress traffic from anywhere (0.0.0.0/0) on UDP port 53 (DNS) into any associated subnet.
response = client.create_network_acl_entry(
CidrBlock='0.0.0.0/0',
Egress=False,
NetworkAclId='acl-5fb85d36',
PortRange={
'From': 53,
'To': 53,
},
Protocol='udp',
RuleAction='allow',
RuleNumber=100,
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Creates a network interface in the specified subnet.
For more information about network interfaces, see Elastic Network Interfaces in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_network_interface(
Description='string',
DryRun=True|False,
Groups=[
'string',
],
Ipv6AddressCount=123,
Ipv6Addresses=[
{
'Ipv6Address': 'string'
},
],
PrivateIpAddress='string',
PrivateIpAddresses=[
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
SecondaryPrivateIpAddressCount=123,
InterfaceType='efa',
SubnetId='string'
)
The IDs of one or more security groups.
One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. You can't use this option if you're specifying a number of IPv6 addresses.
Describes an IPv6 address.
The IPv6 address.
One or more private IPv4 addresses.
Describes a secondary private IPv4 address for a network interface.
Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.
The private IPv4 addresses.
The number of secondary private IPv4 addresses to assign to a network interface. When you specify a number of secondary IPv4 addresses, Amazon EC2 selects these IP addresses within the subnet's IPv4 CIDR range. You can't specify this option and specify more than one private IP address using privateIpAddresses .
The number of IP addresses you can assign to a network interface varies by instance type. For more information, see IP Addresses Per ENI Per Instance Type in the Amazon Virtual Private Cloud User Guide .
[REQUIRED]
The ID of the subnet to associate with the network interface.
dict
Response Syntax
{
'NetworkInterface': {
'Association': {
'AllocationId': 'string',
'AssociationId': 'string',
'IpOwnerId': 'string',
'PublicDnsName': 'string',
'PublicIp': 'string'
},
'Attachment': {
'AttachTime': datetime(2015, 1, 1),
'AttachmentId': 'string',
'DeleteOnTermination': True|False,
'DeviceIndex': 123,
'InstanceId': 'string',
'InstanceOwnerId': 'string',
'Status': 'attaching'|'attached'|'detaching'|'detached'
},
'AvailabilityZone': 'string',
'Description': 'string',
'Groups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'InterfaceType': 'interface'|'natGateway'|'efa',
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'MacAddress': 'string',
'NetworkInterfaceId': 'string',
'OwnerId': 'string',
'PrivateDnsName': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Association': {
'AllocationId': 'string',
'AssociationId': 'string',
'IpOwnerId': 'string',
'PublicDnsName': 'string',
'PublicIp': 'string'
},
'Primary': True|False,
'PrivateDnsName': 'string',
'PrivateIpAddress': 'string'
},
],
'RequesterId': 'string',
'RequesterManaged': True|False,
'SourceDestCheck': True|False,
'Status': 'available'|'associated'|'attaching'|'in-use'|'detaching',
'SubnetId': 'string',
'TagSet': [
{
'Key': 'string',
'Value': 'string'
},
],
'VpcId': 'string'
}
}
Response Structure
(dict) --
Contains the output of CreateNetworkInterface.
NetworkInterface (dict) --
Information about the network interface.
Association (dict) --
The association information for an Elastic IP address (IPv4) associated with the network interface.
AllocationId (string) --
The allocation ID.
AssociationId (string) --
The association ID.
IpOwnerId (string) --
The ID of the Elastic IP address owner.
PublicDnsName (string) --
The public DNS name.
PublicIp (string) --
The address of the Elastic IP address bound to the network interface.
Attachment (dict) --
The network interface attachment.
AttachTime (datetime) --
The timestamp indicating when the attachment initiated.
AttachmentId (string) --
The ID of the network interface attachment.
DeleteOnTermination (boolean) --
Indicates whether the network interface is deleted when the instance is terminated.
DeviceIndex (integer) --
The device index of the network interface attachment on the instance.
InstanceId (string) --
The ID of the instance.
InstanceOwnerId (string) --
The AWS account ID of the owner of the instance.
Status (string) --
The attachment state.
AvailabilityZone (string) --
The Availability Zone.
Description (string) --
A description.
Groups (list) --
Any security groups for the network interface.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
InterfaceType (string) --
The type of network interface.
Ipv6Addresses (list) --
The IPv6 addresses associated with the network interface.
(dict) --
Describes an IPv6 address associated with a network interface.
Ipv6Address (string) --
The IPv6 address.
MacAddress (string) --
The MAC address.
NetworkInterfaceId (string) --
The ID of the network interface.
OwnerId (string) --
The AWS account ID of the owner of the network interface.
PrivateDnsName (string) --
The private DNS name.
PrivateIpAddress (string) --
The IPv4 address of the network interface within the subnet.
PrivateIpAddresses (list) --
The private IPv4 addresses associated with the network interface.
(dict) --
Describes the private IPv4 address of a network interface.
Association (dict) --
The association information for an Elastic IP address (IPv4) associated with the network interface.
AllocationId (string) --
The allocation ID.
AssociationId (string) --
The association ID.
IpOwnerId (string) --
The ID of the Elastic IP address owner.
PublicDnsName (string) --
The public DNS name.
PublicIp (string) --
The address of the Elastic IP address bound to the network interface.
Primary (boolean) --
Indicates whether this IPv4 address is the primary private IPv4 address of the network interface.
PrivateDnsName (string) --
The private DNS name.
PrivateIpAddress (string) --
The private IPv4 address.
RequesterId (string) --
The ID of the entity that launched the instance on your behalf (for example, AWS Management Console or Auto Scaling).
RequesterManaged (boolean) --
Indicates whether the network interface is being managed by AWS.
SourceDestCheck (boolean) --
Indicates whether traffic to or from the instance is validated.
Status (string) --
The status of the network interface.
SubnetId (string) --
The ID of the subnet.
TagSet (list) --
Any tags assigned to the network interface.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VpcId (string) --
The ID of the VPC.
Examples
This example creates a network interface for the specified subnet.
response = client.create_network_interface(
Description='my network interface',
Groups=[
'sg-903004f8',
],
PrivateIpAddress='10.0.2.17',
SubnetId='subnet-9d4a7b6c',
)
print(response)
Expected Output:
{
'NetworkInterface': {
'AvailabilityZone': 'us-east-1d',
'Description': 'my network interface',
'Groups': [
{
'GroupId': 'sg-903004f8',
'GroupName': 'default',
},
],
'MacAddress': '02:1a:80:41:52:9c',
'NetworkInterfaceId': 'eni-e5aa89a3',
'OwnerId': '123456789012',
'PrivateIpAddress': '10.0.2.17',
'PrivateIpAddresses': [
{
'Primary': True,
'PrivateIpAddress': '10.0.2.17',
},
],
'RequesterManaged': False,
'SourceDestCheck': True,
'Status': 'pending',
'SubnetId': 'subnet-9d4a7b6c',
'TagSet': [
],
'VpcId': 'vpc-a01106c2',
},
'ResponseMetadata': {
'...': '...',
},
}
Grants an AWS-authorized account permission to attach the specified network interface to an instance in their account.
You can grant permission to a single AWS account only, and only one account at a time.
See also: AWS API Documentation
Request Syntax
response = client.create_network_interface_permission(
NetworkInterfaceId='string',
AwsAccountId='string',
AwsService='string',
Permission='INSTANCE-ATTACH'|'EIP-ASSOCIATE',
DryRun=True|False
)
[REQUIRED]
The ID of the network interface.
[REQUIRED]
The type of permission to grant.
dict
Response Syntax
{
'InterfacePermission': {
'NetworkInterfacePermissionId': 'string',
'NetworkInterfaceId': 'string',
'AwsAccountId': 'string',
'AwsService': 'string',
'Permission': 'INSTANCE-ATTACH'|'EIP-ASSOCIATE',
'PermissionState': {
'State': 'pending'|'granted'|'revoking'|'revoked',
'StatusMessage': 'string'
}
}
}
Response Structure
(dict) --
Contains the output of CreateNetworkInterfacePermission.
InterfacePermission (dict) --
Information about the permission for the network interface.
NetworkInterfacePermissionId (string) --
The ID of the network interface permission.
NetworkInterfaceId (string) --
The ID of the network interface.
AwsAccountId (string) --
The AWS account ID.
AwsService (string) --
The AWS service.
Permission (string) --
The type of permission.
PermissionState (dict) --
Information about the state of the permission.
State (string) --
The state of the permission.
StatusMessage (string) --
A status message, if applicable.
Creates a placement group in which to launch instances. The strategy of the placement group determines how the instances are organized within the group.
A cluster placement group is a logical grouping of instances within a single Availability Zone that benefit from low network latency, high network throughput. A spread placement group places instances on distinct hardware. A partition placement group places groups of instances in different partitions, where instances in one partition do not share the same hardware with instances in another partition.
For more information, see Placement Groups in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_placement_group(
DryRun=True|False,
GroupName='string',
Strategy='cluster'|'spread'|'partition',
PartitionCount=123
)
A name for the placement group. Must be unique within the scope of your account for the Region.
Constraints: Up to 255 ASCII characters
None
Examples
This example creates a placement group with the specified name.
response = client.create_placement_group(
GroupName='my-cluster',
Strategy='cluster',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Creates a listing for Amazon EC2 Standard Reserved Instances to be sold in the Reserved Instance Marketplace. You can submit one Standard Reserved Instance listing at a time. To get a list of your Standard Reserved Instances, you can use the DescribeReservedInstances operation.
Note
Only Standard Reserved Instances can be sold in the Reserved Instance Marketplace. Convertible Reserved Instances cannot be sold.
The Reserved Instance Marketplace matches sellers who want to resell Standard Reserved Instance capacity that they no longer need with buyers who want to purchase additional capacity. Reserved Instances bought and sold through the Reserved Instance Marketplace work like any other Reserved Instances.
To sell your Standard Reserved Instances, you must first register as a seller in the Reserved Instance Marketplace. After completing the registration process, you can create a Reserved Instance Marketplace listing of some or all of your Standard Reserved Instances, and specify the upfront price to receive for them. Your Standard Reserved Instance listings then become available for purchase. To view the details of your Standard Reserved Instance listing, you can use the DescribeReservedInstancesListings operation.
For more information, see Reserved Instance Marketplace in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_reserved_instances_listing(
ClientToken='string',
InstanceCount=123,
PriceSchedules=[
{
'CurrencyCode': 'USD',
'Price': 123.0,
'Term': 123
},
],
ReservedInstancesId='string'
)
[REQUIRED]
Unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency .
[REQUIRED]
The number of instances that are a part of a Reserved Instance account to be listed in the Reserved Instance Marketplace. This number should be less than or equal to the instance count associated with the Reserved Instance ID specified in this call.
[REQUIRED]
A list specifying the price of the Standard Reserved Instance for each month remaining in the Reserved Instance term.
Describes the price for a Reserved Instance.
The currency for transacting the Reserved Instance resale. At this time, the only supported currency is USD .
The fixed price for the term.
The number of months remaining in the reservation. For example, 2 is the second to the last month before the capacity reservation expires.
[REQUIRED]
The ID of the active Standard Reserved Instance.
dict
Response Syntax
{
'ReservedInstancesListings': [
{
'ClientToken': 'string',
'CreateDate': datetime(2015, 1, 1),
'InstanceCounts': [
{
'InstanceCount': 123,
'State': 'available'|'sold'|'cancelled'|'pending'
},
],
'PriceSchedules': [
{
'Active': True|False,
'CurrencyCode': 'USD',
'Price': 123.0,
'Term': 123
},
],
'ReservedInstancesId': 'string',
'ReservedInstancesListingId': 'string',
'Status': 'active'|'pending'|'cancelled'|'closed',
'StatusMessage': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'UpdateDate': datetime(2015, 1, 1)
},
]
}
Response Structure
(dict) --
Contains the output of CreateReservedInstancesListing.
ReservedInstancesListings (list) --
Information about the Standard Reserved Instance listing.
(dict) --
Describes a Reserved Instance listing.
ClientToken (string) --
A unique, case-sensitive key supplied by the client to ensure that the request is idempotent. For more information, see Ensuring Idempotency .
CreateDate (datetime) --
The time the listing was created.
InstanceCounts (list) --
The number of instances in this state.
(dict) --
Describes a Reserved Instance listing state.
InstanceCount (integer) --
The number of listed Reserved Instances in the state specified by the state .
State (string) --
The states of the listed Reserved Instances.
PriceSchedules (list) --
The price of the Reserved Instance listing.
(dict) --
Describes the price for a Reserved Instance.
Active (boolean) --
The current price schedule, as determined by the term remaining for the Reserved Instance in the listing.
A specific price schedule is always in effect, but only one price schedule can be active at any time. Take, for example, a Reserved Instance listing that has five months remaining in its term. When you specify price schedules for five months and two months, this means that schedule 1, covering the first three months of the remaining term, will be active during months 5, 4, and 3. Then schedule 2, covering the last two months of the term, will be active for months 2 and 1.
CurrencyCode (string) --
The currency for transacting the Reserved Instance resale. At this time, the only supported currency is USD .
Price (float) --
The fixed price for the term.
Term (integer) --
The number of months remaining in the reservation. For example, 2 is the second to the last month before the capacity reservation expires.
ReservedInstancesId (string) --
The ID of the Reserved Instance.
ReservedInstancesListingId (string) --
The ID of the Reserved Instance listing.
Status (string) --
The status of the Reserved Instance listing.
StatusMessage (string) --
The reason for the current status of the Reserved Instance listing. The response can be blank.
Tags (list) --
Any tags assigned to the resource.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
UpdateDate (datetime) --
The last modified timestamp of the listing.
Creates a route in a route table within a VPC.
You must specify one of the following targets: internet gateway or virtual private gateway, NAT instance, NAT gateway, VPC peering connection, network interface, or egress-only internet gateway.
When determining how to route traffic, we use the route with the most specific match. For example, traffic is destined for the IPv4 address 192.0.2.3 , and the route table includes the following two IPv4 routes:
Both routes apply to the traffic destined for 192.0.2.3 . However, the second route in the list covers a smaller number of IP addresses and is therefore more specific, so we use that route to determine where to target the traffic.
For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_route(
DestinationCidrBlock='string',
DestinationIpv6CidrBlock='string',
DryRun=True|False,
EgressOnlyInternetGatewayId='string',
GatewayId='string',
InstanceId='string',
NatGatewayId='string',
TransitGatewayId='string',
NetworkInterfaceId='string',
RouteTableId='string',
VpcPeeringConnectionId='string'
)
[REQUIRED]
The ID of the route table for the route.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Examples
This example creates a route for the specified route table. The route matches all traffic (0.0.0.0/0) and routes it to the specified Internet gateway.
response = client.create_route(
DestinationCidrBlock='0.0.0.0/0',
GatewayId='igw-c0a643a9',
RouteTableId='rtb-22574640',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Creates a route table for the specified VPC. After you create a route table, you can add routes and associate the table with a subnet.
For more information, see Route Tables in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_route_table(
DryRun=True|False,
VpcId='string'
)
[REQUIRED]
The ID of the VPC.
dict
Response Syntax
{
'RouteTable': {
'Associations': [
{
'Main': True|False,
'RouteTableAssociationId': 'string',
'RouteTableId': 'string',
'SubnetId': 'string'
},
],
'PropagatingVgws': [
{
'GatewayId': 'string'
},
],
'RouteTableId': 'string',
'Routes': [
{
'DestinationCidrBlock': 'string',
'DestinationIpv6CidrBlock': 'string',
'DestinationPrefixListId': 'string',
'EgressOnlyInternetGatewayId': 'string',
'GatewayId': 'string',
'InstanceId': 'string',
'InstanceOwnerId': 'string',
'NatGatewayId': 'string',
'TransitGatewayId': 'string',
'NetworkInterfaceId': 'string',
'Origin': 'CreateRouteTable'|'CreateRoute'|'EnableVgwRoutePropagation',
'State': 'active'|'blackhole',
'VpcPeeringConnectionId': 'string'
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VpcId': 'string',
'OwnerId': 'string'
}
}
Response Structure
(dict) --
RouteTable (dict) --
Information about the route table.
Associations (list) --
The associations between the route table and one or more subnets.
(dict) --
Describes an association between a route table and a subnet.
Main (boolean) --
Indicates whether this is the main route table.
RouteTableAssociationId (string) --
The ID of the association between a route table and a subnet.
RouteTableId (string) --
The ID of the route table.
SubnetId (string) --
The ID of the subnet. A subnet ID is not returned for an implicit association.
PropagatingVgws (list) --
Any virtual private gateway (VGW) propagating routes.
(dict) --
Describes a virtual private gateway propagating route.
GatewayId (string) --
The ID of the virtual private gateway.
RouteTableId (string) --
The ID of the route table.
Routes (list) --
The routes in the route table.
(dict) --
Describes a route in a route table.
DestinationCidrBlock (string) --
The IPv4 CIDR block used for the destination match.
DestinationIpv6CidrBlock (string) --
The IPv6 CIDR block used for the destination match.
DestinationPrefixListId (string) --
The prefix of the AWS service.
EgressOnlyInternetGatewayId (string) --
The ID of the egress-only internet gateway.
GatewayId (string) --
The ID of a gateway attached to your VPC.
InstanceId (string) --
The ID of a NAT instance in your VPC.
InstanceOwnerId (string) --
The AWS account ID of the owner of the instance.
NatGatewayId (string) --
The ID of a NAT gateway.
TransitGatewayId (string) --
The ID of a transit gateway.
NetworkInterfaceId (string) --
The ID of the network interface.
Origin (string) --
Describes how the route was created.
State (string) --
The state of the route. The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, or the specified NAT instance has been terminated).
VpcPeeringConnectionId (string) --
The ID of a VPC peering connection.
Tags (list) --
Any tags assigned to the route table.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VpcId (string) --
The ID of the VPC.
OwnerId (string) --
The ID of the AWS account that owns the route table.
Examples
This example creates a route table for the specified VPC.
response = client.create_route_table(
VpcId='vpc-a01106c2',
)
print(response)
Expected Output:
{
'RouteTable': {
'Associations': [
],
'PropagatingVgws': [
],
'RouteTableId': 'rtb-22574640',
'Routes': [
{
'DestinationCidrBlock': '10.0.0.0/16',
'GatewayId': 'local',
'State': 'active',
},
],
'Tags': [
],
'VpcId': 'vpc-a01106c2',
},
'ResponseMetadata': {
'...': '...',
},
}
Creates a security group.
A security group acts as a virtual firewall for your instance to control inbound and outbound traffic. For more information, see Amazon EC2 Security Groups in the Amazon Elastic Compute Cloud User Guide and Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide .
When you create a security group, you specify a friendly name of your choice. You can have a security group for use in EC2-Classic with the same name as a security group for use in a VPC. However, you can't have two security groups for use in EC2-Classic with the same name or two security groups for use in a VPC with the same name.
You have a default security group for use in EC2-Classic and a default security group for use in your VPC. If you don't specify a security group when you launch an instance, the instance is launched into the appropriate default security group. A default security group includes a default rule that grants instances unrestricted network access to each other.
You can add or remove rules from your security groups using AuthorizeSecurityGroupIngress , AuthorizeSecurityGroupEgress , RevokeSecurityGroupIngress , and RevokeSecurityGroupEgress .
For more information about VPC security group limits, see Amazon VPC Limits .
See also: AWS API Documentation
Request Syntax
response = client.create_security_group(
Description='string',
GroupName='string',
VpcId='string',
DryRun=True|False
)
[REQUIRED]
A description for the security group. This is informational only.
Constraints: Up to 255 characters in length
Constraints for EC2-Classic: ASCII characters
Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*
[REQUIRED]
The name of the security group.
Constraints: Up to 255 characters in length. Cannot start with sg- .
Constraints for EC2-Classic: ASCII characters
Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*
dict
Response Syntax
{
'GroupId': 'string'
}
Response Structure
(dict) --
GroupId (string) --
The ID of the security group.
Creates a snapshot of an EBS volume and stores it in Amazon S3. You can use snapshots for backups, to make copies of EBS volumes, and to save data before shutting down an instance.
When a snapshot is created, any AWS Marketplace product codes that are associated with the source volume are propagated to the snapshot.
You can take a snapshot of an attached volume that is in use. However, snapshots only capture data that has been written to your EBS volume at the time the snapshot command is issued; this may exclude any data that has been cached by any applications or the operating system. If you can pause any file systems on the volume long enough to take a snapshot, your snapshot should be complete. However, if you cannot pause all file writes to the volume, you should unmount the volume from within the instance, issue the snapshot command, and then remount the volume to ensure a consistent and complete snapshot. You may remount and use your volume while the snapshot status is pending .
To create a snapshot for EBS volumes that serve as root devices, you should stop the instance before taking the snapshot.
Snapshots that are taken from encrypted volumes are automatically encrypted. Volumes that are created from encrypted snapshots are also automatically encrypted. Your encrypted volumes and any associated snapshots always remain protected.
You can tag your snapshots during creation. For more information, see Tagging Your Amazon EC2 Resources in the Amazon Elastic Compute Cloud User Guide .
For more information, see Amazon Elastic Block Store and Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_snapshot(
Description='string',
VolumeId='string',
TagSpecifications=[
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
DryRun=True|False
)
[REQUIRED]
The ID of the EBS volume.
The tags to apply to the snapshot during creation.
The tags to apply to a resource when the resource is being created.
The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
dict
Response Syntax
{
'DataEncryptionKeyId': 'string',
'Description': 'string',
'Encrypted': True|False,
'KmsKeyId': 'string',
'OwnerId': 'string',
'Progress': 'string',
'SnapshotId': 'string',
'StartTime': datetime(2015, 1, 1),
'State': 'pending'|'completed'|'error',
'StateMessage': 'string',
'VolumeId': 'string',
'VolumeSize': 123,
'OwnerAlias': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
Response Structure
(dict) --
Describes a snapshot.
DataEncryptionKeyId (string) --
The data encryption key identifier for the snapshot. This value is a unique identifier that corresponds to the data encryption key that was used to encrypt the original volume or snapshot copy. Because data encryption keys are inherited by volumes created from snapshots, and vice versa, if snapshots share the same data encryption key identifier, then they belong to the same volume/snapshot lineage. This parameter is only returned by DescribeSnapshots .
Description (string) --
The description for the snapshot.
Encrypted (boolean) --
Indicates whether the snapshot is encrypted.
KmsKeyId (string) --
The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the volume encryption key for the parent volume.
OwnerId (string) --
The AWS account ID of the EBS snapshot owner.
Progress (string) --
The progress of the snapshot, as a percentage.
SnapshotId (string) --
The ID of the snapshot. Each snapshot receives a unique identifier when it is created.
StartTime (datetime) --
The time stamp when the snapshot was initiated.
State (string) --
The snapshot state.
StateMessage (string) --
Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy operation fails (for example, if the proper AWS Key Management Service (AWS KMS) permissions are not obtained) this field displays error state details to help you diagnose why the error occurred. This parameter is only returned by DescribeSnapshots .
VolumeId (string) --
The ID of the volume that was used to create the snapshot. Snapshots created by the CopySnapshot action have an arbitrary volume ID that should not be used for any purpose.
VolumeSize (integer) --
The size of the volume, in GiB.
OwnerAlias (string) --
Value from an Amazon-maintained list (amazon | self | all | aws-marketplace | microsoft ) of snapshot owners. Not to be confused with the user-configured AWS account alias, which is set from the IAM console.
Tags (list) --
Any tags assigned to the snapshot.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Examples
This example creates a snapshot of the volume with a volume ID of vol-1234567890abcdef0 and a short description to identify the snapshot.
response = client.create_snapshot(
Description='This is my root volume snapshot.',
VolumeId='vol-1234567890abcdef0',
)
print(response)
Expected Output:
{
'Description': 'This is my root volume snapshot.',
'OwnerId': '012345678910',
'SnapshotId': 'snap-066877671789bd71b',
'StartTime': datetime(2014, 2, 28, 21, 6, 1, 4, 59, 0),
'State': 'pending',
'Tags': [
],
'VolumeId': 'vol-1234567890abcdef0',
'VolumeSize': 8,
'ResponseMetadata': {
'...': '...',
},
}
Creates crash-consistent snapshots of multiple EBS volumes and stores the data in S3. Volumes are chosen by specifying an instance. Any attached volumes will produce one snapshot each that is crash-consistent across the instance. Boot volumes can be excluded by changing the paramaters.
See also: AWS API Documentation
Request Syntax
response = client.create_snapshots(
Description='string',
InstanceSpecification={
'InstanceId': 'string',
'ExcludeBootVolume': True|False
},
TagSpecifications=[
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
DryRun=True|False,
CopyTagsFromSource='volume'
)
[REQUIRED]
The instance to specify which volumes should be included in the snapshots.
The instance to specify which volumes should be snapshotted.
Excludes the root volume from being snapshotted.
Tags to apply to every snapshot specified by the instance.
The tags to apply to a resource when the resource is being created.
The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
dict
Response Syntax
{
'Snapshots': [
{
'Description': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'Encrypted': True|False,
'VolumeId': 'string',
'State': 'pending'|'completed'|'error',
'VolumeSize': 123,
'StartTime': datetime(2015, 1, 1),
'Progress': 'string',
'OwnerId': 'string',
'SnapshotId': 'string'
},
]
}
Response Structure
(dict) --
Snapshots (list) --
List of snapshots.
(dict) --
Information about a snapshot.
Description (string) --
Description specified by the CreateSnapshotRequest that has been applied to all snapshots.
Tags (list) --
Tags associated with this snapshot.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Encrypted (boolean) --
Indicates whether the snapshot is encrypted.
VolumeId (string) --
Source volume from which this snapshot was created.
State (string) --
Current state of the snapshot.
VolumeSize (integer) --
Size of the volume from which this snapshot was created.
StartTime (datetime) --
Time this snapshot was started. This is the same for all snapshots initiated by the same request.
Progress (string) --
Progress this snapshot has made towards completing.
OwnerId (string) --
Account id used when creating this snapshot.
SnapshotId (string) --
Snapshot id that can be used to describe this snapshot.
Creates a data feed for Spot Instances, enabling you to view Spot Instance usage logs. You can create one data feed per AWS account. For more information, see Spot Instance Data Feed in the Amazon EC2 User Guide for Linux Instances .
See also: AWS API Documentation
Request Syntax
response = client.create_spot_datafeed_subscription(
Bucket='string',
DryRun=True|False,
Prefix='string'
)
[REQUIRED]
The Amazon S3 bucket in which to store the Spot Instance data feed.
dict
Response Syntax
{
'SpotDatafeedSubscription': {
'Bucket': 'string',
'Fault': {
'Code': 'string',
'Message': 'string'
},
'OwnerId': 'string',
'Prefix': 'string',
'State': 'Active'|'Inactive'
}
}
Response Structure
(dict) --
Contains the output of CreateSpotDatafeedSubscription.
SpotDatafeedSubscription (dict) --
The Spot Instance data feed subscription.
Bucket (string) --
The Amazon S3 bucket where the Spot Instance data feed is located.
Fault (dict) --
The fault codes for the Spot Instance request, if any.
Code (string) --
The reason code for the Spot Instance state change.
Message (string) --
The message for the Spot Instance state change.
OwnerId (string) --
The AWS account ID of the account.
Prefix (string) --
The prefix that is prepended to data feed files.
State (string) --
The state of the Spot Instance data feed subscription.
Examples
This example creates a Spot Instance data feed for your AWS account.
response = client.create_spot_datafeed_subscription(
Bucket='my-s3-bucket',
Prefix='spotdata',
)
print(response)
Expected Output:
{
'SpotDatafeedSubscription': {
'Bucket': 'my-s3-bucket',
'OwnerId': '123456789012',
'Prefix': 'spotdata',
'State': 'Active',
},
'ResponseMetadata': {
'...': '...',
},
}
Creates a subnet in an existing VPC.
When you create each subnet, you provide the VPC ID and IPv4 CIDR block for the subnet. After you create a subnet, you can't change its CIDR block. The size of the subnet's IPv4 CIDR block can be the same as a VPC's IPv4 CIDR block, or a subset of a VPC's IPv4 CIDR block. If you create more than one subnet in a VPC, the subnets' CIDR blocks must not overlap. The smallest IPv4 subnet (and VPC) you can create uses a /28 netmask (16 IPv4 addresses), and the largest uses a /16 netmask (65,536 IPv4 addresses).
If you've associated an IPv6 CIDR block with your VPC, you can create a subnet with an IPv6 CIDR block that uses a /64 prefix length.
Warning
AWS reserves both the first four and the last IPv4 address in each subnet's CIDR block. They're not available for use.
If you add more than one subnet to a VPC, they're set up in a star topology with a logical router in the middle.
If you launch an instance in a VPC using an Amazon EBS-backed AMI, the IP address doesn't change if you stop and restart the instance (unlike a similar instance launched outside a VPC, which gets a new IP address when restarted). It's therefore possible to have a subnet with no running instances (they're all stopped), but no remaining IP addresses available.
For more information about subnets, see Your VPC and Subnets in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_subnet(
AvailabilityZone='string',
AvailabilityZoneId='string',
CidrBlock='string',
Ipv6CidrBlock='string',
VpcId='string',
DryRun=True|False
)
The Availability Zone for the subnet.
Default: AWS selects one for you. If you create more than one subnet in your VPC, we may not necessarily select a different zone for each subnet.
[REQUIRED]
The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24 .
[REQUIRED]
The ID of the VPC.
dict
Response Syntax
{
'Subnet': {
'AvailabilityZone': 'string',
'AvailabilityZoneId': 'string',
'AvailableIpAddressCount': 123,
'CidrBlock': 'string',
'DefaultForAz': True|False,
'MapPublicIpOnLaunch': True|False,
'State': 'pending'|'available',
'SubnetId': 'string',
'VpcId': 'string',
'OwnerId': 'string',
'AssignIpv6AddressOnCreation': True|False,
'Ipv6CidrBlockAssociationSet': [
{
'AssociationId': 'string',
'Ipv6CidrBlock': 'string',
'Ipv6CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
}
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'SubnetArn': 'string'
}
}
Response Structure
(dict) --
Subnet (dict) --
Information about the subnet.
AvailabilityZone (string) --
The Availability Zone of the subnet.
AvailabilityZoneId (string) --
The AZ ID of the subnet.
AvailableIpAddressCount (integer) --
The number of unused private IPv4 addresses in the subnet. The IPv4 addresses for any stopped instances are considered unavailable.
CidrBlock (string) --
The IPv4 CIDR block assigned to the subnet.
DefaultForAz (boolean) --
Indicates whether this is the default subnet for the Availability Zone.
MapPublicIpOnLaunch (boolean) --
Indicates whether instances launched in this subnet receive a public IPv4 address.
State (string) --
The current state of the subnet.
SubnetId (string) --
The ID of the subnet.
VpcId (string) --
The ID of the VPC the subnet is in.
OwnerId (string) --
The ID of the AWS account that owns the subnet.
AssignIpv6AddressOnCreation (boolean) --
Indicates whether a network interface created in this subnet (including a network interface created by RunInstances ) receives an IPv6 address.
Ipv6CidrBlockAssociationSet (list) --
Information about the IPv6 CIDR blocks associated with the subnet.
(dict) --
Describes an IPv6 CIDR block associated with a subnet.
AssociationId (string) --
The association ID for the CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
Ipv6CidrBlockState (dict) --
Information about the state of the CIDR block.
State (string) --
The state of a CIDR block.
StatusMessage (string) --
A message about the status of the CIDR block, if applicable.
Tags (list) --
Any tags assigned to the subnet.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
SubnetArn (string) --
The Amazon Resource Name (ARN) of the subnet.
Examples
This example creates a subnet in the specified VPC with the specified CIDR block. We recommend that you let us select an Availability Zone for you.
response = client.create_subnet(
CidrBlock='10.0.1.0/24',
VpcId='vpc-a01106c2',
)
print(response)
Expected Output:
{
'Subnet': {
'AvailabilityZone': 'us-west-2c',
'AvailableIpAddressCount': 251,
'CidrBlock': '10.0.1.0/24',
'State': 'pending',
'SubnetId': 'subnet-9d4a7b6c',
'VpcId': 'vpc-a01106c2',
},
'ResponseMetadata': {
'...': '...',
},
}
Adds or overwrites the specified tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide . For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_tags(
DryRun=True|False,
Resources=[
'string',
],
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The IDs of the resources, separated by spaces.
Constraints: Up to 1000 resource IDs. We recommend breaking up this request into smaller batches.
[REQUIRED]
The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
None
Examples
This example adds the tag Stack=production to the specified image, or overwrites an existing tag for the AMI where the tag key is Stack.
response = client.create_tags(
Resources=[
'ami-78a54011',
],
Tags=[
{
'Key': 'Stack',
'Value': 'production',
},
],
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Creates a Traffic Mirror filter.
A Traffic Mirror filter is a set of rules that defines the traffic to mirror.
By default, no traffic is mirrored. To mirror traffic, use CreateTrafficMirrorFilterRule to add Traffic Mirror rules to the filter. The rules you add define what traffic gets mirrored. You can also use ModifyTrafficMirrorFilterNetworkServices to mirror supported network services.
See also: AWS API Documentation
Request Syntax
response = client.create_traffic_mirror_filter(
Description='string',
TagSpecifications=[
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
DryRun=True|False,
ClientToken='string'
)
The tags to assign to a Traffic Mirror filter.
The tags to apply to a resource when the resource is being created.
The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency .
This field is autopopulated if not provided.
dict
Response Syntax
{
'TrafficMirrorFilter': {
'TrafficMirrorFilterId': 'string',
'IngressFilterRules': [
{
'TrafficMirrorFilterRuleId': 'string',
'TrafficMirrorFilterId': 'string',
'TrafficDirection': 'ingress'|'egress',
'RuleNumber': 123,
'RuleAction': 'accept'|'reject',
'Protocol': 123,
'DestinationPortRange': {
'FromPort': 123,
'ToPort': 123
},
'SourcePortRange': {
'FromPort': 123,
'ToPort': 123
},
'DestinationCidrBlock': 'string',
'SourceCidrBlock': 'string',
'Description': 'string'
},
],
'EgressFilterRules': [
{
'TrafficMirrorFilterRuleId': 'string',
'TrafficMirrorFilterId': 'string',
'TrafficDirection': 'ingress'|'egress',
'RuleNumber': 123,
'RuleAction': 'accept'|'reject',
'Protocol': 123,
'DestinationPortRange': {
'FromPort': 123,
'ToPort': 123
},
'SourcePortRange': {
'FromPort': 123,
'ToPort': 123
},
'DestinationCidrBlock': 'string',
'SourceCidrBlock': 'string',
'Description': 'string'
},
],
'NetworkServices': [
'amazon-dns',
],
'Description': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
'ClientToken': 'string'
}
Response Structure
(dict) --
TrafficMirrorFilter (dict) --
Information about the Traffic Mirror filter.
TrafficMirrorFilterId (string) --
The ID of the Traffic Mirror filter.
IngressFilterRules (list) --
Information about the ingress rules that are associated with the Traffic Mirror filter.
(dict) --
Describes the Traffic Mirror rule.
TrafficMirrorFilterRuleId (string) --
The ID of the Traffic Mirror rule.
TrafficMirrorFilterId (string) --
The ID of the Traffic Mirror filter that the rule is associated with.
TrafficDirection (string) --
The traffic direction assigned to the Traffic Mirror rule.
RuleNumber (integer) --
The rule number of the Traffic Mirror rule.
RuleAction (string) --
The action assigned to the Traffic Mirror rule.
Protocol (integer) --
The protocol assigned to the Traffic Mirror rule.
DestinationPortRange (dict) --
The destination port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
SourcePortRange (dict) --
The source port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
DestinationCidrBlock (string) --
The destination CIDR block assigned to the Traffic Mirror rule.
SourceCidrBlock (string) --
The source CIDR block assigned to the Traffic Mirror rule.
Description (string) --
The description of the Traffic Mirror rule.
EgressFilterRules (list) --
Information about the egress rules that are associated with the Traffic Mirror filter.
(dict) --
Describes the Traffic Mirror rule.
TrafficMirrorFilterRuleId (string) --
The ID of the Traffic Mirror rule.
TrafficMirrorFilterId (string) --
The ID of the Traffic Mirror filter that the rule is associated with.
TrafficDirection (string) --
The traffic direction assigned to the Traffic Mirror rule.
RuleNumber (integer) --
The rule number of the Traffic Mirror rule.
RuleAction (string) --
The action assigned to the Traffic Mirror rule.
Protocol (integer) --
The protocol assigned to the Traffic Mirror rule.
DestinationPortRange (dict) --
The destination port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
SourcePortRange (dict) --
The source port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
DestinationCidrBlock (string) --
The destination CIDR block assigned to the Traffic Mirror rule.
SourceCidrBlock (string) --
The source CIDR block assigned to the Traffic Mirror rule.
Description (string) --
The description of the Traffic Mirror rule.
NetworkServices (list) --
The network service traffic that is associated with the Traffic Mirror filter.
Description (string) --
The description of the Traffic Mirror filter.
Tags (list) --
The tags assigned to the Traffic Mirror filter.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
ClientToken (string) --
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency .
Creates a Traffic Mirror rule.
A Traffic Mirror rule defines the Traffic Mirror source traffic to mirror.
You need the Traffic Mirror filter ID when you create the rule.
See also: AWS API Documentation
Request Syntax
response = client.create_traffic_mirror_filter_rule(
TrafficMirrorFilterId='string',
TrafficDirection='ingress'|'egress',
RuleNumber=123,
RuleAction='accept'|'reject',
DestinationPortRange={
'FromPort': 123,
'ToPort': 123
},
SourcePortRange={
'FromPort': 123,
'ToPort': 123
},
Protocol=123,
DestinationCidrBlock='string',
SourceCidrBlock='string',
Description='string',
DryRun=True|False,
ClientToken='string'
)
[REQUIRED]
The ID of the filter that this rule is associated with.
[REQUIRED]
The type of traffic (ingress | egress ).
[REQUIRED]
The number of the Traffic Mirror rule. This number must be unique for each Traffic Mirror rule in a given direction. The rules are processed in ascending order by rule number.
[REQUIRED]
The action to take (accept | reject ) on the filtered traffic.
The destination port range.
The first port in the Traffic Mirror port range. This applies to the TCP and UDP protocols.
The last port in the Traffic Mirror port range. This applies to the TCP and UDP protocols.
The source port range.
The first port in the Traffic Mirror port range. This applies to the TCP and UDP protocols.
The last port in the Traffic Mirror port range. This applies to the TCP and UDP protocols.
The protocol, for example UDP, to assign to the Traffic Mirror rule.
For information about the protocol value, see Protocol Numbers on the Internet Assigned Numbers Authority (IANA) website.
[REQUIRED]
The destination CIDR block to assign to the Traffic Mirror rule.
[REQUIRED]
The source CIDR block to assign to the Traffic Mirror rule.
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency .
This field is autopopulated if not provided.
dict
Response Syntax
{
'TrafficMirrorFilterRule': {
'TrafficMirrorFilterRuleId': 'string',
'TrafficMirrorFilterId': 'string',
'TrafficDirection': 'ingress'|'egress',
'RuleNumber': 123,
'RuleAction': 'accept'|'reject',
'Protocol': 123,
'DestinationPortRange': {
'FromPort': 123,
'ToPort': 123
},
'SourcePortRange': {
'FromPort': 123,
'ToPort': 123
},
'DestinationCidrBlock': 'string',
'SourceCidrBlock': 'string',
'Description': 'string'
},
'ClientToken': 'string'
}
Response Structure
(dict) --
TrafficMirrorFilterRule (dict) --
The Traffic Mirror rule.
TrafficMirrorFilterRuleId (string) --
The ID of the Traffic Mirror rule.
TrafficMirrorFilterId (string) --
The ID of the Traffic Mirror filter that the rule is associated with.
TrafficDirection (string) --
The traffic direction assigned to the Traffic Mirror rule.
RuleNumber (integer) --
The rule number of the Traffic Mirror rule.
RuleAction (string) --
The action assigned to the Traffic Mirror rule.
Protocol (integer) --
The protocol assigned to the Traffic Mirror rule.
DestinationPortRange (dict) --
The destination port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
SourcePortRange (dict) --
The source port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
DestinationCidrBlock (string) --
The destination CIDR block assigned to the Traffic Mirror rule.
SourceCidrBlock (string) --
The source CIDR block assigned to the Traffic Mirror rule.
Description (string) --
The description of the Traffic Mirror rule.
ClientToken (string) --
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency .
Creates a Traffic Mirror session.
A Traffic Mirror session actively copies packets from a Traffic Mirror source to a Traffic Mirror target. Create a filter, and then assign it to the session to define a subset of the traffic to mirror, for example all TCP traffic.
The Traffic Mirror source and the Traffic Mirror target (monitoring appliances) can be in the same VPC, or in a different VPC connected via VPC peering or a transit gateway.
By default, no traffic is mirrored. Use CreateTrafficMirrorFilter to create filter rules that specify the traffic to mirror.
See also: AWS API Documentation
Request Syntax
response = client.create_traffic_mirror_session(
NetworkInterfaceId='string',
TrafficMirrorTargetId='string',
TrafficMirrorFilterId='string',
PacketLength=123,
SessionNumber=123,
VirtualNetworkId=123,
Description='string',
TagSpecifications=[
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
DryRun=True|False,
ClientToken='string'
)
[REQUIRED]
The ID of the source network interface.
[REQUIRED]
The ID of the Traffic Mirror target.
[REQUIRED]
The ID of the Traffic Mirror filter.
The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror. For example, if you set this value to 1network0, then the first 100 bytes that meet the filter criteria are copied to the target.
If you do not want to mirror the entire packet, use the PacketLength parameter to specify the number of bytes in each packet to mirror.
[REQUIRED]
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
Valid values are 1-32766.
The tags to assign to a Traffic Mirror session.
The tags to apply to a resource when the resource is being created.
The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency .
This field is autopopulated if not provided.
dict
Response Syntax
{
'TrafficMirrorSession': {
'TrafficMirrorSessionId': 'string',
'TrafficMirrorTargetId': 'string',
'TrafficMirrorFilterId': 'string',
'NetworkInterfaceId': 'string',
'OwnerId': 'string',
'PacketLength': 123,
'SessionNumber': 123,
'VirtualNetworkId': 123,
'Description': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
'ClientToken': 'string'
}
Response Structure
(dict) --
TrafficMirrorSession (dict) --
Information about the Traffic Mirror session.
TrafficMirrorSessionId (string) --
The ID for the Traffic Mirror session.
TrafficMirrorTargetId (string) --
The ID of the Traffic Mirror target.
TrafficMirrorFilterId (string) --
The ID of the Traffic Mirror filter.
NetworkInterfaceId (string) --
The ID of the Traffic Mirror session's network interface.
OwnerId (string) --
The ID of the account that owns the Traffic Mirror session.
PacketLength (integer) --
The number of bytes in each packet to mirror. These are the bytes after the VXLAN header. To mirror a subset, set this to the length (in bytes) to mirror. For example, if you set this value to 100, then the first 100 bytes that meet the filter criteria are copied to the target. Do not specify this parameter when you want to mirror the entire packet
SessionNumber (integer) --
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
Valid values are 1-32766.
VirtualNetworkId (integer) --
The virtual network ID associated with the Traffic Mirror session.
Description (string) --
The description of the Traffic Mirror session.
Tags (list) --
The tags assigned to the Traffic Mirror session.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
ClientToken (string) --
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency .
Creates a target for your Traffic Mirror session.
A Traffic Mirror target is the destination for mirrored traffic. The Traffic Mirror source and the Traffic Mirror target (monitoring appliances) can be in the same VPC, or in different VPCs connected via VPC peering or a transit gateway.
A Traffic Mirror target can be a network interface, or a Network Load Balancer.
To use the target in a Traffic Mirror session, use CreateTrafficMirrorSession .
See also: AWS API Documentation
Request Syntax
response = client.create_traffic_mirror_target(
NetworkInterfaceId='string',
NetworkLoadBalancerArn='string',
Description='string',
TagSpecifications=[
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
DryRun=True|False,
ClientToken='string'
)
The tags to assign to the Traffic Mirror target.
The tags to apply to a resource when the resource is being created.
The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency .
This field is autopopulated if not provided.
dict
Response Syntax
{
'TrafficMirrorTarget': {
'TrafficMirrorTargetId': 'string',
'NetworkInterfaceId': 'string',
'NetworkLoadBalancerArn': 'string',
'Type': 'network-interface'|'network-load-balancer',
'Description': 'string',
'OwnerId': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
'ClientToken': 'string'
}
Response Structure
(dict) --
TrafficMirrorTarget (dict) --
Information about the Traffic Mirror target.
TrafficMirrorTargetId (string) --
The ID of the Traffic Mirror target.
NetworkInterfaceId (string) --
The network interface ID that is attached to the target.
NetworkLoadBalancerArn (string) --
The Amazon Resource Name (ARN) of the Network Load Balancer.
Type (string) --
The type of Traffic Mirror target.
Description (string) --
Information about the Traffic Mirror target.
OwnerId (string) --
The ID of the account that owns the Traffic Mirror target.
Tags (list) --
The tags assigned to the Traffic Mirror target.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
ClientToken (string) --
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency .
Creates a transit gateway.
You can use a transit gateway to interconnect your virtual private clouds (VPC) and on-premises networks. After the transit gateway enters the available state, you can attach your VPCs and VPN connections to the transit gateway.
To attach your VPCs, use CreateTransitGatewayVpcAttachment .
To attach a VPN connection, use CreateCustomerGateway to create a customer gateway and specify the ID of the customer gateway and the ID of the transit gateway in a call to CreateVpnConnection .
When you create a transit gateway, we create a default transit gateway route table and use it as the default association route table and the default propagation route table. You can use CreateTransitGatewayRouteTable to create additional transit gateway route tables. If you disable automatic route propagation, we do not create a default transit gateway route table. You can use EnableTransitGatewayRouteTablePropagation to propagate routes from a resource attachment to a transit gateway route table. If you disable automatic associations, you can use AssociateTransitGatewayRouteTable to associate a resource attachment with a transit gateway route table.
See also: AWS API Documentation
Request Syntax
response = client.create_transit_gateway(
Description='string',
Options={
'AmazonSideAsn': 123,
'AutoAcceptSharedAttachments': 'enable'|'disable',
'DefaultRouteTableAssociation': 'enable'|'disable',
'DefaultRouteTablePropagation': 'enable'|'disable',
'VpnEcmpSupport': 'enable'|'disable',
'DnsSupport': 'enable'|'disable'
},
TagSpecifications=[
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
DryRun=True|False
)
The transit gateway options.
A private Autonomous System Number (ASN) for the Amazon side of a BGP session. The range is 64512 to 65534 for 16-bit ASNs and 4200000000 to 4294967294 for 32-bit ASNs.
Enable or disable automatic acceptance of attachment requests. The default is disable .
Enable or disable automatic association with the default association route table. The default is enable .
Enable or disable automatic propagation of routes to the default propagation route table. The default is enable .
Enable or disable Equal Cost Multipath Protocol support.
Enable or disable DNS support.
The tags to apply to the transit gateway.
The tags to apply to a resource when the resource is being created.
The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
dict
Response Syntax
{
'TransitGateway': {
'TransitGatewayId': 'string',
'TransitGatewayArn': 'string',
'State': 'pending'|'available'|'modifying'|'deleting'|'deleted',
'OwnerId': 'string',
'Description': 'string',
'CreationTime': datetime(2015, 1, 1),
'Options': {
'AmazonSideAsn': 123,
'AutoAcceptSharedAttachments': 'enable'|'disable',
'DefaultRouteTableAssociation': 'enable'|'disable',
'AssociationDefaultRouteTableId': 'string',
'DefaultRouteTablePropagation': 'enable'|'disable',
'PropagationDefaultRouteTableId': 'string',
'VpnEcmpSupport': 'enable'|'disable',
'DnsSupport': 'enable'|'disable'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
TransitGateway (dict) --
Information about the transit gateway.
TransitGatewayId (string) --
The ID of the transit gateway.
TransitGatewayArn (string) --
The Amazon Resource Name (ARN) of the transit gateway.
State (string) --
The state of the transit gateway.
OwnerId (string) --
The ID of the AWS account ID that owns the transit gateway.
Description (string) --
The description of the transit gateway.
CreationTime (datetime) --
The creation time.
Options (dict) --
The transit gateway options.
AmazonSideAsn (integer) --
A private Autonomous System Number (ASN) for the Amazon side of a BGP session. The range is 64512 to 65534 for 16-bit ASNs and 4200000000 to 4294967294 for 32-bit ASNs.
AutoAcceptSharedAttachments (string) --
Indicates whether attachment requests are automatically accepted.
DefaultRouteTableAssociation (string) --
Indicates whether resource attachments are automatically associated with the default association route table.
AssociationDefaultRouteTableId (string) --
The ID of the default association route table.
DefaultRouteTablePropagation (string) --
Indicates whether resource attachments automatically propagate routes to the default propagation route table.
PropagationDefaultRouteTableId (string) --
The ID of the default propagation route table.
VpnEcmpSupport (string) --
Indicates whether Equal Cost Multipath Protocol support is enabled.
DnsSupport (string) --
Indicates whether DNS support is enabled.
Tags (list) --
The tags for the transit gateway.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Creates a static route for the specified transit gateway route table.
See also: AWS API Documentation
Request Syntax
response = client.create_transit_gateway_route(
DestinationCidrBlock='string',
TransitGatewayRouteTableId='string',
TransitGatewayAttachmentId='string',
Blackhole=True|False,
DryRun=True|False
)
[REQUIRED]
The CIDR range used for destination matches. Routing decisions are based on the most specific match.
[REQUIRED]
The ID of the transit gateway route table.
dict
Response Syntax
{
'Route': {
'DestinationCidrBlock': 'string',
'TransitGatewayAttachments': [
{
'ResourceId': 'string',
'TransitGatewayAttachmentId': 'string',
'ResourceType': 'vpc'|'vpn'|'direct-connect-gateway'
},
],
'Type': 'static'|'propagated',
'State': 'pending'|'active'|'blackhole'|'deleting'|'deleted'
}
}
Response Structure
(dict) --
Route (dict) --
Information about the route.
DestinationCidrBlock (string) --
The CIDR block used for destination matches.
TransitGatewayAttachments (list) --
The attachments.
(dict) --
Describes a route attachment.
ResourceId (string) --
The ID of the resource.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
ResourceType (string) --
The resource type.
Type (string) --
The route type.
State (string) --
The state of the route.
Creates a route table for the specified transit gateway.
See also: AWS API Documentation
Request Syntax
response = client.create_transit_gateway_route_table(
TransitGatewayId='string',
TagSpecifications=[
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
DryRun=True|False
)
[REQUIRED]
The ID of the transit gateway.
The tags to apply to the transit gateway route table.
The tags to apply to a resource when the resource is being created.
The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
dict
Response Syntax
{
'TransitGatewayRouteTable': {
'TransitGatewayRouteTableId': 'string',
'TransitGatewayId': 'string',
'State': 'pending'|'available'|'deleting'|'deleted',
'DefaultAssociationRouteTable': True|False,
'DefaultPropagationRouteTable': True|False,
'CreationTime': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
TransitGatewayRouteTable (dict) --
Information about the transit gateway route table.
TransitGatewayRouteTableId (string) --
The ID of the transit gateway route table.
TransitGatewayId (string) --
The ID of the transit gateway.
State (string) --
The state of the transit gateway route table.
DefaultAssociationRouteTable (boolean) --
Indicates whether this is the default association route table for the transit gateway.
DefaultPropagationRouteTable (boolean) --
Indicates whether this is the default propagation route table for the transit gateway.
CreationTime (datetime) --
The creation time.
Tags (list) --
Any tags assigned to the route table.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Attaches the specified VPC to the specified transit gateway.
If you attach a VPC with a CIDR range that overlaps the CIDR range of a VPC that is already attached, the new VPC CIDR range is not propagated to the default propagation route table.
To send VPC traffic to an attached transit gateway, add a route to the VPC route table using CreateRoute .
See also: AWS API Documentation
Request Syntax
response = client.create_transit_gateway_vpc_attachment(
TransitGatewayId='string',
VpcId='string',
SubnetIds=[
'string',
],
Options={
'DnsSupport': 'enable'|'disable',
'Ipv6Support': 'enable'|'disable'
},
TagSpecifications=[
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
DryRun=True|False
)
[REQUIRED]
The ID of the transit gateway.
[REQUIRED]
The ID of the VPC.
[REQUIRED]
The IDs of one or more subnets. You can specify only one subnet per Availability Zone. You must specify at least one subnet, but we recommend that you specify two subnets for better availability. The transit gateway uses one IP address from each specified subnet.
The VPC attachment options.
Enable or disable DNS support. The default is enable .
Enable or disable IPv6 support. The default is enable .
The tags to apply to the VPC attachment.
The tags to apply to a resource when the resource is being created.
The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
dict
Response Syntax
{
'TransitGatewayVpcAttachment': {
'TransitGatewayAttachmentId': 'string',
'TransitGatewayId': 'string',
'VpcId': 'string',
'VpcOwnerId': 'string',
'State': 'pendingAcceptance'|'rollingBack'|'pending'|'available'|'modifying'|'deleting'|'deleted'|'failed'|'rejected'|'rejecting'|'failing',
'SubnetIds': [
'string',
],
'CreationTime': datetime(2015, 1, 1),
'Options': {
'DnsSupport': 'enable'|'disable',
'Ipv6Support': 'enable'|'disable'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
TransitGatewayVpcAttachment (dict) --
Information about the VPC attachment.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
TransitGatewayId (string) --
The ID of the transit gateway.
VpcId (string) --
The ID of the VPC.
VpcOwnerId (string) --
The ID of the AWS account that owns the VPC.
State (string) --
The state of the VPC attachment.
SubnetIds (list) --
The IDs of the subnets.
CreationTime (datetime) --
The creation time.
Options (dict) --
The VPC attachment options.
DnsSupport (string) --
Indicates whether DNS support is enabled.
Ipv6Support (string) --
Indicates whether IPv6 support is enabled.
Tags (list) --
The tags for the VPC attachment.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Creates an EBS volume that can be attached to an instance in the same Availability Zone. The volume is created in the regional endpoint that you send the HTTP request to. For more information see Regions and Endpoints .
You can create a new empty volume or restore a volume from an EBS snapshot. Any AWS Marketplace product codes from the snapshot are propagated to the volume.
You can create encrypted volumes. Encrypted volumes must be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are also automatically encrypted. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
You can tag your volumes during creation. For more information, see Tagging Your Amazon EC2 Resources in the Amazon Elastic Compute Cloud User Guide .
For more information, see Creating an Amazon EBS Volume in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_volume(
AvailabilityZone='string',
Encrypted=True|False,
Iops=123,
KmsKeyId='string',
Size=123,
SnapshotId='string',
VolumeType='standard'|'io1'|'gp2'|'sc1'|'st1',
DryRun=True|False,
TagSpecifications=[
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
]
)
[REQUIRED]
The Availability Zone in which to create the volume.
Specifies whether the volume should be encrypted. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Encryption by Default in the Amazon Elastic Compute Cloud User Guide .
Encrypted Amazon EBS volumes must be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
The number of I/O operations per second (IOPS) to provision for the volume, with a maximum ratio of 50 IOPS/GiB. Range is 100 to 64,000 IOPS for volumes in most Regions. Maximum IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
This parameter is valid only for Provisioned IOPS SSD (io1) volumes.
The identifier of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use for Amazon EBS encryption. If this parameter is not specified, your AWS managed CMK for EBS is used. If KmsKeyId is specified, the encrypted state must be true .
You can specify the CMK using any of the following:
AWS authenticates the CMK asynchronously. Therefore, if you specify an ID, alias, or ARN that is not valid, the action can appear to complete, but eventually fails.
The size of the volume, in GiBs.
Constraints: 1-16,384 for gp2 , 4-16,384 for io1 , 500-16,384 for st1 , 500-16,384 for sc1 , and 1-1,024 for standard . If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Note
At least one of Size or SnapshotId is required.
The snapshot from which to create the volume.
Note
At least one of Size or SnapshotId are required.
The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.
Defaults: If no volume type is specified, the default is standard in us-east-1, eu-west-1, eu-central-1, us-west-2, us-west-1, sa-east-1, ap-northeast-1, ap-northeast-2, ap-southeast-1, ap-southeast-2, ap-south-1, us-gov-west-1, and cn-north-1. In all other Regions, EBS defaults to gp2 .
The tags to apply to the volume during creation.
The tags to apply to a resource when the resource is being created.
The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
dict
Response Syntax
{
'Attachments': [
{
'AttachTime': datetime(2015, 1, 1),
'Device': 'string',
'InstanceId': 'string',
'State': 'attaching'|'attached'|'detaching'|'detached'|'busy',
'VolumeId': 'string',
'DeleteOnTermination': True|False
},
],
'AvailabilityZone': 'string',
'CreateTime': datetime(2015, 1, 1),
'Encrypted': True|False,
'KmsKeyId': 'string',
'Size': 123,
'SnapshotId': 'string',
'State': 'creating'|'available'|'in-use'|'deleting'|'deleted'|'error',
'VolumeId': 'string',
'Iops': 123,
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1'
}
Response Structure
(dict) --
Describes a volume.
Attachments (list) --
Information about the volume attachments.
(dict) --
Describes volume attachment details.
AttachTime (datetime) --
The time stamp when the attachment initiated.
Device (string) --
The device name.
InstanceId (string) --
The ID of the instance.
State (string) --
The attachment state of the volume.
VolumeId (string) --
The ID of the volume.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
AvailabilityZone (string) --
The Availability Zone for the volume.
CreateTime (datetime) --
The time stamp when volume creation was initiated.
Encrypted (boolean) --
Indicates whether the volume is encrypted.
KmsKeyId (string) --
The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the volume encryption key for the volume.
Size (integer) --
The size of the volume, in GiBs.
SnapshotId (string) --
The snapshot from which the volume was created, if applicable.
State (string) --
The volume state.
VolumeId (string) --
The ID of the volume.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports. For Provisioned IOPS SSD volumes, this represents the number of IOPS that are provisioned for the volume. For General Purpose SSD volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes, in most Regions. The maximum IOPS for io1 of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS.
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
Tags (list) --
Any tags assigned to the volume.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VolumeType (string) --
The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.
Examples
This example creates an 80 GiB General Purpose (SSD) volume in the Availability Zone us-east-1a.
response = client.create_volume(
AvailabilityZone='us-east-1a',
Size=80,
VolumeType='gp2',
)
print(response)
Expected Output:
{
'AvailabilityZone': 'us-east-1a',
'CreateTime': datetime(2016, 8, 29, 18, 52, 32, 0, 242, 0),
'Encrypted': False,
'Iops': 240,
'Size': 80,
'SnapshotId': '',
'State': 'creating',
'VolumeId': 'vol-6b60b7c7',
'VolumeType': 'gp2',
'ResponseMetadata': {
'...': '...',
},
}
This example creates a new Provisioned IOPS (SSD) volume with 1000 provisioned IOPS from a snapshot in the Availability Zone us-east-1a.
response = client.create_volume(
AvailabilityZone='us-east-1a',
Iops=1000,
SnapshotId='snap-066877671789bd71b',
VolumeType='io1',
)
print(response)
Expected Output:
{
'Attachments': [
],
'AvailabilityZone': 'us-east-1a',
'CreateTime': datetime(2016, 8, 29, 18, 52, 32, 0, 242, 0),
'Iops': 1000,
'Size': 500,
'SnapshotId': 'snap-066877671789bd71b',
'State': 'creating',
'Tags': [
],
'VolumeId': 'vol-1234567890abcdef0',
'VolumeType': 'io1',
'ResponseMetadata': {
'...': '...',
},
}
Creates a VPC with the specified IPv4 CIDR block. The smallest VPC you can create uses a /28 netmask (16 IPv4 addresses), and the largest uses a /16 netmask (65,536 IPv4 addresses). For more information about how large to make your VPC, see Your VPC and Subnets in the Amazon Virtual Private Cloud User Guide .
You can optionally request an Amazon-provided IPv6 CIDR block for the VPC. The IPv6 CIDR block uses a /56 prefix length, and is allocated from Amazon's pool of IPv6 addresses. You cannot choose the IPv6 range for your VPC.
By default, each instance you launch in the VPC has the default DHCP options, which include only a default DNS server that we provide (AmazonProvidedDNS). For more information, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide .
You can specify the instance tenancy value for the VPC when you create it. You can't change this value for the VPC after you create it. For more information, see Dedicated Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_vpc(
CidrBlock='string',
AmazonProvidedIpv6CidrBlock=True|False,
DryRun=True|False,
InstanceTenancy='default'|'dedicated'|'host'
)
[REQUIRED]
The IPv4 network range for the VPC, in CIDR notation. For example, 10.0.0.0/16 .
The tenancy options for instances launched into the VPC. For default , instances are launched with shared tenancy by default. You can launch instances with any tenancy into a shared tenancy VPC. For dedicated , instances are launched as dedicated tenancy instances by default. You can only launch instances with a tenancy of dedicated or host into a dedicated tenancy VPC.
Important: The host value cannot be used with this parameter. Use the default or dedicated values only.
Default: default
dict
Response Syntax
{
'Vpc': {
'CidrBlock': 'string',
'DhcpOptionsId': 'string',
'State': 'pending'|'available',
'VpcId': 'string',
'OwnerId': 'string',
'InstanceTenancy': 'default'|'dedicated'|'host',
'Ipv6CidrBlockAssociationSet': [
{
'AssociationId': 'string',
'Ipv6CidrBlock': 'string',
'Ipv6CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
}
},
],
'CidrBlockAssociationSet': [
{
'AssociationId': 'string',
'CidrBlock': 'string',
'CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
}
},
],
'IsDefault': True|False,
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
Vpc (dict) --
Information about the VPC.
CidrBlock (string) --
The primary IPv4 CIDR block for the VPC.
DhcpOptionsId (string) --
The ID of the set of DHCP options you've associated with the VPC (or default if the default options are associated with the VPC).
State (string) --
The current state of the VPC.
VpcId (string) --
The ID of the VPC.
OwnerId (string) --
The ID of the AWS account that owns the VPC.
InstanceTenancy (string) --
The allowed tenancy of instances launched into the VPC.
Ipv6CidrBlockAssociationSet (list) --
Information about the IPv6 CIDR blocks associated with the VPC.
(dict) --
Describes an IPv6 CIDR block associated with a VPC.
AssociationId (string) --
The association ID for the IPv6 CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
Ipv6CidrBlockState (dict) --
Information about the state of the CIDR block.
State (string) --
The state of the CIDR block.
StatusMessage (string) --
A message about the status of the CIDR block, if applicable.
CidrBlockAssociationSet (list) --
Information about the IPv4 CIDR blocks associated with the VPC.
(dict) --
Describes an IPv4 CIDR block associated with a VPC.
AssociationId (string) --
The association ID for the IPv4 CIDR block.
CidrBlock (string) --
The IPv4 CIDR block.
CidrBlockState (dict) --
Information about the state of the CIDR block.
State (string) --
The state of the CIDR block.
StatusMessage (string) --
A message about the status of the CIDR block, if applicable.
IsDefault (boolean) --
Indicates whether the VPC is the default VPC.
Tags (list) --
Any tags assigned to the VPC.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Examples
This example creates a VPC with the specified CIDR block.
response = client.create_vpc(
CidrBlock='10.0.0.0/16',
)
print(response)
Expected Output:
{
'Vpc': {
'CidrBlock': '10.0.0.0/16',
'DhcpOptionsId': 'dopt-7a8b9c2d',
'InstanceTenancy': 'default',
'State': 'pending',
'VpcId': 'vpc-a01106c2',
},
'ResponseMetadata': {
'...': '...',
},
}
Creates a VPC endpoint for a specified service. An endpoint enables you to create a private connection between your VPC and the service. The service may be provided by AWS, an AWS Marketplace partner, or another AWS account. For more information, see VPC Endpoints in the Amazon Virtual Private Cloud User Guide .
A gateway endpoint serves as a target for a route in your route table for traffic destined for the AWS service. You can specify an endpoint policy to attach to the endpoint that will control access to the service from your VPC. You can also specify the VPC route tables that use the endpoint.
An interface endpoint is a network interface in your subnet that serves as an endpoint for communicating with the specified service. You can specify the subnets in which to create an endpoint, and the security groups to associate with the endpoint network interface.
Use DescribeVpcEndpointServices to get a list of supported services.
See also: AWS API Documentation
Request Syntax
response = client.create_vpc_endpoint(
DryRun=True|False,
VpcEndpointType='Interface'|'Gateway',
VpcId='string',
ServiceName='string',
PolicyDocument='string',
RouteTableIds=[
'string',
],
SubnetIds=[
'string',
],
SecurityGroupIds=[
'string',
],
ClientToken='string',
PrivateDnsEnabled=True|False
)
The type of endpoint.
Default: Gateway
[REQUIRED]
The ID of the VPC in which the endpoint will be used.
[REQUIRED]
The service name. To get a list of available services, use the DescribeVpcEndpointServices request, or get the name from the service provider.
(Gateway endpoint) One or more route table IDs.
(Interface endpoint) The ID of one or more subnets in which to create an endpoint network interface.
(Interface endpoint) The ID of one or more security groups to associate with the endpoint network interface.
(Interface endpoint) Indicate whether to associate a private hosted zone with the specified VPC. The private hosted zone contains a record set for the default public DNS name for the service for the Region (for example, kinesis.us-east-1.amazonaws.com ) which resolves to the private IP addresses of the endpoint network interfaces in the VPC. This enables you to make requests to the default public DNS name for the service instead of the public DNS names that are automatically generated by the VPC endpoint service.
To use a private hosted zone, you must set the following VPC attributes to true : enableDnsHostnames and enableDnsSupport . Use ModifyVpcAttribute to set the VPC attributes.
Default: true
dict
Response Syntax
{
'VpcEndpoint': {
'VpcEndpointId': 'string',
'VpcEndpointType': 'Interface'|'Gateway',
'VpcId': 'string',
'ServiceName': 'string',
'State': 'PendingAcceptance'|'Pending'|'Available'|'Deleting'|'Deleted'|'Rejected'|'Failed'|'Expired',
'PolicyDocument': 'string',
'RouteTableIds': [
'string',
],
'SubnetIds': [
'string',
],
'Groups': [
{
'GroupId': 'string',
'GroupName': 'string'
},
],
'PrivateDnsEnabled': True|False,
'RequesterManaged': True|False,
'NetworkInterfaceIds': [
'string',
],
'DnsEntries': [
{
'DnsName': 'string',
'HostedZoneId': 'string'
},
],
'CreationTimestamp': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'OwnerId': 'string'
},
'ClientToken': 'string'
}
Response Structure
(dict) --
Contains the output of CreateVpcEndpoint.
VpcEndpoint (dict) --
Information about the endpoint.
VpcEndpointId (string) --
The ID of the VPC endpoint.
VpcEndpointType (string) --
The type of endpoint.
VpcId (string) --
The ID of the VPC to which the endpoint is associated.
ServiceName (string) --
The name of the service to which the endpoint is associated.
State (string) --
The state of the VPC endpoint.
PolicyDocument (string) --
The policy document associated with the endpoint, if applicable.
RouteTableIds (list) --
(Gateway endpoint) One or more route tables associated with the endpoint.
SubnetIds (list) --
(Interface endpoint) One or more subnets in which the endpoint is located.
Groups (list) --
(Interface endpoint) Information about the security groups associated with the network interface.
(dict) --
Describes a security group.
GroupId (string) --
The ID of the security group.
GroupName (string) --
The name of the security group.
PrivateDnsEnabled (boolean) --
(Interface endpoint) Indicates whether the VPC is associated with a private hosted zone.
RequesterManaged (boolean) --
Indicates whether the VPC endpoint is being managed by its service.
NetworkInterfaceIds (list) --
(Interface endpoint) One or more network interfaces for the endpoint.
DnsEntries (list) --
(Interface endpoint) The DNS entries for the endpoint.
(dict) --
Describes a DNS entry.
DnsName (string) --
The DNS name.
HostedZoneId (string) --
The ID of the private hosted zone.
CreationTimestamp (datetime) --
The date and time the VPC endpoint was created.
Tags (list) --
Any tags assigned to the VPC endpoint.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
OwnerId (string) --
The ID of the AWS account that owns the VPC endpoint.
ClientToken (string) --
Unique, case-sensitive identifier you provide to ensure the idempotency of the request.
Creates a connection notification for a specified VPC endpoint or VPC endpoint service. A connection notification notifies you of specific endpoint events. You must create an SNS topic to receive notifications. For more information, see Create a Topic in the Amazon Simple Notification Service Developer Guide .
You can create a connection notification for interface endpoints only.
See also: AWS API Documentation
Request Syntax
response = client.create_vpc_endpoint_connection_notification(
DryRun=True|False,
ServiceId='string',
VpcEndpointId='string',
ConnectionNotificationArn='string',
ConnectionEvents=[
'string',
],
ClientToken='string'
)
[REQUIRED]
The ARN of the SNS topic for the notifications.
[REQUIRED]
One or more endpoint events for which to receive notifications. Valid values are Accept , Connect , Delete , and Reject .
dict
Response Syntax
{
'ConnectionNotification': {
'ConnectionNotificationId': 'string',
'ServiceId': 'string',
'VpcEndpointId': 'string',
'ConnectionNotificationType': 'Topic',
'ConnectionNotificationArn': 'string',
'ConnectionEvents': [
'string',
],
'ConnectionNotificationState': 'Enabled'|'Disabled'
},
'ClientToken': 'string'
}
Response Structure
(dict) --
ConnectionNotification (dict) --
Information about the notification.
ConnectionNotificationId (string) --
The ID of the notification.
ServiceId (string) --
The ID of the endpoint service.
VpcEndpointId (string) --
The ID of the VPC endpoint.
ConnectionNotificationType (string) --
The type of notification.
ConnectionNotificationArn (string) --
The ARN of the SNS topic for the notification.
ConnectionEvents (list) --
The events for the notification. Valid values are Accept , Connect , Delete , and Reject .
ConnectionNotificationState (string) --
The state of the notification.
ClientToken (string) --
Unique, case-sensitive identifier you provide to ensure the idempotency of the request.
Creates a VPC endpoint service configuration to which service consumers (AWS accounts, IAM users, and IAM roles) can connect. Service consumers can create an interface VPC endpoint to connect to your service.
To create an endpoint service configuration, you must first create a Network Load Balancer for your service. For more information, see VPC Endpoint Services in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_vpc_endpoint_service_configuration(
DryRun=True|False,
AcceptanceRequired=True|False,
NetworkLoadBalancerArns=[
'string',
],
ClientToken='string'
)
[REQUIRED]
The Amazon Resource Names (ARNs) of one or more Network Load Balancers for your service.
dict
Response Syntax
{
'ServiceConfiguration': {
'ServiceType': [
{
'ServiceType': 'Interface'|'Gateway'
},
],
'ServiceId': 'string',
'ServiceName': 'string',
'ServiceState': 'Pending'|'Available'|'Deleting'|'Deleted'|'Failed',
'AvailabilityZones': [
'string',
],
'AcceptanceRequired': True|False,
'ManagesVpcEndpoints': True|False,
'NetworkLoadBalancerArns': [
'string',
],
'BaseEndpointDnsNames': [
'string',
],
'PrivateDnsName': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
'ClientToken': 'string'
}
Response Structure
(dict) --
ServiceConfiguration (dict) --
Information about the service configuration.
ServiceType (list) --
The type of service.
(dict) --
Describes the type of service for a VPC endpoint.
ServiceType (string) --
The type of service.
ServiceId (string) --
The ID of the service.
ServiceName (string) --
The name of the service.
ServiceState (string) --
The service state.
AvailabilityZones (list) --
In the Availability Zones in which the service is available.
AcceptanceRequired (boolean) --
Indicates whether requests from other AWS accounts to create an endpoint to the service must first be accepted.
ManagesVpcEndpoints (boolean) --
Indicates whether the service manages it's VPC endpoints. Management of the service VPC endpoints using the VPC endpoint API is restricted.
NetworkLoadBalancerArns (list) --
The Amazon Resource Names (ARNs) of the Network Load Balancers for the service.
BaseEndpointDnsNames (list) --
The DNS names for the service.
PrivateDnsName (string) --
The private DNS name for the service.
Tags (list) --
Any tags assigned to the service.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
ClientToken (string) --
Unique, case-sensitive identifier you provide to ensure the idempotency of the request.
Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection. The accepter VPC can belong to another AWS account and can be in a different Region to the requester VPC. The requester VPC and accepter VPC cannot have overlapping CIDR blocks.
Note
Limitations and rules apply to a VPC peering connection. For more information, see the limitations section in the VPC Peering Guide .
The owner of the accepter VPC must accept the peering request to activate the peering connection. The VPC peering connection request expires after 7 days, after which it cannot be accepted or rejected.
If you create a VPC peering connection request between VPCs with overlapping CIDR blocks, the VPC peering connection has a status of failed .
See also: AWS API Documentation
Request Syntax
response = client.create_vpc_peering_connection(
DryRun=True|False,
PeerOwnerId='string',
PeerVpcId='string',
VpcId='string',
PeerRegion='string'
)
The AWS account ID of the owner of the accepter VPC.
Default: Your AWS account ID
The Region code for the accepter VPC, if the accepter VPC is located in a Region other than the Region in which you make the request.
Default: The Region in which you make the request.
dict
Response Syntax
{
'VpcPeeringConnection': {
'AccepterVpcInfo': {
'CidrBlock': 'string',
'Ipv6CidrBlockSet': [
{
'Ipv6CidrBlock': 'string'
},
],
'CidrBlockSet': [
{
'CidrBlock': 'string'
},
],
'OwnerId': 'string',
'PeeringOptions': {
'AllowDnsResolutionFromRemoteVpc': True|False,
'AllowEgressFromLocalClassicLinkToRemoteVpc': True|False,
'AllowEgressFromLocalVpcToRemoteClassicLink': True|False
},
'VpcId': 'string',
'Region': 'string'
},
'ExpirationTime': datetime(2015, 1, 1),
'RequesterVpcInfo': {
'CidrBlock': 'string',
'Ipv6CidrBlockSet': [
{
'Ipv6CidrBlock': 'string'
},
],
'CidrBlockSet': [
{
'CidrBlock': 'string'
},
],
'OwnerId': 'string',
'PeeringOptions': {
'AllowDnsResolutionFromRemoteVpc': True|False,
'AllowEgressFromLocalClassicLinkToRemoteVpc': True|False,
'AllowEgressFromLocalVpcToRemoteClassicLink': True|False
},
'VpcId': 'string',
'Region': 'string'
},
'Status': {
'Code': 'initiating-request'|'pending-acceptance'|'active'|'deleted'|'rejected'|'failed'|'expired'|'provisioning'|'deleting',
'Message': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VpcPeeringConnectionId': 'string'
}
}
Response Structure
(dict) --
VpcPeeringConnection (dict) --
Information about the VPC peering connection.
AccepterVpcInfo (dict) --
Information about the accepter VPC. CIDR block information is only returned when describing an active VPC peering connection.
CidrBlock (string) --
The IPv4 CIDR block for the VPC.
Ipv6CidrBlockSet (list) --
The IPv6 CIDR block for the VPC.
(dict) --
Describes an IPv6 CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
CidrBlockSet (list) --
Information about the IPv4 CIDR blocks for the VPC.
(dict) --
Describes an IPv4 CIDR block.
CidrBlock (string) --
The IPv4 CIDR block.
OwnerId (string) --
The AWS account ID of the VPC owner.
PeeringOptions (dict) --
Information about the VPC peering connection options for the accepter or requester VPC.
AllowDnsResolutionFromRemoteVpc (boolean) --
Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
AllowEgressFromLocalClassicLinkToRemoteVpc (boolean) --
Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection.
AllowEgressFromLocalVpcToRemoteClassicLink (boolean) --
Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection.
VpcId (string) --
The ID of the VPC.
Region (string) --
The Region in which the VPC is located.
ExpirationTime (datetime) --
The time that an unaccepted VPC peering connection will expire.
RequesterVpcInfo (dict) --
Information about the requester VPC. CIDR block information is only returned when describing an active VPC peering connection.
CidrBlock (string) --
The IPv4 CIDR block for the VPC.
Ipv6CidrBlockSet (list) --
The IPv6 CIDR block for the VPC.
(dict) --
Describes an IPv6 CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
CidrBlockSet (list) --
Information about the IPv4 CIDR blocks for the VPC.
(dict) --
Describes an IPv4 CIDR block.
CidrBlock (string) --
The IPv4 CIDR block.
OwnerId (string) --
The AWS account ID of the VPC owner.
PeeringOptions (dict) --
Information about the VPC peering connection options for the accepter or requester VPC.
AllowDnsResolutionFromRemoteVpc (boolean) --
Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
AllowEgressFromLocalClassicLinkToRemoteVpc (boolean) --
Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection.
AllowEgressFromLocalVpcToRemoteClassicLink (boolean) --
Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection.
VpcId (string) --
The ID of the VPC.
Region (string) --
The Region in which the VPC is located.
Status (dict) --
The status of the VPC peering connection.
Code (string) --
The status of the VPC peering connection.
Message (string) --
A message that provides more information about the status, if applicable.
Tags (list) --
Any tags assigned to the resource.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VpcPeeringConnectionId (string) --
The ID of the VPC peering connection.
Creates a VPN connection between an existing virtual private gateway and a VPN customer gateway. The supported connection types is ipsec.1 .
The response includes information that you need to give to your network administrator to configure your customer gateway.
Warning
We strongly recommend that you use HTTPS when calling this operation because the response contains sensitive cryptographic information for configuring your customer gateway.
If you decide to shut down your VPN connection for any reason and later create a new VPN connection, you must reconfigure your customer gateway with the new information returned from this call.
This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error.
For more information, see AWS Site-to-Site VPN in the AWS Site-to-Site VPN User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_vpn_connection(
CustomerGatewayId='string',
Type='string',
VpnGatewayId='string',
TransitGatewayId='string',
DryRun=True|False,
Options={
'StaticRoutesOnly': True|False,
'TunnelOptions': [
{
'TunnelInsideCidr': 'string',
'PreSharedKey': 'string'
},
]
}
)
[REQUIRED]
The ID of the customer gateway.
[REQUIRED]
The type of VPN connection (ipsec.1 ).
The options for the VPN connection.
Indicate whether the VPN connection uses static routes only. If you are creating a VPN connection for a device that does not support BGP, you must specify true . Use CreateVpnConnectionRoute to create a static route.
Default: false
The tunnel options for the VPN connection.
The tunnel options for a VPN connection.
The range of inside IP addresses for the tunnel. Any specified CIDR blocks must be unique across all VPN connections that use the same virtual private gateway.
Constraints: A size /30 CIDR block from the 169.254.0.0/16 range. The following CIDR blocks are reserved and cannot be used:
The pre-shared key (PSK) to establish initial authentication between the virtual private gateway and customer gateway.
Constraints: Allowed characters are alphanumeric characters and ._. Must be between 8 and 64 characters in length and cannot start with zero (0).
dict
Response Syntax
{
'VpnConnection': {
'CustomerGatewayConfiguration': 'string',
'CustomerGatewayId': 'string',
'Category': 'string',
'State': 'pending'|'available'|'deleting'|'deleted',
'Type': 'ipsec.1',
'VpnConnectionId': 'string',
'VpnGatewayId': 'string',
'TransitGatewayId': 'string',
'Options': {
'StaticRoutesOnly': True|False
},
'Routes': [
{
'DestinationCidrBlock': 'string',
'Source': 'Static',
'State': 'pending'|'available'|'deleting'|'deleted'
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VgwTelemetry': [
{
'AcceptedRouteCount': 123,
'LastStatusChange': datetime(2015, 1, 1),
'OutsideIpAddress': 'string',
'Status': 'UP'|'DOWN',
'StatusMessage': 'string'
},
]
}
}
Response Structure
(dict) --
Contains the output of CreateVpnConnection.
VpnConnection (dict) --
Information about the VPN connection.
CustomerGatewayConfiguration (string) --
The configuration information for the VPN connection's customer gateway (in the native XML format). This element is always present in the CreateVpnConnection response; however, it's present in the DescribeVpnConnections response only if the VPN connection is in the pending or available state.
CustomerGatewayId (string) --
The ID of the customer gateway at your end of the VPN connection.
Category (string) --
The category of the VPN connection. A value of VPN indicates an AWS VPN connection. A value of VPN-Classic indicates an AWS Classic VPN connection.
State (string) --
The current state of the VPN connection.
Type (string) --
The type of VPN connection.
VpnConnectionId (string) --
The ID of the VPN connection.
VpnGatewayId (string) --
The ID of the virtual private gateway at the AWS side of the VPN connection.
TransitGatewayId (string) --
The ID of the transit gateway associated with the VPN connection.
Options (dict) --
The VPN connection options.
StaticRoutesOnly (boolean) --
Indicates whether the VPN connection uses static routes only. Static routes must be used for devices that don't support BGP.
Routes (list) --
The static routes associated with the VPN connection.
(dict) --
Describes a static route for a VPN connection.
DestinationCidrBlock (string) --
The CIDR block associated with the local subnet of the customer data center.
Source (string) --
Indicates how the routes were provided.
State (string) --
The current state of the static route.
Tags (list) --
Any tags assigned to the VPN connection.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VgwTelemetry (list) --
Information about the VPN tunnel.
(dict) --
Describes telemetry for a VPN tunnel.
AcceptedRouteCount (integer) --
The number of accepted routes.
LastStatusChange (datetime) --
The date and time of the last change in status.
OutsideIpAddress (string) --
The Internet-routable IP address of the virtual private gateway's outside interface.
Status (string) --
The status of the VPN tunnel.
StatusMessage (string) --
If an error occurs, a description of the error.
Creates a static route associated with a VPN connection between an existing virtual private gateway and a VPN customer gateway. The static route allows traffic to be routed from the virtual private gateway to the VPN customer gateway.
For more information, see AWS Site-to-Site VPN in the AWS Site-to-Site VPN User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_vpn_connection_route(
DestinationCidrBlock='string',
VpnConnectionId='string'
)
[REQUIRED]
The CIDR block associated with the local subnet of the customer network.
[REQUIRED]
The ID of the VPN connection.
None
Creates a virtual private gateway. A virtual private gateway is the endpoint on the VPC side of your VPN connection. You can create a virtual private gateway before creating the VPC itself.
For more information, see AWS Site-to-Site VPN in the AWS Site-to-Site VPN User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_vpn_gateway(
AvailabilityZone='string',
Type='ipsec.1',
AmazonSideAsn=123,
DryRun=True|False
)
[REQUIRED]
The type of VPN connection this virtual private gateway supports.
A private Autonomous System Number (ASN) for the Amazon side of a BGP session. If you're using a 16-bit ASN, it must be in the 64512 to 65534 range. If you're using a 32-bit ASN, it must be in the 4200000000 to 4294967294 range.
Default: 64512
dict
Response Syntax
{
'VpnGateway': {
'AvailabilityZone': 'string',
'State': 'pending'|'available'|'deleting'|'deleted',
'Type': 'ipsec.1',
'VpcAttachments': [
{
'State': 'attaching'|'attached'|'detaching'|'detached',
'VpcId': 'string'
},
],
'VpnGatewayId': 'string',
'AmazonSideAsn': 123,
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
Contains the output of CreateVpnGateway.
VpnGateway (dict) --
Information about the virtual private gateway.
AvailabilityZone (string) --
The Availability Zone where the virtual private gateway was created, if applicable. This field may be empty or not returned.
State (string) --
The current state of the virtual private gateway.
Type (string) --
The type of VPN connection the virtual private gateway supports.
VpcAttachments (list) --
Any VPCs attached to the virtual private gateway.
(dict) --
Describes an attachment between a virtual private gateway and a VPC.
State (string) --
The current state of the attachment.
VpcId (string) --
The ID of the VPC.
VpnGatewayId (string) --
The ID of the virtual private gateway.
AmazonSideAsn (integer) --
The private Autonomous System Number (ASN) for the Amazon side of a BGP session.
Tags (list) --
Any tags assigned to the virtual private gateway.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Deletes the specified Client VPN endpoint. You must disassociate all target networks before you can delete a Client VPN endpoint.
See also: AWS API Documentation
Request Syntax
response = client.delete_client_vpn_endpoint(
ClientVpnEndpointId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the Client VPN to be deleted.
dict
Response Syntax
{
'Status': {
'Code': 'pending-associate'|'available'|'deleting'|'deleted',
'Message': 'string'
}
}
Response Structure
(dict) --
Status (dict) --
The current state of the Client VPN endpoint.
Code (string) --
The state of the Client VPN endpoint. Possible states include:
Message (string) --
A message about the status of the Client VPN endpoint.
Deletes a route from a Client VPN endpoint. You can only delete routes that you manually added using the CreateClientVpnRoute action. You cannot delete routes that were automatically added when associating a subnet. To remove routes that have been automatically added, disassociate the target subnet from the Client VPN endpoint.
See also: AWS API Documentation
Request Syntax
response = client.delete_client_vpn_route(
ClientVpnEndpointId='string',
TargetVpcSubnetId='string',
DestinationCidrBlock='string',
DryRun=True|False
)
[REQUIRED]
The ID of the Client VPN endpoint from which the route is to be deleted.
[REQUIRED]
The IPv4 address range, in CIDR notation, of the route to be deleted.
dict
Response Syntax
{
'Status': {
'Code': 'creating'|'active'|'failed'|'deleting',
'Message': 'string'
}
}
Response Structure
(dict) --
Status (dict) --
The current state of the route.
Code (string) --
The state of the Client VPN endpoint route.
Message (string) --
A message about the status of the Client VPN endpoint route, if applicable.
Deletes the specified customer gateway. You must delete the VPN connection before you can delete the customer gateway.
See also: AWS API Documentation
Request Syntax
response = client.delete_customer_gateway(
CustomerGatewayId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the customer gateway.
None
Examples
This example deletes the specified customer gateway.
response = client.delete_customer_gateway(
CustomerGatewayId='cgw-0e11f167',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes the specified set of DHCP options. You must disassociate the set of DHCP options before you can delete it. You can disassociate the set of DHCP options by associating either a new set of options or the default set of options with the VPC.
See also: AWS API Documentation
Request Syntax
response = client.delete_dhcp_options(
DhcpOptionsId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the DHCP options set.
None
Examples
This example deletes the specified DHCP options set.
response = client.delete_dhcp_options(
DhcpOptionsId='dopt-d9070ebb',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes an egress-only internet gateway.
See also: AWS API Documentation
Request Syntax
response = client.delete_egress_only_internet_gateway(
DryRun=True|False,
EgressOnlyInternetGatewayId='string'
)
[REQUIRED]
The ID of the egress-only internet gateway.
dict
Response Syntax
{
'ReturnCode': True|False
}
Response Structure
(dict) --
ReturnCode (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Deletes the specified EC2 Fleet.
After you delete an EC2 Fleet, it launches no new instances. You must specify whether an EC2 Fleet should also terminate its instances. If you terminate the instances, the EC2 Fleet enters the deleted_terminating state. Otherwise, the EC2 Fleet enters the deleted_running state, and the instances continue to run until they are interrupted or you terminate them manually.
See also: AWS API Documentation
Request Syntax
response = client.delete_fleets(
DryRun=True|False,
FleetIds=[
'string',
],
TerminateInstances=True|False
)
[REQUIRED]
The IDs of the EC2 Fleets.
[REQUIRED]
Indicates whether to terminate instances for an EC2 Fleet if it is deleted successfully.
dict
Response Syntax
{
'SuccessfulFleetDeletions': [
{
'CurrentFleetState': 'submitted'|'active'|'deleted'|'failed'|'deleted-running'|'deleted-terminating'|'modifying',
'PreviousFleetState': 'submitted'|'active'|'deleted'|'failed'|'deleted-running'|'deleted-terminating'|'modifying',
'FleetId': 'string'
},
],
'UnsuccessfulFleetDeletions': [
{
'Error': {
'Code': 'fleetIdDoesNotExist'|'fleetIdMalformed'|'fleetNotInDeletableState'|'unexpectedError',
'Message': 'string'
},
'FleetId': 'string'
},
]
}
Response Structure
(dict) --
SuccessfulFleetDeletions (list) --
Information about the EC2 Fleets that are successfully deleted.
(dict) --
Describes an EC2 Fleet that was successfully deleted.
CurrentFleetState (string) --
The current state of the EC2 Fleet.
PreviousFleetState (string) --
The previous state of the EC2 Fleet.
FleetId (string) --
The ID of the EC2 Fleet.
UnsuccessfulFleetDeletions (list) --
Information about the EC2 Fleets that are not successfully deleted.
(dict) --
Describes an EC2 Fleet that was not successfully deleted.
Error (dict) --
The error.
Code (string) --
The error code.
Message (string) --
The description for the error code.
FleetId (string) --
The ID of the EC2 Fleet.
Deletes one or more flow logs.
See also: AWS API Documentation
Request Syntax
response = client.delete_flow_logs(
DryRun=True|False,
FlowLogIds=[
'string',
]
)
[REQUIRED]
One or more flow log IDs.
Constraint: Maximum of 1000 flow log IDs.
dict
Response Syntax
{
'Unsuccessful': [
{
'Error': {
'Code': 'string',
'Message': 'string'
},
'ResourceId': 'string'
},
]
}
Response Structure
(dict) --
Unsuccessful (list) --
Information about the flow logs that could not be deleted successfully.
(dict) --
Information about items that were not successfully processed in a batch call.
Error (dict) --
Information about the error.
Code (string) --
The error code.
Message (string) --
The error message accompanying the error code.
ResourceId (string) --
The ID of the resource.
Deletes the specified Amazon FPGA Image (AFI).
See also: AWS API Documentation
Request Syntax
response = client.delete_fpga_image(
DryRun=True|False,
FpgaImageId='string'
)
[REQUIRED]
The ID of the AFI.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Is true if the request succeeds, and an error otherwise.
Deletes the specified internet gateway. You must detach the internet gateway from the VPC before you can delete it.
See also: AWS API Documentation
Request Syntax
response = client.delete_internet_gateway(
DryRun=True|False,
InternetGatewayId='string'
)
[REQUIRED]
The ID of the internet gateway.
None
Examples
This example deletes the specified Internet gateway.
response = client.delete_internet_gateway(
InternetGatewayId='igw-c0a643a9',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes the specified key pair, by removing the public key from Amazon EC2.
See also: AWS API Documentation
Request Syntax
response = client.delete_key_pair(
KeyName='string',
DryRun=True|False
)
[REQUIRED]
The name of the key pair.
None
Examples
This example deletes the specified key pair.
response = client.delete_key_pair(
KeyName='my-key-pair',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes a launch template. Deleting a launch template deletes all of its versions.
See also: AWS API Documentation
Request Syntax
response = client.delete_launch_template(
DryRun=True|False,
LaunchTemplateId='string',
LaunchTemplateName='string'
)
dict
Response Syntax
{
'LaunchTemplate': {
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'CreateTime': datetime(2015, 1, 1),
'CreatedBy': 'string',
'DefaultVersionNumber': 123,
'LatestVersionNumber': 123,
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
LaunchTemplate (dict) --
Information about the launch template.
LaunchTemplateId (string) --
The ID of the launch template.
LaunchTemplateName (string) --
The name of the launch template.
CreateTime (datetime) --
The time launch template was created.
CreatedBy (string) --
The principal that created the launch template.
DefaultVersionNumber (integer) --
The version number of the default version of the launch template.
LatestVersionNumber (integer) --
The version number of the latest version of the launch template.
Tags (list) --
The tags for the launch template.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Deletes one or more versions of a launch template. You cannot delete the default version of a launch template; you must first assign a different version as the default. If the default version is the only version for the launch template, you must delete the entire launch template using DeleteLaunchTemplate .
See also: AWS API Documentation
Request Syntax
response = client.delete_launch_template_versions(
DryRun=True|False,
LaunchTemplateId='string',
LaunchTemplateName='string',
Versions=[
'string',
]
)
[REQUIRED]
The version numbers of one or more launch template versions to delete.
dict
Response Syntax
{
'SuccessfullyDeletedLaunchTemplateVersions': [
{
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'VersionNumber': 123
},
],
'UnsuccessfullyDeletedLaunchTemplateVersions': [
{
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'VersionNumber': 123,
'ResponseError': {
'Code': 'launchTemplateIdDoesNotExist'|'launchTemplateIdMalformed'|'launchTemplateNameDoesNotExist'|'launchTemplateNameMalformed'|'launchTemplateVersionDoesNotExist'|'unexpectedError',
'Message': 'string'
}
},
]
}
Response Structure
(dict) --
SuccessfullyDeletedLaunchTemplateVersions (list) --
Information about the launch template versions that were successfully deleted.
(dict) --
Describes a launch template version that was successfully deleted.
LaunchTemplateId (string) --
The ID of the launch template.
LaunchTemplateName (string) --
The name of the launch template.
VersionNumber (integer) --
The version number of the launch template.
UnsuccessfullyDeletedLaunchTemplateVersions (list) --
Information about the launch template versions that could not be deleted.
(dict) --
Describes a launch template version that could not be deleted.
LaunchTemplateId (string) --
The ID of the launch template.
LaunchTemplateName (string) --
The name of the launch template.
VersionNumber (integer) --
The version number of the launch template.
ResponseError (dict) --
Information about the error.
Code (string) --
The error code.
Message (string) --
The error message, if applicable.
Deletes the specified NAT gateway. Deleting a NAT gateway disassociates its Elastic IP address, but does not release the address from your account. Deleting a NAT gateway does not delete any NAT gateway routes in your route tables.
See also: AWS API Documentation
Request Syntax
response = client.delete_nat_gateway(
NatGatewayId='string'
)
[REQUIRED]
The ID of the NAT gateway.
{
'NatGatewayId': 'string'
}
Response Structure
The ID of the NAT gateway.
Examples
This example deletes the specified NAT gateway.
response = client.delete_nat_gateway(
NatGatewayId='nat-04ae55e711cec5680',
)
print(response)
Expected Output:
{
'NatGatewayId': 'nat-04ae55e711cec5680',
'ResponseMetadata': {
'...': '...',
},
}
Deletes the specified network ACL. You can't delete the ACL if it's associated with any subnets. You can't delete the default network ACL.
See also: AWS API Documentation
Request Syntax
response = client.delete_network_acl(
DryRun=True|False,
NetworkAclId='string'
)
[REQUIRED]
The ID of the network ACL.
None
Examples
This example deletes the specified network ACL.
response = client.delete_network_acl(
NetworkAclId='acl-5fb85d36',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes the specified ingress or egress entry (rule) from the specified network ACL.
See also: AWS API Documentation
Request Syntax
response = client.delete_network_acl_entry(
DryRun=True|False,
Egress=True|False,
NetworkAclId='string',
RuleNumber=123
)
[REQUIRED]
Indicates whether the rule is an egress rule.
[REQUIRED]
The ID of the network ACL.
[REQUIRED]
The rule number of the entry to delete.
None
Examples
This example deletes ingress rule number 100 from the specified network ACL.
response = client.delete_network_acl_entry(
Egress=True,
NetworkAclId='acl-5fb85d36',
RuleNumber=100,
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes the specified network interface. You must detach the network interface before you can delete it.
See also: AWS API Documentation
Request Syntax
response = client.delete_network_interface(
DryRun=True|False,
NetworkInterfaceId='string'
)
[REQUIRED]
The ID of the network interface.
None
Examples
This example deletes the specified network interface.
response = client.delete_network_interface(
NetworkInterfaceId='eni-e5aa89a3',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes a permission for a network interface. By default, you cannot delete the permission if the account for which you're removing the permission has attached the network interface to an instance. However, you can force delete the permission, regardless of any attachment.
See also: AWS API Documentation
Request Syntax
response = client.delete_network_interface_permission(
NetworkInterfacePermissionId='string',
Force=True|False,
DryRun=True|False
)
[REQUIRED]
The ID of the network interface permission.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Contains the output for DeleteNetworkInterfacePermission.
Return (boolean) --
Returns true if the request succeeds, otherwise returns an error.
Deletes the specified placement group. You must terminate all instances in the placement group before you can delete the placement group. For more information, see Placement Groups in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.delete_placement_group(
DryRun=True|False,
GroupName='string'
)
[REQUIRED]
The name of the placement group.
None
Examples
This example deletes the specified placement group.
response = client.delete_placement_group(
GroupName='my-cluster',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes the specified route from the specified route table.
See also: AWS API Documentation
Request Syntax
response = client.delete_route(
DestinationCidrBlock='string',
DestinationIpv6CidrBlock='string',
DryRun=True|False,
RouteTableId='string'
)
[REQUIRED]
The ID of the route table.
None
Examples
This example deletes the specified route from the specified route table.
response = client.delete_route(
DestinationCidrBlock='0.0.0.0/0',
RouteTableId='rtb-22574640',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes the specified route table. You must disassociate the route table from any subnets before you can delete it. You can't delete the main route table.
See also: AWS API Documentation
Request Syntax
response = client.delete_route_table(
DryRun=True|False,
RouteTableId='string'
)
[REQUIRED]
The ID of the route table.
None
Examples
This example deletes the specified route table.
response = client.delete_route_table(
RouteTableId='rtb-22574640',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes a security group.
If you attempt to delete a security group that is associated with an instance, or is referenced by another security group, the operation fails with InvalidGroup.InUse in EC2-Classic or DependencyViolation in EC2-VPC.
See also: AWS API Documentation
Request Syntax
response = client.delete_security_group(
GroupId='string',
GroupName='string',
DryRun=True|False
)
None
Deletes the specified snapshot.
When you make periodic snapshots of a volume, the snapshots are incremental, and only the blocks on the device that have changed since your last snapshot are saved in the new snapshot. When you delete a snapshot, only the data not needed for any other snapshot is removed. So regardless of which prior snapshots have been deleted, all active snapshots will have access to all the information needed to restore the volume.
You cannot delete a snapshot of the root device of an EBS volume used by a registered AMI. You must first de-register the AMI before you can delete the snapshot.
For more information, see Deleting an Amazon EBS Snapshot in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.delete_snapshot(
SnapshotId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the EBS snapshot.
None
Examples
This example deletes a snapshot with the snapshot ID of snap-1234567890abcdef0. If the command succeeds, no output is returned.
response = client.delete_snapshot(
SnapshotId='snap-1234567890abcdef0',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes the data feed for Spot Instances.
See also: AWS API Documentation
Request Syntax
response = client.delete_spot_datafeed_subscription(
DryRun=True|False
)
Examples
This example deletes a Spot data feed subscription for the account.
response = client.delete_spot_datafeed_subscription(
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes the specified subnet. You must terminate all running instances in the subnet before you can delete the subnet.
See also: AWS API Documentation
Request Syntax
response = client.delete_subnet(
SubnetId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the subnet.
None
Examples
This example deletes the specified subnet.
response = client.delete_subnet(
SubnetId='subnet-9d4a7b6c',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes the specified set of tags from the specified set of resources.
To list the current tags, use DescribeTags . For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.delete_tags(
DryRun=True|False,
Resources=[
'string',
],
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The IDs of the resources, separated by spaces.
Constraints: Up to 1000 resource IDs. We recommend breaking up this request into smaller batches.
The tags to delete. Specify a tag key and an optional tag value to delete specific tags. If you specify a tag key without a tag value, we delete any tag with this key regardless of its value. If you specify a tag key with an empty string as the tag value, we delete the tag only if its value is an empty string.
If you omit this parameter, we delete all user-defined tags for the specified resources. We do not delete AWS-generated tags (tags that have the aws: prefix).
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
None
Examples
This example deletes the tag Stack=test from the specified image.
response = client.delete_tags(
Resources=[
'ami-78a54011',
],
Tags=[
{
'Key': 'Stack',
'Value': 'test',
},
],
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes the specified Traffic Mirror filter.
You cannot delete a Traffic Mirror filter that is in use by a Traffic Mirror session.
See also: AWS API Documentation
Request Syntax
response = client.delete_traffic_mirror_filter(
TrafficMirrorFilterId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the Traffic Mirror filter.
dict
Response Syntax
{
'TrafficMirrorFilterId': 'string'
}
Response Structure
(dict) --
TrafficMirrorFilterId (string) --
The ID of the Traffic Mirror filter.
Deletes the specified Traffic Mirror rule.
See also: AWS API Documentation
Request Syntax
response = client.delete_traffic_mirror_filter_rule(
TrafficMirrorFilterRuleId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the Traffic Mirror rule.
dict
Response Syntax
{
'TrafficMirrorFilterRuleId': 'string'
}
Response Structure
(dict) --
TrafficMirrorFilterRuleId (string) --
The ID of the deleted Traffic Mirror rule.
Deletes the specified Traffic Mirror session.
See also: AWS API Documentation
Request Syntax
response = client.delete_traffic_mirror_session(
TrafficMirrorSessionId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the Traffic Mirror session.
dict
Response Syntax
{
'TrafficMirrorSessionId': 'string'
}
Response Structure
(dict) --
TrafficMirrorSessionId (string) --
The ID of the deleted Traffic Mirror session.
Deletes the specified Traffic Mirror target.
You cannot delete a Traffic Mirror target that is in use by a Traffic Mirror session.
See also: AWS API Documentation
Request Syntax
response = client.delete_traffic_mirror_target(
TrafficMirrorTargetId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the Traffic Mirror target.
dict
Response Syntax
{
'TrafficMirrorTargetId': 'string'
}
Response Structure
(dict) --
TrafficMirrorTargetId (string) --
The ID of the deleted Traffic Mirror target.
Deletes the specified transit gateway.
See also: AWS API Documentation
Request Syntax
response = client.delete_transit_gateway(
TransitGatewayId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the transit gateway.
dict
Response Syntax
{
'TransitGateway': {
'TransitGatewayId': 'string',
'TransitGatewayArn': 'string',
'State': 'pending'|'available'|'modifying'|'deleting'|'deleted',
'OwnerId': 'string',
'Description': 'string',
'CreationTime': datetime(2015, 1, 1),
'Options': {
'AmazonSideAsn': 123,
'AutoAcceptSharedAttachments': 'enable'|'disable',
'DefaultRouteTableAssociation': 'enable'|'disable',
'AssociationDefaultRouteTableId': 'string',
'DefaultRouteTablePropagation': 'enable'|'disable',
'PropagationDefaultRouteTableId': 'string',
'VpnEcmpSupport': 'enable'|'disable',
'DnsSupport': 'enable'|'disable'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
TransitGateway (dict) --
Information about the deleted transit gateway.
TransitGatewayId (string) --
The ID of the transit gateway.
TransitGatewayArn (string) --
The Amazon Resource Name (ARN) of the transit gateway.
State (string) --
The state of the transit gateway.
OwnerId (string) --
The ID of the AWS account ID that owns the transit gateway.
Description (string) --
The description of the transit gateway.
CreationTime (datetime) --
The creation time.
Options (dict) --
The transit gateway options.
AmazonSideAsn (integer) --
A private Autonomous System Number (ASN) for the Amazon side of a BGP session. The range is 64512 to 65534 for 16-bit ASNs and 4200000000 to 4294967294 for 32-bit ASNs.
AutoAcceptSharedAttachments (string) --
Indicates whether attachment requests are automatically accepted.
DefaultRouteTableAssociation (string) --
Indicates whether resource attachments are automatically associated with the default association route table.
AssociationDefaultRouteTableId (string) --
The ID of the default association route table.
DefaultRouteTablePropagation (string) --
Indicates whether resource attachments automatically propagate routes to the default propagation route table.
PropagationDefaultRouteTableId (string) --
The ID of the default propagation route table.
VpnEcmpSupport (string) --
Indicates whether Equal Cost Multipath Protocol support is enabled.
DnsSupport (string) --
Indicates whether DNS support is enabled.
Tags (list) --
The tags for the transit gateway.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Deletes the specified route from the specified transit gateway route table.
See also: AWS API Documentation
Request Syntax
response = client.delete_transit_gateway_route(
TransitGatewayRouteTableId='string',
DestinationCidrBlock='string',
DryRun=True|False
)
[REQUIRED]
The ID of the transit gateway route table.
[REQUIRED]
The CIDR range for the route. This must match the CIDR for the route exactly.
dict
Response Syntax
{
'Route': {
'DestinationCidrBlock': 'string',
'TransitGatewayAttachments': [
{
'ResourceId': 'string',
'TransitGatewayAttachmentId': 'string',
'ResourceType': 'vpc'|'vpn'|'direct-connect-gateway'
},
],
'Type': 'static'|'propagated',
'State': 'pending'|'active'|'blackhole'|'deleting'|'deleted'
}
}
Response Structure
(dict) --
Route (dict) --
Information about the route.
DestinationCidrBlock (string) --
The CIDR block used for destination matches.
TransitGatewayAttachments (list) --
The attachments.
(dict) --
Describes a route attachment.
ResourceId (string) --
The ID of the resource.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
ResourceType (string) --
The resource type.
Type (string) --
The route type.
State (string) --
The state of the route.
Deletes the specified transit gateway route table. You must disassociate the route table from any transit gateway route tables before you can delete it.
See also: AWS API Documentation
Request Syntax
response = client.delete_transit_gateway_route_table(
TransitGatewayRouteTableId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the transit gateway route table.
dict
Response Syntax
{
'TransitGatewayRouteTable': {
'TransitGatewayRouteTableId': 'string',
'TransitGatewayId': 'string',
'State': 'pending'|'available'|'deleting'|'deleted',
'DefaultAssociationRouteTable': True|False,
'DefaultPropagationRouteTable': True|False,
'CreationTime': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
TransitGatewayRouteTable (dict) --
Information about the deleted transit gateway route table.
TransitGatewayRouteTableId (string) --
The ID of the transit gateway route table.
TransitGatewayId (string) --
The ID of the transit gateway.
State (string) --
The state of the transit gateway route table.
DefaultAssociationRouteTable (boolean) --
Indicates whether this is the default association route table for the transit gateway.
DefaultPropagationRouteTable (boolean) --
Indicates whether this is the default propagation route table for the transit gateway.
CreationTime (datetime) --
The creation time.
Tags (list) --
Any tags assigned to the route table.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Deletes the specified VPC attachment.
See also: AWS API Documentation
Request Syntax
response = client.delete_transit_gateway_vpc_attachment(
TransitGatewayAttachmentId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the attachment.
dict
Response Syntax
{
'TransitGatewayVpcAttachment': {
'TransitGatewayAttachmentId': 'string',
'TransitGatewayId': 'string',
'VpcId': 'string',
'VpcOwnerId': 'string',
'State': 'pendingAcceptance'|'rollingBack'|'pending'|'available'|'modifying'|'deleting'|'deleted'|'failed'|'rejected'|'rejecting'|'failing',
'SubnetIds': [
'string',
],
'CreationTime': datetime(2015, 1, 1),
'Options': {
'DnsSupport': 'enable'|'disable',
'Ipv6Support': 'enable'|'disable'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
TransitGatewayVpcAttachment (dict) --
Information about the deleted VPC attachment.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
TransitGatewayId (string) --
The ID of the transit gateway.
VpcId (string) --
The ID of the VPC.
VpcOwnerId (string) --
The ID of the AWS account that owns the VPC.
State (string) --
The state of the VPC attachment.
SubnetIds (list) --
The IDs of the subnets.
CreationTime (datetime) --
The creation time.
Options (dict) --
The VPC attachment options.
DnsSupport (string) --
Indicates whether DNS support is enabled.
Ipv6Support (string) --
Indicates whether IPv6 support is enabled.
Tags (list) --
The tags for the VPC attachment.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Deletes the specified EBS volume. The volume must be in the available state (not attached to an instance).
The volume can remain in the deleting state for several minutes.
For more information, see Deleting an Amazon EBS Volume in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.delete_volume(
VolumeId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the volume.
None
Examples
This example deletes an available volume with the volume ID of vol-049df61146c4d7901. If the command succeeds, no output is returned.
response = client.delete_volume(
VolumeId='vol-049df61146c4d7901',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes the specified VPC. You must detach or delete all gateways and resources that are associated with the VPC before you can delete it. For example, you must terminate all instances running in the VPC, delete all security groups associated with the VPC (except the default one), delete all route tables associated with the VPC (except the default one), and so on.
See also: AWS API Documentation
Request Syntax
response = client.delete_vpc(
VpcId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the VPC.
None
Examples
This example deletes the specified VPC.
response = client.delete_vpc(
VpcId='vpc-a01106c2',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes one or more VPC endpoint connection notifications.
See also: AWS API Documentation
Request Syntax
response = client.delete_vpc_endpoint_connection_notifications(
DryRun=True|False,
ConnectionNotificationIds=[
'string',
]
)
[REQUIRED]
One or more notification IDs.
dict
Response Syntax
{
'Unsuccessful': [
{
'Error': {
'Code': 'string',
'Message': 'string'
},
'ResourceId': 'string'
},
]
}
Response Structure
(dict) --
Unsuccessful (list) --
Information about the notifications that could not be deleted successfully.
(dict) --
Information about items that were not successfully processed in a batch call.
Error (dict) --
Information about the error.
Code (string) --
The error code.
Message (string) --
The error message accompanying the error code.
ResourceId (string) --
The ID of the resource.
Deletes one or more VPC endpoint service configurations in your account. Before you delete the endpoint service configuration, you must reject any Available or PendingAcceptance interface endpoint connections that are attached to the service.
See also: AWS API Documentation
Request Syntax
response = client.delete_vpc_endpoint_service_configurations(
DryRun=True|False,
ServiceIds=[
'string',
]
)
[REQUIRED]
The IDs of one or more services.
dict
Response Syntax
{
'Unsuccessful': [
{
'Error': {
'Code': 'string',
'Message': 'string'
},
'ResourceId': 'string'
},
]
}
Response Structure
(dict) --
Unsuccessful (list) --
Information about the service configurations that were not deleted, if applicable.
(dict) --
Information about items that were not successfully processed in a batch call.
Error (dict) --
Information about the error.
Code (string) --
The error code.
Message (string) --
The error message accompanying the error code.
ResourceId (string) --
The ID of the resource.
Deletes one or more specified VPC endpoints. Deleting a gateway endpoint also deletes the endpoint routes in the route tables that were associated with the endpoint. Deleting an interface endpoint deletes the endpoint network interfaces.
See also: AWS API Documentation
Request Syntax
response = client.delete_vpc_endpoints(
DryRun=True|False,
VpcEndpointIds=[
'string',
]
)
[REQUIRED]
One or more VPC endpoint IDs.
dict
Response Syntax
{
'Unsuccessful': [
{
'Error': {
'Code': 'string',
'Message': 'string'
},
'ResourceId': 'string'
},
]
}
Response Structure
(dict) --
Contains the output of DeleteVpcEndpoints.
Unsuccessful (list) --
Information about the VPC endpoints that were not successfully deleted.
(dict) --
Information about items that were not successfully processed in a batch call.
Error (dict) --
Information about the error.
Code (string) --
The error code.
Message (string) --
The error message accompanying the error code.
ResourceId (string) --
The ID of the resource.
Deletes a VPC peering connection. Either the owner of the requester VPC or the owner of the accepter VPC can delete the VPC peering connection if it's in the active state. The owner of the requester VPC can delete a VPC peering connection in the pending-acceptance state. You cannot delete a VPC peering connection that's in the failed state.
See also: AWS API Documentation
Request Syntax
response = client.delete_vpc_peering_connection(
DryRun=True|False,
VpcPeeringConnectionId='string'
)
[REQUIRED]
The ID of the VPC peering connection.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Deletes the specified VPN connection.
If you're deleting the VPC and its associated components, we recommend that you detach the virtual private gateway from the VPC and delete the VPC before deleting the VPN connection. If you believe that the tunnel credentials for your VPN connection have been compromised, you can delete the VPN connection and create a new one that has new keys, without needing to delete the VPC or virtual private gateway. If you create a new VPN connection, you must reconfigure the customer gateway using the new configuration information returned with the new VPN connection ID.
See also: AWS API Documentation
Request Syntax
response = client.delete_vpn_connection(
VpnConnectionId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the VPN connection.
None
Deletes the specified static route associated with a VPN connection between an existing virtual private gateway and a VPN customer gateway. The static route allows traffic to be routed from the virtual private gateway to the VPN customer gateway.
See also: AWS API Documentation
Request Syntax
response = client.delete_vpn_connection_route(
DestinationCidrBlock='string',
VpnConnectionId='string'
)
[REQUIRED]
The CIDR block associated with the local subnet of the customer network.
[REQUIRED]
The ID of the VPN connection.
None
Deletes the specified virtual private gateway. We recommend that before you delete a virtual private gateway, you detach it from the VPC and delete the VPN connection. Note that you don't need to delete the virtual private gateway if you plan to delete and recreate the VPN connection between your VPC and your network.
See also: AWS API Documentation
Request Syntax
response = client.delete_vpn_gateway(
VpnGatewayId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the virtual private gateway.
None
Releases the specified address range that you provisioned for use with your AWS resources through bring your own IP addresses (BYOIP) and deletes the corresponding address pool.
Before you can release an address range, you must stop advertising it using WithdrawByoipCidr and you must not have any IP addresses allocated from its address range.
See also: AWS API Documentation
Request Syntax
response = client.deprovision_byoip_cidr(
Cidr='string',
DryRun=True|False
)
[REQUIRED]
The public IPv4 address range, in CIDR notation. The prefix must be the same prefix that you specified when you provisioned the address range.
dict
Response Syntax
{
'ByoipCidr': {
'Cidr': 'string',
'Description': 'string',
'StatusMessage': 'string',
'State': 'advertised'|'deprovisioned'|'failed-deprovision'|'failed-provision'|'pending-deprovision'|'pending-provision'|'provisioned'
}
}
Response Structure
(dict) --
ByoipCidr (dict) --
Information about the address range.
Cidr (string) --
The public IPv4 address range, in CIDR notation.
Description (string) --
The description of the address range.
StatusMessage (string) --
Upon success, contains the ID of the address pool. Otherwise, contains an error message.
State (string) --
The state of the address pool.
Deregisters the specified AMI. After you deregister an AMI, it can't be used to launch new instances; however, it doesn't affect any instances that you've already launched from the AMI. You'll continue to incur usage costs for those instances until you terminate them.
When you deregister an Amazon EBS-backed AMI, it doesn't affect the snapshot that was created for the root volume of the instance during the AMI creation process. When you deregister an instance store-backed AMI, it doesn't affect the files that you uploaded to Amazon S3 when you created the AMI.
See also: AWS API Documentation
Request Syntax
response = client.deregister_image(
ImageId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the AMI.
None
Describes attributes of your AWS account. The following are the supported account attributes:
See also: AWS API Documentation
Request Syntax
response = client.describe_account_attributes(
AttributeNames=[
'supported-platforms'|'default-vpc',
],
DryRun=True|False
)
The account attribute names.
dict
Response Syntax
{
'AccountAttributes': [
{
'AttributeName': 'string',
'AttributeValues': [
{
'AttributeValue': 'string'
},
]
},
]
}
Response Structure
(dict) --
AccountAttributes (list) --
Information about the account attributes.
(dict) --
Describes an account attribute.
AttributeName (string) --
The name of the account attribute.
AttributeValues (list) --
The values for the account attribute.
(dict) --
Describes a value of an account attribute.
AttributeValue (string) --
The value of the attribute.
Examples
This example describes the supported-platforms attribute for your AWS account.
response = client.describe_account_attributes(
AttributeNames=[
'supported-platforms',
],
)
print(response)
Expected Output:
{
'AccountAttributes': [
{
'AttributeName': 'supported-platforms',
'AttributeValues': [
{
'AttributeValue': 'EC2',
},
{
'AttributeValue': 'VPC',
},
],
},
],
'ResponseMetadata': {
'...': '...',
},
}
This example describes the attributes for your AWS account.
response = client.describe_account_attributes(
)
print(response)
Expected Output:
{
'AccountAttributes': [
{
'AttributeName': 'supported-platforms',
'AttributeValues': [
{
'AttributeValue': 'EC2',
},
{
'AttributeValue': 'VPC',
},
],
},
{
'AttributeName': 'vpc-max-security-groups-per-interface',
'AttributeValues': [
{
'AttributeValue': '5',
},
],
},
{
'AttributeName': 'max-elastic-ips',
'AttributeValues': [
{
'AttributeValue': '5',
},
],
},
{
'AttributeName': 'max-instances',
'AttributeValues': [
{
'AttributeValue': '20',
},
],
},
{
'AttributeName': 'vpc-max-elastic-ips',
'AttributeValues': [
{
'AttributeValue': '5',
},
],
},
{
'AttributeName': 'default-vpc',
'AttributeValues': [
{
'AttributeValue': 'none',
},
],
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes the specified Elastic IP addresses or all of your Elastic IP addresses.
An Elastic IP address is for use in either the EC2-Classic platform or in a VPC. For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_addresses(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PublicIps=[
'string',
],
AllocationIds=[
'string',
],
DryRun=True|False
)
One or more filters. Filter names and values are case-sensitive.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more Elastic IP addresses.
Default: Describes all your Elastic IP addresses.
[EC2-VPC] Information about the allocation IDs.
dict
Response Syntax
{
'Addresses': [
{
'InstanceId': 'string',
'PublicIp': 'string',
'AllocationId': 'string',
'AssociationId': 'string',
'Domain': 'vpc'|'standard',
'NetworkInterfaceId': 'string',
'NetworkInterfaceOwnerId': 'string',
'PrivateIpAddress': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'PublicIpv4Pool': 'string'
},
]
}
Response Structure
(dict) --
Addresses (list) --
Information about the Elastic IP addresses.
(dict) --
Describes an Elastic IP address.
InstanceId (string) --
The ID of the instance that the address is associated with (if any).
PublicIp (string) --
The Elastic IP address.
AllocationId (string) --
The ID representing the allocation of the address for use with EC2-VPC.
AssociationId (string) --
The ID representing the association of the address with an instance in a VPC.
Domain (string) --
Indicates whether this Elastic IP address is for use with instances in EC2-Classic (standard ) or instances in a VPC (vpc ).
NetworkInterfaceId (string) --
The ID of the network interface.
NetworkInterfaceOwnerId (string) --
The ID of the AWS account that owns the network interface.
PrivateIpAddress (string) --
The private IP address associated with the Elastic IP address.
Tags (list) --
Any tags assigned to the Elastic IP address.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
PublicIpv4Pool (string) --
The ID of an address pool.
Examples
This example describes your Elastic IP addresses.
response = client.describe_addresses(
)
print(response)
Expected Output:
{
'Addresses': [
{
'Domain': 'standard',
'InstanceId': 'i-1234567890abcdef0',
'PublicIp': '198.51.100.0',
},
{
'AllocationId': 'eipalloc-12345678',
'AssociationId': 'eipassoc-12345678',
'Domain': 'vpc',
'InstanceId': 'i-1234567890abcdef0',
'NetworkInterfaceId': 'eni-12345678',
'NetworkInterfaceOwnerId': '123456789012',
'PrivateIpAddress': '10.0.1.241',
'PublicIp': '203.0.113.0',
},
],
'ResponseMetadata': {
'...': '...',
},
}
This example describes your Elastic IP addresses for use with instances in a VPC.
response = client.describe_addresses(
Filters=[
{
'Name': 'domain',
'Values': [
'vpc',
],
},
],
)
print(response)
Expected Output:
{
'Addresses': [
{
'AllocationId': 'eipalloc-12345678',
'AssociationId': 'eipassoc-12345678',
'Domain': 'vpc',
'InstanceId': 'i-1234567890abcdef0',
'NetworkInterfaceId': 'eni-12345678',
'NetworkInterfaceOwnerId': '123456789012',
'PrivateIpAddress': '10.0.1.241',
'PublicIp': '203.0.113.0',
},
],
'ResponseMetadata': {
'...': '...',
},
}
This example describes your Elastic IP addresses for use with instances in EC2-Classic.
response = client.describe_addresses(
Filters=[
{
'Name': 'domain',
'Values': [
'standard',
],
},
],
)
print(response)
Expected Output:
{
'Addresses': [
{
'Domain': 'standard',
'InstanceId': 'i-1234567890abcdef0',
'PublicIp': '198.51.100.0',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes the longer ID format settings for all resource types in a specific Region. This request is useful for performing a quick audit to determine whether a specific Region is fully opted in for longer IDs (17-character IDs).
This request only returns information about resource types that support longer IDs.
The following resource types support longer IDs: bundle | conversion-task | customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association | export-task | flow-log | image | import-task | instance | internet-gateway | network-acl | network-acl-association | network-interface | network-interface-attachment | prefix-list | reservation | route-table | route-table-association | security-group | snapshot | subnet | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway .
See also: AWS API Documentation
Request Syntax
response = client.describe_aggregate_id_format(
DryRun=True|False
)
{
'UseLongIdsAggregated': True|False,
'Statuses': [
{
'Deadline': datetime(2015, 1, 1),
'Resource': 'string',
'UseLongIds': True|False
},
]
}
Response Structure
Indicates whether all resource types in the Region are configured to use longer IDs. This value is only true if all users are configured to use longer IDs for all resources types in the Region.
Information about each resource's ID format.
Describes the ID format for a resource.
The date in UTC at which you are permanently switched over to using longer IDs. If a deadline is not yet available for this resource type, this field is not returned.
The type of resource.
Indicates whether longer IDs (17-character IDs) are enabled for the resource.
Describes the Availability Zones that are available to you. The results include zones only for the Region you're currently using. If there is an event impacting an Availability Zone, you can use this request to view the state and any provided message for that Availability Zone.
For more information, see Regions and Availability Zones in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_availability_zones(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
ZoneNames=[
'string',
],
ZoneIds=[
'string',
],
DryRun=True|False
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The names of the Availability Zones.
The IDs of the Availability Zones.
dict
Response Syntax
{
'AvailabilityZones': [
{
'State': 'available'|'information'|'impaired'|'unavailable',
'Messages': [
{
'Message': 'string'
},
],
'RegionName': 'string',
'ZoneName': 'string',
'ZoneId': 'string'
},
]
}
Response Structure
(dict) --
AvailabilityZones (list) --
Information about the Availability Zones.
(dict) --
Describes an Availability Zone.
State (string) --
The state of the Availability Zone.
Messages (list) --
Any messages about the Availability Zone.
(dict) --
Describes a message about an Availability Zone.
Message (string) --
The message about the Availability Zone.
RegionName (string) --
The name of the Region.
ZoneName (string) --
The name of the Availability Zone.
ZoneId (string) --
The ID of the Availability Zone.
Examples
This example describes the Availability Zones that are available to you. The response includes Availability Zones only for the current region.
response = client.describe_availability_zones(
)
print(response)
Expected Output:
{
'AvailabilityZones': [
{
'Messages': [
],
'RegionName': 'us-east-1',
'State': 'available',
'ZoneName': 'us-east-1b',
},
{
'Messages': [
],
'RegionName': 'us-east-1',
'State': 'available',
'ZoneName': 'us-east-1c',
},
{
'Messages': [
],
'RegionName': 'us-east-1',
'State': 'available',
'ZoneName': 'us-east-1d',
},
{
'Messages': [
],
'RegionName': 'us-east-1',
'State': 'available',
'ZoneName': 'us-east-1e',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes the specified bundle tasks or all of your bundle tasks.
Note
Completed bundle tasks are listed for only a limited time. If your bundle task is no longer in the list, you can still register an AMI from it. Just use RegisterImage with the Amazon S3 bucket name and image manifest name you provided to the bundle task.
See also: AWS API Documentation
Request Syntax
response = client.describe_bundle_tasks(
BundleIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False
)
The bundle task IDs.
Default: Describes all your bundle tasks.
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'BundleTasks': [
{
'BundleId': 'string',
'BundleTaskError': {
'Code': 'string',
'Message': 'string'
},
'InstanceId': 'string',
'Progress': 'string',
'StartTime': datetime(2015, 1, 1),
'State': 'pending'|'waiting-for-shutdown'|'bundling'|'storing'|'cancelling'|'complete'|'failed',
'Storage': {
'S3': {
'AWSAccessKeyId': 'string',
'Bucket': 'string',
'Prefix': 'string',
'UploadPolicy': b'bytes',
'UploadPolicySignature': 'string'
}
},
'UpdateTime': datetime(2015, 1, 1)
},
]
}
Response Structure
(dict) --
BundleTasks (list) --
Information about the bundle tasks.
(dict) --
Describes a bundle task.
BundleId (string) --
The ID of the bundle task.
BundleTaskError (dict) --
If the task fails, a description of the error.
Code (string) --
The error code.
Message (string) --
The error message.
InstanceId (string) --
The ID of the instance associated with this bundle task.
Progress (string) --
The level of task completion, as a percent (for example, 20%).
StartTime (datetime) --
The time this task started.
State (string) --
The state of the task.
Storage (dict) --
The Amazon S3 storage locations.
S3 (dict) --
An Amazon S3 storage location.
AWSAccessKeyId (string) --
The access key ID of the owner of the bucket. Before you specify a value for your access key ID, review and follow the guidance in Best Practices for Managing AWS Access Keys .
Bucket (string) --
The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.
Prefix (string) --
The beginning of the file name of the AMI.
UploadPolicy (bytes) --
An Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.
UploadPolicySignature (string) --
The signature of the JSON document.
UpdateTime (datetime) --
The time of the most recent update for the task.
Describes the IP address ranges that were specified in calls to ProvisionByoipCidr .
To describe the address pools that were created when you provisioned the address ranges, use DescribePublicIpv4Pools .
See also: AWS API Documentation
Request Syntax
response = client.describe_byoip_cidrs(
DryRun=True|False,
MaxResults=123,
NextToken='string'
)
[REQUIRED]
The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
dict
Response Syntax
{
'ByoipCidrs': [
{
'Cidr': 'string',
'Description': 'string',
'StatusMessage': 'string',
'State': 'advertised'|'deprovisioned'|'failed-deprovision'|'failed-provision'|'pending-deprovision'|'pending-provision'|'provisioned'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
ByoipCidrs (list) --
Information about your address ranges.
(dict) --
Information about an address range that is provisioned for use with your AWS resources through bring your own IP addresses (BYOIP).
Cidr (string) --
The public IPv4 address range, in CIDR notation.
Description (string) --
The description of the address range.
StatusMessage (string) --
Upon success, contains the ID of the address pool. Otherwise, contains an error message.
State (string) --
The state of the address pool.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes one or more of your Capacity Reservations. The results describe only the Capacity Reservations in the AWS Region that you're currently using.
See also: AWS API Documentation
Request Syntax
response = client.describe_capacity_reservations(
CapacityReservationIds=[
'string',
],
NextToken='string',
MaxResults=123,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False
)
The ID of the Capacity Reservation.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'NextToken': 'string',
'CapacityReservations': [
{
'CapacityReservationId': 'string',
'InstanceType': 'string',
'InstancePlatform': 'Linux/UNIX'|'Red Hat Enterprise Linux'|'SUSE Linux'|'Windows'|'Windows with SQL Server'|'Windows with SQL Server Enterprise'|'Windows with SQL Server Standard'|'Windows with SQL Server Web'|'Linux with SQL Server Standard'|'Linux with SQL Server Web'|'Linux with SQL Server Enterprise',
'AvailabilityZone': 'string',
'Tenancy': 'default'|'dedicated',
'TotalInstanceCount': 123,
'AvailableInstanceCount': 123,
'EbsOptimized': True|False,
'EphemeralStorage': True|False,
'State': 'active'|'expired'|'cancelled'|'pending'|'failed',
'EndDate': datetime(2015, 1, 1),
'EndDateType': 'unlimited'|'limited',
'InstanceMatchCriteria': 'open'|'targeted',
'CreateDate': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
]
}
Response Structure
(dict) --
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
CapacityReservations (list) --
Information about the Capacity Reservations.
(dict) --
Describes a Capacity Reservation.
CapacityReservationId (string) --
The ID of the Capacity Reservation.
InstanceType (string) --
The type of instance for which the Capacity Reservation reserves capacity.
InstancePlatform (string) --
The type of operating system for which the Capacity Reservation reserves capacity.
AvailabilityZone (string) --
The Availability Zone in which the capacity is reserved.
Tenancy (string) --
Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy settings:
TotalInstanceCount (integer) --
The number of instances for which the Capacity Reservation reserves capacity.
AvailableInstanceCount (integer) --
The remaining capacity. Indicates the number of instances that can be launched in the Capacity Reservation.
EbsOptimized (boolean) --
Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized instance.
EphemeralStorage (boolean) --
Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.
State (string) --
The current state of the Capacity Reservation. A Capacity Reservation can be in one of the following states:
EndDate (datetime) --
The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to expired when it reaches its end date and time.
EndDateType (string) --
Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following end types:
InstanceMatchCriteria (string) --
Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
CreateDate (datetime) --
The date and time at which the Capacity Reservation was created.
Tags (list) --
Any tags assigned to the Capacity Reservation.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Describes one or more of your linked EC2-Classic instances. This request only returns information about EC2-Classic instances linked to a VPC through ClassicLink. You cannot use this request to return information about other instances.
See also: AWS API Documentation
Request Syntax
response = client.describe_classic_link_instances(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
InstanceIds=[
'string',
],
MaxResults=123,
NextToken='string'
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more instance IDs. Must be instances linked to a VPC through ClassicLink.
The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
Constraint: If the value is greater than 1000, we return only 1000 items.
dict
Response Syntax
{
'Instances': [
{
'Groups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'InstanceId': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VpcId': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Instances (list) --
Information about one or more linked EC2-Classic instances.
(dict) --
Describes a linked EC2-Classic instance.
Groups (list) --
A list of security groups.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
InstanceId (string) --
The ID of the instance.
Tags (list) --
Any tags assigned to the instance.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VpcId (string) --
The ID of the VPC.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes the authorization rules for a specified Client VPN endpoint.
See also: AWS API Documentation
Request Syntax
response = client.describe_client_vpn_authorization_rules(
ClientVpnEndpointId='string',
DryRun=True|False,
NextToken='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123
)
[REQUIRED]
The ID of the Client VPN endpoint.
One or more filters. Filter names and values are case-sensitive.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'AuthorizationRules': [
{
'ClientVpnEndpointId': 'string',
'Description': 'string',
'GroupId': 'string',
'AccessAll': True|False,
'DestinationCidr': 'string',
'Status': {
'Code': 'authorizing'|'active'|'failed'|'revoking',
'Message': 'string'
}
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
AuthorizationRules (list) --
Information about the authorization rules.
(dict) --
Information about an authorization rule.
ClientVpnEndpointId (string) --
The ID of the Client VPN endpoint with which the authorization rule is associated.
Description (string) --
A brief description of the authorization rule.
GroupId (string) --
The ID of the Active Directory group to which the authorization rule grants access.
AccessAll (boolean) --
Indicates whether the authorization rule grants access to all clients.
DestinationCidr (string) --
The IPv4 address range, in CIDR notation, of the network to which the authorization rule applies.
Status (dict) --
The current state of the authorization rule.
Code (string) --
The state of the authorization rule.
Message (string) --
A message about the status of the authorization rule, if applicable.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes active client connections and connections that have been terminated within the last 60 minutes for the specified Client VPN endpoint.
See also: AWS API Documentation
Request Syntax
response = client.describe_client_vpn_connections(
ClientVpnEndpointId='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
NextToken='string',
MaxResults=123,
DryRun=True|False
)
[REQUIRED]
The ID of the Client VPN endpoint.
One or more filters. Filter names and values are case-sensitive.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'Connections': [
{
'ClientVpnEndpointId': 'string',
'Timestamp': 'string',
'ConnectionId': 'string',
'Username': 'string',
'ConnectionEstablishedTime': 'string',
'IngressBytes': 'string',
'EgressBytes': 'string',
'IngressPackets': 'string',
'EgressPackets': 'string',
'ClientIp': 'string',
'CommonName': 'string',
'Status': {
'Code': 'active'|'failed-to-terminate'|'terminating'|'terminated',
'Message': 'string'
},
'ConnectionEndTime': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Connections (list) --
Information about the active and terminated client connections.
(dict) --
Describes a client connection.
ClientVpnEndpointId (string) --
The ID of the Client VPN endpoint to which the client is connected.
Timestamp (string) --
The current date and time.
ConnectionId (string) --
The ID of the client connection.
Username (string) --
The username of the client who established the client connection. This information is only provided if Active Directory client authentication is used.
ConnectionEstablishedTime (string) --
The date and time the client connection was established.
IngressBytes (string) --
The number of bytes sent by the client.
EgressBytes (string) --
The number of bytes received by the client.
IngressPackets (string) --
The number of packets sent by the client.
EgressPackets (string) --
The number of packets received by the client.
ClientIp (string) --
The IP address of the client.
CommonName (string) --
The common name associated with the client. This is either the name of the client certificate, or the Active Directory user name.
Status (dict) --
The current state of the client connection.
Code (string) --
The state of the client connection.
Message (string) --
A message about the status of the client connection, if applicable.
ConnectionEndTime (string) --
The date and time the client connection was terminated.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes one or more Client VPN endpoints in the account.
See also: AWS API Documentation
Request Syntax
response = client.describe_client_vpn_endpoints(
ClientVpnEndpointIds=[
'string',
],
MaxResults=123,
NextToken='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False
)
The ID of the Client VPN endpoint.
One or more filters. Filter names and values are case-sensitive.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'ClientVpnEndpoints': [
{
'ClientVpnEndpointId': 'string',
'Description': 'string',
'Status': {
'Code': 'pending-associate'|'available'|'deleting'|'deleted',
'Message': 'string'
},
'CreationTime': 'string',
'DeletionTime': 'string',
'DnsName': 'string',
'ClientCidrBlock': 'string',
'DnsServers': [
'string',
],
'SplitTunnel': True|False,
'VpnProtocol': 'openvpn',
'TransportProtocol': 'tcp'|'udp',
'AssociatedTargetNetworks': [
{
'NetworkId': 'string',
'NetworkType': 'vpc'
},
],
'ServerCertificateArn': 'string',
'AuthenticationOptions': [
{
'Type': 'certificate-authentication'|'directory-service-authentication',
'ActiveDirectory': {
'DirectoryId': 'string'
},
'MutualAuthentication': {
'ClientRootCertificateChain': 'string'
}
},
],
'ConnectionLogOptions': {
'Enabled': True|False,
'CloudwatchLogGroup': 'string',
'CloudwatchLogStream': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
ClientVpnEndpoints (list) --
Information about the Client VPN endpoints.
(dict) --
Describes a Client VPN endpoint.
ClientVpnEndpointId (string) --
The ID of the Client VPN endpoint.
Description (string) --
A brief description of the endpoint.
Status (dict) --
The current state of the Client VPN endpoint.
Code (string) --
The state of the Client VPN endpoint. Possible states include:
Message (string) --
A message about the status of the Client VPN endpoint.
CreationTime (string) --
The date and time the Client VPN endpoint was created.
DeletionTime (string) --
The date and time the Client VPN endpoint was deleted, if applicable.
DnsName (string) --
The DNS name to be used by clients when connecting to the Client VPN endpoint.
ClientCidrBlock (string) --
The IPv4 address range, in CIDR notation, from which client IP addresses are assigned.
DnsServers (list) --
Information about the DNS servers to be used for DNS resolution.
SplitTunnel (boolean) --
Indicates whether VPN split tunneling is supported.
VpnProtocol (string) --
The protocol used by the VPN session.
TransportProtocol (string) --
The transport protocol used by the Client VPN endpoint.
AssociatedTargetNetworks (list) --
Information about the associated target networks. A target network is a subnet in a VPC.
(dict) --
Describes a target network that is associated with a Client VPN endpoint. A target network is a subnet in a VPC.
NetworkId (string) --
The ID of the subnet.
NetworkType (string) --
The target network type.
ServerCertificateArn (string) --
The ARN of the server certificate.
AuthenticationOptions (list) --
Information about the authentication method used by the Client VPN endpoint.
(dict) --
Describes the authentication methods used by a Client VPN endpoint. Client VPN supports Active Directory and mutual authentication. For more information, see Authentication in the AWS Client VPN Administrator Guide .
Type (string) --
The authentication type used.
ActiveDirectory (dict) --
Information about the Active Directory, if applicable.
DirectoryId (string) --
The ID of the Active Directory used for authentication.
MutualAuthentication (dict) --
Information about the authentication certificates, if applicable.
ClientRootCertificateChain (string) --
The ARN of the client certificate.
ConnectionLogOptions (dict) --
Information about the client connection logging options for the Client VPN endpoint.
Enabled (boolean) --
Indicates whether client connection logging is enabled for the Client VPN endpoint.
CloudwatchLogGroup (string) --
The name of the Amazon CloudWatch Logs log group to which connection logging data is published.
CloudwatchLogStream (string) --
The name of the Amazon CloudWatch Logs log stream to which connection logging data is published.
Tags (list) --
Any tags assigned to the Client VPN endpoint.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes the routes for the specified Client VPN endpoint.
See also: AWS API Documentation
Request Syntax
response = client.describe_client_vpn_routes(
ClientVpnEndpointId='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string',
DryRun=True|False
)
[REQUIRED]
The ID of the Client VPN endpoint.
One or more filters. Filter names and values are case-sensitive.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'Routes': [
{
'ClientVpnEndpointId': 'string',
'DestinationCidr': 'string',
'TargetSubnet': 'string',
'Type': 'string',
'Origin': 'string',
'Status': {
'Code': 'creating'|'active'|'failed'|'deleting',
'Message': 'string'
},
'Description': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Routes (list) --
Information about the Client VPN endpoint routes.
(dict) --
Information about a Client VPN endpoint route.
ClientVpnEndpointId (string) --
The ID of the Client VPN endpoint with which the route is associated.
DestinationCidr (string) --
The IPv4 address range, in CIDR notation, of the route destination.
TargetSubnet (string) --
The ID of the subnet through which traffic is routed.
Type (string) --
The route type.
Origin (string) --
Indicates how the route was associated with the Client VPN endpoint. associate indicates that the route was automatically added when the target network was associated with the Client VPN endpoint. add-route indicates that the route was manually added using the CreateClientVpnRoute action.
Status (dict) --
The current state of the route.
Code (string) --
The state of the Client VPN endpoint route.
Message (string) --
A message about the status of the Client VPN endpoint route, if applicable.
Description (string) --
A brief description of the route.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes the target networks associated with the specified Client VPN endpoint.
See also: AWS API Documentation
Request Syntax
response = client.describe_client_vpn_target_networks(
ClientVpnEndpointId='string',
AssociationIds=[
'string',
],
MaxResults=123,
NextToken='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False
)
[REQUIRED]
The ID of the Client VPN endpoint.
The IDs of the target network associations.
One or more filters. Filter names and values are case-sensitive.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'ClientVpnTargetNetworks': [
{
'AssociationId': 'string',
'VpcId': 'string',
'TargetNetworkId': 'string',
'ClientVpnEndpointId': 'string',
'Status': {
'Code': 'associating'|'associated'|'association-failed'|'disassociating'|'disassociated',
'Message': 'string'
},
'SecurityGroups': [
'string',
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
ClientVpnTargetNetworks (list) --
Information about the associated target networks.
(dict) --
Describes a target network associated with a Client VPN endpoint.
AssociationId (string) --
The ID of the association.
VpcId (string) --
The ID of the VPC in which the target network (subnet) is located.
TargetNetworkId (string) --
The ID of the subnet specified as the target network.
ClientVpnEndpointId (string) --
The ID of the Client VPN endpoint with which the target network is associated.
Status (dict) --
The current state of the target network association.
Code (string) --
The state of the target network association.
Message (string) --
A message about the status of the target network association, if applicable.
SecurityGroups (list) --
The IDs of the security groups applied to the target network association.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes the specified conversion tasks or all your conversion tasks. For more information, see the VM Import/Export User Guide .
For information about the import manifest referenced by this API action, see VM Import Manifest .
See also: AWS API Documentation
Request Syntax
response = client.describe_conversion_tasks(
ConversionTaskIds=[
'string',
],
DryRun=True|False
)
The conversion task IDs.
dict
Response Syntax
{
'ConversionTasks': [
{
'ConversionTaskId': 'string',
'ExpirationTime': 'string',
'ImportInstance': {
'Description': 'string',
'InstanceId': 'string',
'Platform': 'Windows',
'Volumes': [
{
'AvailabilityZone': 'string',
'BytesConverted': 123,
'Description': 'string',
'Image': {
'Checksum': 'string',
'Format': 'VMDK'|'RAW'|'VHD',
'ImportManifestUrl': 'string',
'Size': 123
},
'Status': 'string',
'StatusMessage': 'string',
'Volume': {
'Id': 'string',
'Size': 123
}
},
]
},
'ImportVolume': {
'AvailabilityZone': 'string',
'BytesConverted': 123,
'Description': 'string',
'Image': {
'Checksum': 'string',
'Format': 'VMDK'|'RAW'|'VHD',
'ImportManifestUrl': 'string',
'Size': 123
},
'Volume': {
'Id': 'string',
'Size': 123
}
},
'State': 'active'|'cancelling'|'cancelled'|'completed',
'StatusMessage': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
]
}
Response Structure
(dict) --
ConversionTasks (list) --
Information about the conversion tasks.
(dict) --
Describes a conversion task.
ConversionTaskId (string) --
The ID of the conversion task.
ExpirationTime (string) --
The time when the task expires. If the upload isn't complete before the expiration time, we automatically cancel the task.
ImportInstance (dict) --
If the task is for importing an instance, this contains information about the import instance task.
Description (string) --
A description of the task.
InstanceId (string) --
The ID of the instance.
Platform (string) --
The instance operating system.
Volumes (list) --
The volumes.
(dict) --
Describes an import volume task.
AvailabilityZone (string) --
The Availability Zone where the resulting instance will reside.
BytesConverted (integer) --
The number of bytes converted so far.
Description (string) --
A description of the task.
Image (dict) --
The image.
Checksum (string) --
The checksum computed for the disk image.
Format (string) --
The disk image format.
ImportManifestUrl (string) --
A presigned URL for the import manifest stored in Amazon S3. For information about creating a presigned URL for an Amazon S3 object, read the "Query String Request Authentication Alternative" section of the Authenticating REST Requests topic in the Amazon Simple Storage Service Developer Guide .
For information about the import manifest referenced by this API action, see VM Import Manifest .
Size (integer) --
The size of the disk image, in GiB.
Status (string) --
The status of the import of this particular disk image.
StatusMessage (string) --
The status information or errors related to the disk image.
Volume (dict) --
The volume.
Id (string) --
The volume identifier.
Size (integer) --
The size of the volume, in GiB.
ImportVolume (dict) --
If the task is for importing a volume, this contains information about the import volume task.
AvailabilityZone (string) --
The Availability Zone where the resulting volume will reside.
BytesConverted (integer) --
The number of bytes converted so far.
Description (string) --
The description you provided when starting the import volume task.
Image (dict) --
The image.
Checksum (string) --
The checksum computed for the disk image.
Format (string) --
The disk image format.
ImportManifestUrl (string) --
A presigned URL for the import manifest stored in Amazon S3. For information about creating a presigned URL for an Amazon S3 object, read the "Query String Request Authentication Alternative" section of the Authenticating REST Requests topic in the Amazon Simple Storage Service Developer Guide .
For information about the import manifest referenced by this API action, see VM Import Manifest .
Size (integer) --
The size of the disk image, in GiB.
Volume (dict) --
The volume.
Id (string) --
The volume identifier.
Size (integer) --
The size of the volume, in GiB.
State (string) --
The state of the conversion task.
StatusMessage (string) --
The status message related to the conversion task.
Tags (list) --
Any tags assigned to the task.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Describes one or more of your VPN customer gateways.
For more information, see AWS Site-to-Site VPN in the AWS Site-to-Site VPN User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_customer_gateways(
CustomerGatewayIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False
)
One or more customer gateway IDs.
Default: Describes all your customer gateways.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'CustomerGateways': [
{
'BgpAsn': 'string',
'CustomerGatewayId': 'string',
'IpAddress': 'string',
'State': 'string',
'Type': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
]
}
Response Structure
(dict) --
Contains the output of DescribeCustomerGateways.
CustomerGateways (list) --
Information about one or more customer gateways.
(dict) --
Describes a customer gateway.
BgpAsn (string) --
The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
CustomerGatewayId (string) --
The ID of the customer gateway.
IpAddress (string) --
The Internet-routable IP address of the customer gateway's outside interface.
State (string) --
The current state of the customer gateway (pending | available | deleting | deleted ).
Type (string) --
The type of VPN connection the customer gateway supports (ipsec.1 ).
Tags (list) --
Any tags assigned to the customer gateway.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Examples
This example describes the specified customer gateway.
response = client.describe_customer_gateways(
CustomerGatewayIds=[
'cgw-0e11f167',
],
)
print(response)
Expected Output:
{
'CustomerGateways': [
{
'BgpAsn': '65534',
'CustomerGatewayId': 'cgw-0e11f167',
'IpAddress': '12.1.2.3',
'State': 'available',
'Type': 'ipsec.1',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes one or more of your DHCP options sets.
For more information, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_dhcp_options(
DhcpOptionsIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
NextToken='string',
MaxResults=123
)
The IDs of one or more DHCP options sets.
Default: Describes all your DHCP options sets.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'DhcpOptions': [
{
'DhcpConfigurations': [
{
'Key': 'string',
'Values': [
{
'Value': 'string'
},
]
},
],
'DhcpOptionsId': 'string',
'OwnerId': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
DhcpOptions (list) --
Information about one or more DHCP options sets.
(dict) --
Describes a set of DHCP options.
DhcpConfigurations (list) --
One or more DHCP options in the set.
(dict) --
Describes a DHCP configuration option.
Key (string) --
The name of a DHCP option.
Values (list) --
One or more values for the DHCP option.
(dict) --
Describes a value for a resource attribute that is a String.
Value (string) --
The attribute value. The value is case-sensitive.
DhcpOptionsId (string) --
The ID of the set of DHCP options.
OwnerId (string) --
The ID of the AWS account that owns the DHCP options set.
Tags (list) --
Any tags assigned to the DHCP options set.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Examples
This example describes the specified DHCP options set.
response = client.describe_dhcp_options(
DhcpOptionsIds=[
'dopt-d9070ebb',
],
)
print(response)
Expected Output:
{
'DhcpOptions': [
{
'DhcpConfigurations': [
{
'Key': 'domain-name-servers',
'Values': [
{
'Value': '10.2.5.2',
},
{
'Value': '10.2.5.1',
},
],
},
],
'DhcpOptionsId': 'dopt-d9070ebb',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes one or more of your egress-only internet gateways.
See also: AWS API Documentation
Request Syntax
response = client.describe_egress_only_internet_gateways(
DryRun=True|False,
EgressOnlyInternetGatewayIds=[
'string',
],
MaxResults=123,
NextToken='string'
)
One or more egress-only internet gateway IDs.
dict
Response Syntax
{
'EgressOnlyInternetGateways': [
{
'Attachments': [
{
'State': 'attaching'|'attached'|'detaching'|'detached',
'VpcId': 'string'
},
],
'EgressOnlyInternetGatewayId': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
EgressOnlyInternetGateways (list) --
Information about the egress-only internet gateways.
(dict) --
Describes an egress-only internet gateway.
Attachments (list) --
Information about the attachment of the egress-only internet gateway.
(dict) --
Describes the attachment of a VPC to an internet gateway or an egress-only internet gateway.
State (string) --
The current state of the attachment. For an internet gateway, the state is available when attached to a VPC; otherwise, this value is not returned.
VpcId (string) --
The ID of the VPC.
EgressOnlyInternetGatewayId (string) --
The ID of the egress-only internet gateway.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes the Elastic Graphics accelerator associated with your instances. For more information about Elastic Graphics, see Amazon Elastic Graphics .
See also: AWS API Documentation
Request Syntax
response = client.describe_elastic_gpus(
ElasticGpuIds=[
'string',
],
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string'
)
The Elastic Graphics accelerator IDs.
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'ElasticGpuSet': [
{
'ElasticGpuId': 'string',
'AvailabilityZone': 'string',
'ElasticGpuType': 'string',
'ElasticGpuHealth': {
'Status': 'OK'|'IMPAIRED'
},
'ElasticGpuState': 'ATTACHED',
'InstanceId': 'string'
},
],
'MaxResults': 123,
'NextToken': 'string'
}
Response Structure
(dict) --
ElasticGpuSet (list) --
Information about the Elastic Graphics accelerators.
(dict) --
Describes an Elastic Graphics accelerator.
ElasticGpuId (string) --
The ID of the Elastic Graphics accelerator.
AvailabilityZone (string) --
The Availability Zone in the which the Elastic Graphics accelerator resides.
ElasticGpuType (string) --
The type of Elastic Graphics accelerator.
ElasticGpuHealth (dict) --
The status of the Elastic Graphics accelerator.
Status (string) --
The health status.
ElasticGpuState (string) --
The state of the Elastic Graphics accelerator.
InstanceId (string) --
The ID of the instance to which the Elastic Graphics accelerator is attached.
MaxResults (integer) --
The total number of items to return. If the total number of items available is more than the value specified in max-items then a Next-Token will be provided in the output that you can use to resume pagination.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes the specified export tasks or all your export tasks.
See also: AWS API Documentation
Request Syntax
response = client.describe_export_tasks(
ExportTaskIds=[
'string',
]
)
The export task IDs.
{
'ExportTasks': [
{
'Description': 'string',
'ExportTaskId': 'string',
'ExportToS3Task': {
'ContainerFormat': 'ova',
'DiskImageFormat': 'VMDK'|'RAW'|'VHD',
'S3Bucket': 'string',
'S3Key': 'string'
},
'InstanceExportDetails': {
'InstanceId': 'string',
'TargetEnvironment': 'citrix'|'vmware'|'microsoft'
},
'State': 'active'|'cancelling'|'cancelled'|'completed',
'StatusMessage': 'string'
},
]
}
Response Structure
Information about the export tasks.
Describes an instance export task.
A description of the resource being exported.
The ID of the export task.
Information about the export task.
The container format used to combine disk images with metadata (such as OVF). If absent, only the disk image is exported.
The format for the exported image.
The S3 bucket for the destination image. The destination bucket must exist and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com .
The encryption key for your S3 bucket.
Information about the instance to export.
The ID of the resource being exported.
The target virtualization environment.
The state of the export task.
The status message related to the export task.
Describes the events for the specified EC2 Fleet during the specified time.
See also: AWS API Documentation
Request Syntax
response = client.describe_fleet_history(
DryRun=True|False,
EventType='instance-change'|'fleet-change'|'service-error',
MaxResults=123,
NextToken='string',
FleetId='string',
StartTime=datetime(2015, 1, 1)
)
[REQUIRED]
The ID of the EC2 Fleet.
[REQUIRED]
The start date and time for the events, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).
dict
Response Syntax
{
'HistoryRecords': [
{
'EventInformation': {
'EventDescription': 'string',
'EventSubType': 'string',
'InstanceId': 'string'
},
'EventType': 'instance-change'|'fleet-change'|'service-error',
'Timestamp': datetime(2015, 1, 1)
},
],
'LastEvaluatedTime': datetime(2015, 1, 1),
'NextToken': 'string',
'FleetId': 'string',
'StartTime': datetime(2015, 1, 1)
}
Response Structure
(dict) --
HistoryRecords (list) --
Information about the events in the history of the EC2 Fleet.
(dict) --
Describes an event in the history of an EC2 Fleet.
EventInformation (dict) --
Information about the event.
EventDescription (string) --
The description of the event.
EventSubType (string) --
The event.
The following are the error events:
The following are the fleetRequestChange events:
The following are the instanceChange events:
The following are the Information events:
InstanceId (string) --
The ID of the instance. This information is available only for instanceChange events.
EventType (string) --
The event type.
Timestamp (datetime) --
The date and time of the event, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).
LastEvaluatedTime (datetime) --
The last date and time for the events, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). All records up to this time were retrieved.
If nextToken indicates that there are more results, this value is not present.
NextToken (string) --
The token for the next set of results.
FleetId (string) --
The ID of the EC Fleet.
StartTime (datetime) --
The start date and time for the events, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).
Describes the running instances for the specified EC2 Fleet.
See also: AWS API Documentation
Request Syntax
response = client.describe_fleet_instances(
DryRun=True|False,
MaxResults=123,
NextToken='string',
FleetId='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
]
)
[REQUIRED]
The ID of the EC2 Fleet.
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'ActiveInstances': [
{
'InstanceId': 'string',
'InstanceType': 'string',
'SpotInstanceRequestId': 'string',
'InstanceHealth': 'healthy'|'unhealthy'
},
],
'NextToken': 'string',
'FleetId': 'string'
}
Response Structure
(dict) --
ActiveInstances (list) --
The running instances. This list is refreshed periodically and might be out of date.
(dict) --
Describes a running instance in a Spot Fleet.
InstanceId (string) --
The ID of the instance.
InstanceType (string) --
The instance type.
SpotInstanceRequestId (string) --
The ID of the Spot Instance request.
InstanceHealth (string) --
The health status of the instance. If the status of either the instance status check or the system status check is impaired , the health status of the instance is unhealthy . Otherwise, the health status is healthy .
NextToken (string) --
The token for the next set of results.
FleetId (string) --
The ID of the EC2 Fleet.
Describes the specified EC2 Fleets or all your EC2 Fleets.
See also: AWS API Documentation
Request Syntax
response = client.describe_fleets(
DryRun=True|False,
MaxResults=123,
NextToken='string',
FleetIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
]
)
The ID of the EC2 Fleets.
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'NextToken': 'string',
'Fleets': [
{
'ActivityStatus': 'error'|'pending-fulfillment'|'pending-termination'|'fulfilled',
'CreateTime': datetime(2015, 1, 1),
'FleetId': 'string',
'FleetState': 'submitted'|'active'|'deleted'|'failed'|'deleted-running'|'deleted-terminating'|'modifying',
'ClientToken': 'string',
'ExcessCapacityTerminationPolicy': 'no-termination'|'termination',
'FulfilledCapacity': 123.0,
'FulfilledOnDemandCapacity': 123.0,
'LaunchTemplateConfigs': [
{
'LaunchTemplateSpecification': {
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'Version': 'string'
},
'Overrides': [
{
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'MaxPrice': 'string',
'SubnetId': 'string',
'AvailabilityZone': 'string',
'WeightedCapacity': 123.0,
'Priority': 123.0,
'Placement': {
'GroupName': 'string'
}
},
]
},
],
'TargetCapacitySpecification': {
'TotalTargetCapacity': 123,
'OnDemandTargetCapacity': 123,
'SpotTargetCapacity': 123,
'DefaultTargetCapacityType': 'spot'|'on-demand'
},
'TerminateInstancesWithExpiration': True|False,
'Type': 'request'|'maintain'|'instant',
'ValidFrom': datetime(2015, 1, 1),
'ValidUntil': datetime(2015, 1, 1),
'ReplaceUnhealthyInstances': True|False,
'SpotOptions': {
'AllocationStrategy': 'lowest-price'|'diversified',
'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate',
'InstancePoolsToUseCount': 123,
'SingleInstanceType': True|False,
'SingleAvailabilityZone': True|False,
'MinTargetCapacity': 123,
'MaxTotalPrice': 'string'
},
'OnDemandOptions': {
'AllocationStrategy': 'lowest-price'|'prioritized',
'SingleInstanceType': True|False,
'SingleAvailabilityZone': True|False,
'MinTargetCapacity': 123,
'MaxTotalPrice': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'Errors': [
{
'LaunchTemplateAndOverrides': {
'LaunchTemplateSpecification': {
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'Version': 'string'
},
'Overrides': {
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'MaxPrice': 'string',
'SubnetId': 'string',
'AvailabilityZone': 'string',
'WeightedCapacity': 123.0,
'Priority': 123.0,
'Placement': {
'GroupName': 'string'
}
}
},
'Lifecycle': 'spot'|'on-demand',
'ErrorCode': 'string',
'ErrorMessage': 'string'
},
],
'Instances': [
{
'LaunchTemplateAndOverrides': {
'LaunchTemplateSpecification': {
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'Version': 'string'
},
'Overrides': {
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'MaxPrice': 'string',
'SubnetId': 'string',
'AvailabilityZone': 'string',
'WeightedCapacity': 123.0,
'Priority': 123.0,
'Placement': {
'GroupName': 'string'
}
}
},
'Lifecycle': 'spot'|'on-demand',
'InstanceIds': [
'string',
],
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'Platform': 'Windows'
},
]
},
]
}
Response Structure
(dict) --
NextToken (string) --
The token for the next set of results.
Fleets (list) --
Information about the EC2 Fleets.
(dict) --
Describes an EC2 Fleet.
ActivityStatus (string) --
The progress of the EC2 Fleet. If there is an error, the status is error . After all requests are placed, the status is pending_fulfillment . If the size of the EC2 Fleet is equal to or greater than its target capacity, the status is fulfilled . If the size of the EC2 Fleet is decreased, the status is pending_termination while instances are terminating.
CreateTime (datetime) --
The creation date and time of the EC2 Fleet.
FleetId (string) --
The ID of the EC2 Fleet.
FleetState (string) --
The state of the EC2 Fleet.
ClientToken (string) --
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency .
Constraints: Maximum 64 ASCII characters
ExcessCapacityTerminationPolicy (string) --
Indicates whether running instances should be terminated if the target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.
FulfilledCapacity (float) --
The number of units fulfilled by this request compared to the set target capacity.
FulfilledOnDemandCapacity (float) --
The number of units fulfilled by this request compared to the set target On-Demand capacity.
LaunchTemplateConfigs (list) --
The launch template and overrides.
(dict) --
Describes a launch template and overrides.
LaunchTemplateSpecification (dict) --
The launch template.
LaunchTemplateId (string) --
The ID of the launch template. You must specify either a template ID or a template name.
LaunchTemplateName (string) --
The name of the launch template. You must specify either a template name or a template ID.
Version (string) --
The version number of the launch template. You must specify a version number.
Overrides (list) --
Any parameters that you specify override the same parameters in the launch template.
(dict) --
Describes overrides for a launch template.
InstanceType (string) --
The instance type.
MaxPrice (string) --
The maximum price per unit hour that you are willing to pay for a Spot Instance.
SubnetId (string) --
The ID of the subnet in which to launch the instances.
AvailabilityZone (string) --
The Availability Zone in which to launch the instances.
WeightedCapacity (float) --
The number of units provided by the specified instance type.
Priority (float) --
The priority for the launch template override. If AllocationStrategy is set to prioritized , EC2 Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity. The highest priority is launched first. Valid values are whole numbers starting at 0 . The lower the number, the higher the priority. If no number is set, the override has the lowest priority.
Placement (dict) --
The location where the instance launched, if applicable.
GroupName (string) --
The name of the placement group the instance is in.
TargetCapacitySpecification (dict) --
The number of units to request. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is maintain , you can specify a target capacity of 0 and add capacity later.
TotalTargetCapacity (integer) --
The number of units to request, filled using DefaultTargetCapacityType .
OnDemandTargetCapacity (integer) --
The number of On-Demand units to request. If you specify a target capacity for Spot units, you cannot specify a target capacity for On-Demand units.
SpotTargetCapacity (integer) --
The maximum number of Spot units to launch. If you specify a target capacity for On-Demand units, you cannot specify a target capacity for Spot units.
DefaultTargetCapacityType (string) --
The default TotalTargetCapacity , which is either Spot or On-Demand .
TerminateInstancesWithExpiration (boolean) --
Indicates whether running instances should be terminated when the EC2 Fleet expires.
Type (string) --
The type of request. Indicates whether the EC2 Fleet only requests the target capacity, or also attempts to maintain it. If you request a certain target capacity, EC2 Fleet only places the required requests; it does not attempt to replenish instances if capacity is diminished, and does not submit requests in alternative capacity pools if capacity is unavailable. To maintain a certain target capacity, EC2 Fleet places the required requests to meet this target capacity. It also automatically replenishes any interrupted Spot Instances. Default: maintain .
ValidFrom (datetime) --
The start date and time of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). The default is to start fulfilling the request immediately.
ValidUntil (datetime) --
The end date and time of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). At this point, no new instance requests are placed or able to fulfill the request. The default end date is 7 days from the current date.
ReplaceUnhealthyInstances (boolean) --
Indicates whether EC2 Fleet should replace unhealthy instances.
SpotOptions (dict) --
The configuration of Spot Instances in an EC2 Fleet.
AllocationStrategy (string) --
Indicates how to allocate the target capacity across the Spot pools specified by the Spot Fleet request. The default is lowest-price .
InstanceInterruptionBehavior (string) --
The behavior when a Spot Instance is interrupted. The default is terminate .
InstancePoolsToUseCount (integer) --
The number of Spot pools across which to allocate your target Spot capacity. Valid only when AllocationStrategy is set to lowestPrice . EC2 Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify.
SingleInstanceType (boolean) --
Indicates that the fleet uses a single instance type to launch all Spot Instances in the fleet.
SingleAvailabilityZone (boolean) --
Indicates that the fleet launches all Spot Instances into a single Availability Zone.
MinTargetCapacity (integer) --
The minimum target capacity for Spot Instances in the fleet. If the minimum target capacity is not reached, the fleet launches no instances.
MaxTotalPrice (string) --
The maximum amount per hour for Spot Instances that you're willing to pay.
OnDemandOptions (dict) --
The allocation strategy of On-Demand Instances in an EC2 Fleet.
AllocationStrategy (string) --
The order of the launch template overrides to use in fulfilling On-Demand capacity. If you specify lowest-price , EC2 Fleet uses price to determine the order, launching the lowest price first. If you specify prioritized , EC2 Fleet uses the priority that you assigned to each launch template override, launching the highest priority first. If you do not specify a value, EC2 Fleet defaults to lowest-price .
SingleInstanceType (boolean) --
Indicates that the fleet uses a single instance type to launch all On-Demand Instances in the fleet.
SingleAvailabilityZone (boolean) --
Indicates that the fleet launches all On-Demand Instances into a single Availability Zone.
MinTargetCapacity (integer) --
The minimum target capacity for On-Demand Instances in the fleet. If the minimum target capacity is not reached, the fleet launches no instances.
MaxTotalPrice (string) --
The maximum amount per hour for On-Demand Instances that you're willing to pay.
Tags (list) --
The tags for an EC2 Fleet resource.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Errors (list) --
Information about the instances that could not be launched by the fleet. Valid only when Type is set to instant .
(dict) --
Describes the instances that could not be launched by the fleet.
LaunchTemplateAndOverrides (dict) --
The launch templates and overrides that were used for launching the instances. Any parameters that you specify in the Overrides override the same parameters in the launch template.
LaunchTemplateSpecification (dict) --
The launch template.
LaunchTemplateId (string) --
The ID of the launch template. You must specify either a template ID or a template name.
LaunchTemplateName (string) --
The name of the launch template. You must specify either a template name or a template ID.
Version (string) --
The version number of the launch template. You must specify a version number.
Overrides (dict) --
Any parameters that you specify override the same parameters in the launch template.
InstanceType (string) --
The instance type.
MaxPrice (string) --
The maximum price per unit hour that you are willing to pay for a Spot Instance.
SubnetId (string) --
The ID of the subnet in which to launch the instances.
AvailabilityZone (string) --
The Availability Zone in which to launch the instances.
WeightedCapacity (float) --
The number of units provided by the specified instance type.
Priority (float) --
The priority for the launch template override. If AllocationStrategy is set to prioritized , EC2 Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity. The highest priority is launched first. Valid values are whole numbers starting at 0 . The lower the number, the higher the priority. If no number is set, the override has the lowest priority.
Placement (dict) --
The location where the instance launched, if applicable.
GroupName (string) --
The name of the placement group the instance is in.
Lifecycle (string) --
Indicates if the instance that could not be launched was a Spot Instance or On-Demand Instance.
ErrorCode (string) --
The error code that indicates why the instance could not be launched. For more information about error codes, see Error Codes .
ErrorMessage (string) --
The error message that describes why the instance could not be launched. For more information about error messages, see ee Error Codes .
Instances (list) --
Information about the instances that were launched by the fleet. Valid only when Type is set to instant .
(dict) --
Describes the instances that were launched by the fleet.
LaunchTemplateAndOverrides (dict) --
The launch templates and overrides that were used for launching the instances. Any parameters that you specify in the Overrides override the same parameters in the launch template.
LaunchTemplateSpecification (dict) --
The launch template.
LaunchTemplateId (string) --
The ID of the launch template. You must specify either a template ID or a template name.
LaunchTemplateName (string) --
The name of the launch template. You must specify either a template name or a template ID.
Version (string) --
The version number of the launch template. You must specify a version number.
Overrides (dict) --
Any parameters that you specify override the same parameters in the launch template.
InstanceType (string) --
The instance type.
MaxPrice (string) --
The maximum price per unit hour that you are willing to pay for a Spot Instance.
SubnetId (string) --
The ID of the subnet in which to launch the instances.
AvailabilityZone (string) --
The Availability Zone in which to launch the instances.
WeightedCapacity (float) --
The number of units provided by the specified instance type.
Priority (float) --
The priority for the launch template override. If AllocationStrategy is set to prioritized , EC2 Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity. The highest priority is launched first. Valid values are whole numbers starting at 0 . The lower the number, the higher the priority. If no number is set, the override has the lowest priority.
Placement (dict) --
The location where the instance launched, if applicable.
GroupName (string) --
The name of the placement group the instance is in.
Lifecycle (string) --
Indicates if the instance that was launched is a Spot Instance or On-Demand Instance.
InstanceIds (list) --
The IDs of the instances.
InstanceType (string) --
The instance type.
Platform (string) --
The value is Windows for Windows instances; otherwise blank.
Describes one or more flow logs. To view the information in your flow logs (the log streams for the network interfaces), you must use the CloudWatch Logs console or the CloudWatch Logs API.
See also: AWS API Documentation
Request Syntax
response = client.describe_flow_logs(
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
FlowLogIds=[
'string',
],
MaxResults=123,
NextToken='string'
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more flow log IDs.
Constraint: Maximum of 1000 flow log IDs.
dict
Response Syntax
{
'FlowLogs': [
{
'CreationTime': datetime(2015, 1, 1),
'DeliverLogsErrorMessage': 'string',
'DeliverLogsPermissionArn': 'string',
'DeliverLogsStatus': 'string',
'FlowLogId': 'string',
'FlowLogStatus': 'string',
'LogGroupName': 'string',
'ResourceId': 'string',
'TrafficType': 'ACCEPT'|'REJECT'|'ALL',
'LogDestinationType': 'cloud-watch-logs'|'s3',
'LogDestination': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
FlowLogs (list) --
Information about the flow logs.
(dict) --
Describes a flow log.
CreationTime (datetime) --
The date and time the flow log was created.
DeliverLogsErrorMessage (string) --
Information about the error that occurred. Rate limited indicates that CloudWatch Logs throttling has been applied for one or more network interfaces, or that you've reached the limit on the number of log groups that you can create. Access error indicates that the IAM role associated with the flow log does not have sufficient permissions to publish to CloudWatch Logs. Unknown error indicates an internal error.
DeliverLogsPermissionArn (string) --
The ARN of the IAM role that posts logs to CloudWatch Logs.
DeliverLogsStatus (string) --
The status of the logs delivery (SUCCESS | FAILED ).
FlowLogId (string) --
The flow log ID.
FlowLogStatus (string) --
The status of the flow log (ACTIVE ).
LogGroupName (string) --
The name of the flow log group.
ResourceId (string) --
The ID of the resource on which the flow log was created.
TrafficType (string) --
The type of traffic captured for the flow log.
LogDestinationType (string) --
Specifies the type of destination to which the flow log data is published. Flow log data can be published to CloudWatch Logs or Amazon S3.
LogDestination (string) --
Specifies the destination to which the flow log data is published. Flow log data can be published to an CloudWatch Logs log group or an Amazon S3 bucket. If the flow log publishes to CloudWatch Logs, this element indicates the Amazon Resource Name (ARN) of the CloudWatch Logs log group to which the data is published. If the flow log publishes to Amazon S3, this element indicates the ARN of the Amazon S3 bucket to which the data is published.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes the specified attribute of the specified Amazon FPGA Image (AFI).
See also: AWS API Documentation
Request Syntax
response = client.describe_fpga_image_attribute(
DryRun=True|False,
FpgaImageId='string',
Attribute='description'|'name'|'loadPermission'|'productCodes'
)
[REQUIRED]
The ID of the AFI.
[REQUIRED]
The AFI attribute.
dict
Response Syntax
{
'FpgaImageAttribute': {
'FpgaImageId': 'string',
'Name': 'string',
'Description': 'string',
'LoadPermissions': [
{
'UserId': 'string',
'Group': 'all'
},
],
'ProductCodes': [
{
'ProductCodeId': 'string',
'ProductCodeType': 'devpay'|'marketplace'
},
]
}
}
Response Structure
(dict) --
FpgaImageAttribute (dict) --
Information about the attribute.
FpgaImageId (string) --
The ID of the AFI.
Name (string) --
The name of the AFI.
Description (string) --
The description of the AFI.
LoadPermissions (list) --
The load permissions.
(dict) --
Describes a load permission.
UserId (string) --
The AWS account ID.
Group (string) --
The name of the group.
ProductCodes (list) --
The product codes.
(dict) --
Describes a product code.
ProductCodeId (string) --
The product code.
ProductCodeType (string) --
The type of product code.
Describes the Amazon FPGA Images (AFIs) available to you. These include public AFIs, private AFIs that you own, and AFIs owned by other AWS accounts for which you have load permissions.
See also: AWS API Documentation
Request Syntax
response = client.describe_fpga_images(
DryRun=True|False,
FpgaImageIds=[
'string',
],
Owners=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
NextToken='string',
MaxResults=123
)
The AFI IDs.
Filters the AFI by owner. Specify an AWS account ID, self (owner is the sender of the request), or an AWS owner alias (valid values are amazon | aws-marketplace ).
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'FpgaImages': [
{
'FpgaImageId': 'string',
'FpgaImageGlobalId': 'string',
'Name': 'string',
'Description': 'string',
'ShellVersion': 'string',
'PciId': {
'DeviceId': 'string',
'VendorId': 'string',
'SubsystemId': 'string',
'SubsystemVendorId': 'string'
},
'State': {
'Code': 'pending'|'failed'|'available'|'unavailable',
'Message': 'string'
},
'CreateTime': datetime(2015, 1, 1),
'UpdateTime': datetime(2015, 1, 1),
'OwnerId': 'string',
'OwnerAlias': 'string',
'ProductCodes': [
{
'ProductCodeId': 'string',
'ProductCodeType': 'devpay'|'marketplace'
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'Public': True|False,
'DataRetentionSupport': True|False
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
FpgaImages (list) --
Information about the FPGA images.
(dict) --
Describes an Amazon FPGA image (AFI).
FpgaImageId (string) --
The FPGA image identifier (AFI ID).
FpgaImageGlobalId (string) --
The global FPGA image identifier (AGFI ID).
Name (string) --
The name of the AFI.
Description (string) --
The description of the AFI.
ShellVersion (string) --
The version of the AWS Shell that was used to create the bitstream.
PciId (dict) --
Information about the PCI bus.
DeviceId (string) --
The ID of the device.
VendorId (string) --
The ID of the vendor.
SubsystemId (string) --
The ID of the subsystem.
SubsystemVendorId (string) --
The ID of the vendor for the subsystem.
State (dict) --
Information about the state of the AFI.
Code (string) --
The state. The following are the possible values:
Message (string) --
If the state is failed , this is the error message.
CreateTime (datetime) --
The date and time the AFI was created.
UpdateTime (datetime) --
The time of the most recent update to the AFI.
OwnerId (string) --
The AWS account ID of the AFI owner.
OwnerAlias (string) --
The alias of the AFI owner. Possible values include self , amazon , and aws-marketplace .
ProductCodes (list) --
The product codes for the AFI.
(dict) --
Describes a product code.
ProductCodeId (string) --
The product code.
ProductCodeType (string) --
The type of product code.
Tags (list) --
Any tags assigned to the AFI.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Public (boolean) --
Indicates whether the AFI is public.
DataRetentionSupport (boolean) --
Indicates whether data retention support is enabled for the AFI.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes the Dedicated Host reservations that are available to purchase.
The results describe all the Dedicated Host reservation offerings, including offerings that may not match the instance family and Region of your Dedicated Hosts. When purchasing an offering, ensure that the instance family and Region of the offering matches that of the Dedicated Hosts with which it is to be associated. For more information about supported instance types, see Dedicated Hosts Overview in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_host_reservation_offerings(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxDuration=123,
MaxResults=123,
MinDuration=123,
NextToken='string',
OfferingId='string'
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'NextToken': 'string',
'OfferingSet': [
{
'CurrencyCode': 'USD',
'Duration': 123,
'HourlyPrice': 'string',
'InstanceFamily': 'string',
'OfferingId': 'string',
'PaymentOption': 'AllUpfront'|'PartialUpfront'|'NoUpfront',
'UpfrontPrice': 'string'
},
]
}
Response Structure
(dict) --
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
OfferingSet (list) --
Information about the offerings.
(dict) --
Details about the Dedicated Host Reservation offering.
CurrencyCode (string) --
The currency of the offering.
Duration (integer) --
The duration of the offering (in seconds).
HourlyPrice (string) --
The hourly price of the offering.
InstanceFamily (string) --
The instance family of the offering.
OfferingId (string) --
The ID of the offering.
PaymentOption (string) --
The available payment option.
UpfrontPrice (string) --
The upfront price of the offering. Does not apply to No Upfront offerings.
Describes reservations that are associated with Dedicated Hosts in your account.
See also: AWS API Documentation
Request Syntax
response = client.describe_host_reservations(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
HostReservationIdSet=[
'string',
],
MaxResults=123,
NextToken='string'
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The host reservation IDs.
dict
Response Syntax
{
'HostReservationSet': [
{
'Count': 123,
'CurrencyCode': 'USD',
'Duration': 123,
'End': datetime(2015, 1, 1),
'HostIdSet': [
'string',
],
'HostReservationId': 'string',
'HourlyPrice': 'string',
'InstanceFamily': 'string',
'OfferingId': 'string',
'PaymentOption': 'AllUpfront'|'PartialUpfront'|'NoUpfront',
'Start': datetime(2015, 1, 1),
'State': 'payment-pending'|'payment-failed'|'active'|'retired',
'UpfrontPrice': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
HostReservationSet (list) --
Details about the reservation's configuration.
(dict) --
Details about the Dedicated Host Reservation and associated Dedicated Hosts.
Count (integer) --
The number of Dedicated Hosts the reservation is associated with.
CurrencyCode (string) --
The currency in which the upfrontPrice and hourlyPrice amounts are specified. At this time, the only supported currency is USD .
Duration (integer) --
The length of the reservation's term, specified in seconds. Can be 31536000 (1 year) | 94608000 (3 years) .
End (datetime) --
The date and time that the reservation ends.
HostIdSet (list) --
The IDs of the Dedicated Hosts associated with the reservation.
HostReservationId (string) --
The ID of the reservation that specifies the associated Dedicated Hosts.
HourlyPrice (string) --
The hourly price of the reservation.
InstanceFamily (string) --
The instance family of the Dedicated Host Reservation. The instance family on the Dedicated Host must be the same in order for it to benefit from the reservation.
OfferingId (string) --
The ID of the reservation. This remains the same regardless of which Dedicated Hosts are associated with it.
PaymentOption (string) --
The payment option selected for this reservation.
Start (datetime) --
The date and time that the reservation started.
State (string) --
The state of the reservation.
UpfrontPrice (string) --
The upfront price of the reservation.
Tags (list) --
Any tags assigned to the Dedicated Host Reservation.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes the specified Dedicated Hosts or all your Dedicated Hosts.
The results describe only the Dedicated Hosts in the Region you're currently using. All listed instances consume capacity on your Dedicated Host. Dedicated Hosts that have recently been released are listed with the state released .
See also: AWS API Documentation
Request Syntax
response = client.describe_hosts(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
HostIds=[
'string',
],
MaxResults=123,
NextToken='string'
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The IDs of the Dedicated Hosts. The IDs are used for targeted instance launches.
The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned nextToken value. This value can be between 5 and 500. If maxResults is given a larger value than 500, you receive an error.
You cannot specify this parameter and the host IDs parameter in the same request.
dict
Response Syntax
{
'Hosts': [
{
'AutoPlacement': 'on'|'off',
'AvailabilityZone': 'string',
'AvailableCapacity': {
'AvailableInstanceCapacity': [
{
'AvailableCapacity': 123,
'InstanceType': 'string',
'TotalCapacity': 123
},
],
'AvailableVCpus': 123
},
'ClientToken': 'string',
'HostId': 'string',
'HostProperties': {
'Cores': 123,
'InstanceType': 'string',
'Sockets': 123,
'TotalVCpus': 123
},
'HostReservationId': 'string',
'Instances': [
{
'InstanceId': 'string',
'InstanceType': 'string'
},
],
'State': 'available'|'under-assessment'|'permanent-failure'|'released'|'released-permanent-failure'|'pending',
'AllocationTime': datetime(2015, 1, 1),
'ReleaseTime': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'HostRecovery': 'on'|'off'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Hosts (list) --
Information about the Dedicated Hosts.
(dict) --
Describes the properties of the Dedicated Host.
AutoPlacement (string) --
Whether auto-placement is on or off.
AvailabilityZone (string) --
The Availability Zone of the Dedicated Host.
AvailableCapacity (dict) --
The number of new instances that can be launched onto the Dedicated Host.
AvailableInstanceCapacity (list) --
The total number of instances supported by the Dedicated Host.
(dict) --
Information about the instance type that the Dedicated Host supports.
AvailableCapacity (integer) --
The number of instances that can still be launched onto the Dedicated Host.
InstanceType (string) --
The instance type size supported by the Dedicated Host.
TotalCapacity (integer) --
The total number of instances that can be launched onto the Dedicated Host.
AvailableVCpus (integer) --
The number of vCPUs available on the Dedicated Host.
ClientToken (string) --
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency .
HostId (string) --
The ID of the Dedicated Host.
HostProperties (dict) --
The hardware specifications of the Dedicated Host.
Cores (integer) --
The number of cores on the Dedicated Host.
InstanceType (string) --
The instance type size that the Dedicated Host supports (for example, m3.medium ).
Sockets (integer) --
The number of sockets on the Dedicated Host.
TotalVCpus (integer) --
The number of vCPUs on the Dedicated Host.
HostReservationId (string) --
The reservation ID of the Dedicated Host. This returns a null response if the Dedicated Host doesn't have an associated reservation.
Instances (list) --
The IDs and instance type that are currently running on the Dedicated Host.
(dict) --
Describes an instance running on a Dedicated Host.
InstanceId (string) --
the IDs of instances that are running on the Dedicated Host.
InstanceType (string) --
The instance type size (for example, m3.medium ) of the running instance.
State (string) --
The Dedicated Host's state.
AllocationTime (datetime) --
The time that the Dedicated Host was allocated.
ReleaseTime (datetime) --
The time that the Dedicated Host was released.
Tags (list) --
Any tags assigned to the Dedicated Host.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
HostRecovery (string) --
Indicates whether host recovery is enabled or disabled for the Dedicated Host.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes your IAM instance profile associations.
See also: AWS API Documentation
Request Syntax
response = client.describe_iam_instance_profile_associations(
AssociationIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string'
)
The IAM instance profile associations.
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'IamInstanceProfileAssociations': [
{
'AssociationId': 'string',
'InstanceId': 'string',
'IamInstanceProfile': {
'Arn': 'string',
'Id': 'string'
},
'State': 'associating'|'associated'|'disassociating'|'disassociated',
'Timestamp': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
IamInstanceProfileAssociations (list) --
Information about the IAM instance profile associations.
(dict) --
Describes an association between an IAM instance profile and an instance.
AssociationId (string) --
The ID of the association.
InstanceId (string) --
The ID of the instance.
IamInstanceProfile (dict) --
The IAM instance profile.
Arn (string) --
The Amazon Resource Name (ARN) of the instance profile.
Id (string) --
The ID of the instance profile.
State (string) --
The state of the association.
Timestamp (datetime) --
The time the IAM instance profile was associated with the instance.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes the ID format settings for your resources on a per-Region basis, for example, to view which resource types are enabled for longer IDs. This request only returns information about resource types whose ID formats can be modified; it does not return information about other resource types.
The following resource types support longer IDs: bundle | conversion-task | customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association | export-task | flow-log | image | import-task | instance | internet-gateway | network-acl | network-acl-association | network-interface | network-interface-attachment | prefix-list | reservation | route-table | route-table-association | security-group | snapshot | subnet | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway .
These settings apply to the IAM user who makes the request; they do not apply to the entire AWS account. By default, an IAM user defaults to the same settings as the root user, unless they explicitly override the settings by running the ModifyIdFormat command. Resources created with longer IDs are visible to all IAM users, regardless of these settings and provided that they have permission to use the relevant Describe command for the resource type.
See also: AWS API Documentation
Request Syntax
response = client.describe_id_format(
Resource='string'
)
{
'Statuses': [
{
'Deadline': datetime(2015, 1, 1),
'Resource': 'string',
'UseLongIds': True|False
},
]
}
Response Structure
Information about the ID format for the resource.
Describes the ID format for a resource.
The date in UTC at which you are permanently switched over to using longer IDs. If a deadline is not yet available for this resource type, this field is not returned.
The type of resource.
Indicates whether longer IDs (17-character IDs) are enabled for the resource.
Describes the ID format settings for resources for the specified IAM user, IAM role, or root user. For example, you can view the resource types that are enabled for longer IDs. This request only returns information about resource types whose ID formats can be modified; it does not return information about other resource types. For more information, see Resource IDs in the Amazon Elastic Compute Cloud User Guide .
The following resource types support longer IDs: bundle | conversion-task | customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association | export-task | flow-log | image | import-task | instance | internet-gateway | network-acl | network-acl-association | network-interface | network-interface-attachment | prefix-list | reservation | route-table | route-table-association | security-group | snapshot | subnet | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway .
These settings apply to the principal specified in the request. They do not apply to the principal that makes the request.
See also: AWS API Documentation
Request Syntax
response = client.describe_identity_id_format(
PrincipalArn='string',
Resource='string'
)
[REQUIRED]
The ARN of the principal, which can be an IAM role, IAM user, or the root user.
dict
Response Syntax
{
'Statuses': [
{
'Deadline': datetime(2015, 1, 1),
'Resource': 'string',
'UseLongIds': True|False
},
]
}
Response Structure
(dict) --
Statuses (list) --
Information about the ID format for the resources.
(dict) --
Describes the ID format for a resource.
Deadline (datetime) --
The date in UTC at which you are permanently switched over to using longer IDs. If a deadline is not yet available for this resource type, this field is not returned.
Resource (string) --
The type of resource.
UseLongIds (boolean) --
Indicates whether longer IDs (17-character IDs) are enabled for the resource.
Describes the specified attribute of the specified AMI. You can specify only one attribute at a time.
See also: AWS API Documentation
Request Syntax
response = client.describe_image_attribute(
Attribute='description'|'kernel'|'ramdisk'|'launchPermission'|'productCodes'|'blockDeviceMapping'|'sriovNetSupport',
ImageId='string',
DryRun=True|False
)
[REQUIRED]
The AMI attribute.
Note : Depending on your account privileges, the blockDeviceMapping attribute may return a Client.AuthFailure error. If this happens, use DescribeImages to get information about the block device mapping for the AMI.
[REQUIRED]
The ID of the AMI.
dict
Response Syntax
{
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'Iops': 123,
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Encrypted': True|False,
'KmsKeyId': 'string'
},
'NoDevice': 'string'
},
],
'ImageId': 'string',
'LaunchPermissions': [
{
'Group': 'all',
'UserId': 'string'
},
],
'ProductCodes': [
{
'ProductCodeId': 'string',
'ProductCodeType': 'devpay'|'marketplace'
},
],
'Description': {
'Value': 'string'
},
'KernelId': {
'Value': 'string'
},
'RamdiskId': {
'Value': 'string'
},
'SriovNetSupport': {
'Value': 'string'
}
}
Response Structure
(dict) --
Describes an image attribute.
BlockDeviceMappings (list) --
The block device mapping entries.
(dict) --
Describes a block device mapping.
DeviceName (string) --
The device name (for example, /dev/sdh or xvdh ).
VirtualName (string) --
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Ebs (dict) --
Parameters used to automatically set up EBS volumes when the instance is launched.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports. For io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
SnapshotId (string) --
The ID of the snapshot.
VolumeSize (integer) --
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Constraints: 1-16384 for General Purpose SSD (gp2 ), 4-16384 for Provisioned IOPS SSD (io1 ), 500-16384 for Throughput Optimized HDD (st1 ), 500-16384 for Cold HDD (sc1 ), and 1-1024 for Magnetic (standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
VolumeType (string) --
The volume type. If you set the type to io1 , you must also set the Iops property.
Default: standard
Encrypted (boolean) --
Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
In no case can you remove encryption from an encrypted volume.
Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
KmsKeyId (string) --
Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is encrypted.
This parameter is only supported on BlockDeviceMapping objects called by RunInstances , RequestSpotFleet , and RequestSpotInstances .
NoDevice (string) --
Suppresses the specified device included in the block device mapping of the AMI.
ImageId (string) --
The ID of the AMI.
LaunchPermissions (list) --
The launch permissions.
(dict) --
Describes a launch permission.
Group (string) --
The name of the group.
UserId (string) --
The AWS account ID.
ProductCodes (list) --
The product codes.
(dict) --
Describes a product code.
ProductCodeId (string) --
The product code.
ProductCodeType (string) --
The type of product code.
Description (dict) --
A description for the AMI.
Value (string) --
The attribute value. The value is case-sensitive.
KernelId (dict) --
The kernel ID.
Value (string) --
The attribute value. The value is case-sensitive.
RamdiskId (dict) --
The RAM disk ID.
Value (string) --
The attribute value. The value is case-sensitive.
SriovNetSupport (dict) --
Indicates whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
Value (string) --
The attribute value. The value is case-sensitive.
Describes the specified images (AMIs, AKIs, and ARIs) available to you or all of the images available to you.
The images available to you include public images, private images that you own, and private images owned by other AWS accounts for which you have explicit launch permissions.
Recently deregistered images appear in the returned results for a short interval and then return empty results. After all instances that reference a deregistered AMI are terminated, specifying the ID of the image results in an error indicating that the AMI ID cannot be found.
See also: AWS API Documentation
Request Syntax
response = client.describe_images(
ExecutableUsers=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
ImageIds=[
'string',
],
Owners=[
'string',
],
DryRun=True|False
)
Scopes the images by users with explicit launch permissions. Specify an AWS account ID, self (the sender of the request), or all (public AMIs).
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The image IDs.
Default: Describes all images available to you.
Filters the images by the owner. Specify an AWS account ID, self (owner is the sender of the request), or an AWS owner alias (valid values are amazon | aws-marketplace | microsoft ). Omitting this option returns all images for which you have launch permissions, regardless of ownership.
dict
Response Syntax
{
'Images': [
{
'Architecture': 'i386'|'x86_64'|'arm64',
'CreationDate': 'string',
'ImageId': 'string',
'ImageLocation': 'string',
'ImageType': 'machine'|'kernel'|'ramdisk',
'Public': True|False,
'KernelId': 'string',
'OwnerId': 'string',
'Platform': 'Windows',
'ProductCodes': [
{
'ProductCodeId': 'string',
'ProductCodeType': 'devpay'|'marketplace'
},
],
'RamdiskId': 'string',
'State': 'pending'|'available'|'invalid'|'deregistered'|'transient'|'failed'|'error',
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'Iops': 123,
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Encrypted': True|False,
'KmsKeyId': 'string'
},
'NoDevice': 'string'
},
],
'Description': 'string',
'EnaSupport': True|False,
'Hypervisor': 'ovm'|'xen',
'ImageOwnerAlias': 'string',
'Name': 'string',
'RootDeviceName': 'string',
'RootDeviceType': 'ebs'|'instance-store',
'SriovNetSupport': 'string',
'StateReason': {
'Code': 'string',
'Message': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VirtualizationType': 'hvm'|'paravirtual'
},
]
}
Response Structure
(dict) --
Images (list) --
Information about the images.
(dict) --
Describes an image.
Architecture (string) --
The architecture of the image.
CreationDate (string) --
The date and time the image was created.
ImageId (string) --
The ID of the AMI.
ImageLocation (string) --
The location of the AMI.
ImageType (string) --
The type of image.
Public (boolean) --
Indicates whether the image has public launch permissions. The value is true if this image has public launch permissions or false if it has only implicit and explicit launch permissions.
KernelId (string) --
The kernel associated with the image, if any. Only applicable for machine images.
OwnerId (string) --
The AWS account ID of the image owner.
Platform (string) --
This value is set for Windows AMIs; otherwise, it is blank.
ProductCodes (list) --
Any product codes associated with the AMI.
(dict) --
Describes a product code.
ProductCodeId (string) --
The product code.
ProductCodeType (string) --
The type of product code.
RamdiskId (string) --
The RAM disk associated with the image, if any. Only applicable for machine images.
State (string) --
The current state of the AMI. If the state is available , the image is successfully registered and can be used to launch an instance.
BlockDeviceMappings (list) --
Any block device mapping entries.
(dict) --
Describes a block device mapping.
DeviceName (string) --
The device name (for example, /dev/sdh or xvdh ).
VirtualName (string) --
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Ebs (dict) --
Parameters used to automatically set up EBS volumes when the instance is launched.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports. For io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
SnapshotId (string) --
The ID of the snapshot.
VolumeSize (integer) --
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Constraints: 1-16384 for General Purpose SSD (gp2 ), 4-16384 for Provisioned IOPS SSD (io1 ), 500-16384 for Throughput Optimized HDD (st1 ), 500-16384 for Cold HDD (sc1 ), and 1-1024 for Magnetic (standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
VolumeType (string) --
The volume type. If you set the type to io1 , you must also set the Iops property.
Default: standard
Encrypted (boolean) --
Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
In no case can you remove encryption from an encrypted volume.
Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
KmsKeyId (string) --
Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is encrypted.
This parameter is only supported on BlockDeviceMapping objects called by RunInstances , RequestSpotFleet , and RequestSpotInstances .
NoDevice (string) --
Suppresses the specified device included in the block device mapping of the AMI.
Description (string) --
The description of the AMI that was provided during image creation.
EnaSupport (boolean) --
Specifies whether enhanced networking with ENA is enabled.
Hypervisor (string) --
The hypervisor type of the image.
ImageOwnerAlias (string) --
The AWS account alias (for example, amazon , self ) or the AWS account ID of the AMI owner.
Name (string) --
The name of the AMI that was provided during image creation.
RootDeviceName (string) --
The device name of the root device volume (for example, /dev/sda1 ).
RootDeviceType (string) --
The type of root device used by the AMI. The AMI can use an EBS volume or an instance store volume.
SriovNetSupport (string) --
Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
StateReason (dict) --
The reason for the state change.
Code (string) --
The reason code for the state change.
Message (string) --
The message for the state change.
Tags (list) --
Any tags assigned to the image.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VirtualizationType (string) --
The type of virtualization of the AMI.
Displays details about an import virtual machine or import snapshot tasks that are already created.
See also: AWS API Documentation
Request Syntax
response = client.describe_import_image_tasks(
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
ImportTaskIds=[
'string',
],
MaxResults=123,
NextToken='string'
)
Filter tasks using the task-state filter and one of the following values: active, completed, deleting, deleted.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A list of import image task IDs.
dict
Response Syntax
{
'ImportImageTasks': [
{
'Architecture': 'string',
'Description': 'string',
'Encrypted': True|False,
'Hypervisor': 'string',
'ImageId': 'string',
'ImportTaskId': 'string',
'KmsKeyId': 'string',
'LicenseType': 'string',
'Platform': 'string',
'Progress': 'string',
'SnapshotDetails': [
{
'Description': 'string',
'DeviceName': 'string',
'DiskImageSize': 123.0,
'Format': 'string',
'Progress': 'string',
'SnapshotId': 'string',
'Status': 'string',
'StatusMessage': 'string',
'Url': 'string',
'UserBucket': {
'S3Bucket': 'string',
'S3Key': 'string'
}
},
],
'Status': 'string',
'StatusMessage': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
ImportImageTasks (list) --
A list of zero or more import image tasks that are currently active or were completed or canceled in the previous 7 days.
(dict) --
Describes an import image task.
Architecture (string) --
The architecture of the virtual machine.
Valid values: i386 | x86_64 | arm64
Description (string) --
A description of the import task.
Encrypted (boolean) --
Indicates whether the image is encrypted.
Hypervisor (string) --
The target hypervisor for the import task.
Valid values: xen
ImageId (string) --
The ID of the Amazon Machine Image (AMI) of the imported virtual machine.
ImportTaskId (string) --
The ID of the import image task.
KmsKeyId (string) --
The identifier for the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to create the encrypted image.
LicenseType (string) --
The license type of the virtual machine.
Platform (string) --
The description string for the import image task.
Progress (string) --
The percentage of progress of the import image task.
SnapshotDetails (list) --
Information about the snapshots.
(dict) --
Describes the snapshot created from the imported disk.
Description (string) --
A description for the snapshot.
DeviceName (string) --
The block device mapping for the snapshot.
DiskImageSize (float) --
The size of the disk in the snapshot, in GiB.
Format (string) --
The format of the disk image from which the snapshot is created.
Progress (string) --
The percentage of progress for the task.
SnapshotId (string) --
The snapshot ID of the disk being imported.
Status (string) --
A brief status of the snapshot creation.
StatusMessage (string) --
A detailed status message for the snapshot creation.
Url (string) --
The URL used to access the disk image.
UserBucket (dict) --
The S3 bucket for the disk image.
S3Bucket (string) --
The S3 bucket from which the disk image was created.
S3Key (string) --
The file name of the disk image.
Status (string) --
A brief status for the import image task.
StatusMessage (string) --
A descriptive status message for the import image task.
NextToken (string) --
The token to use to get the next page of results. This value is null when there are no more results to return.
Describes your import snapshot tasks.
See also: AWS API Documentation
Request Syntax
response = client.describe_import_snapshot_tasks(
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
ImportTaskIds=[
'string',
],
MaxResults=123,
NextToken='string'
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A list of import snapshot task IDs.
dict
Response Syntax
{
'ImportSnapshotTasks': [
{
'Description': 'string',
'ImportTaskId': 'string',
'SnapshotTaskDetail': {
'Description': 'string',
'DiskImageSize': 123.0,
'Encrypted': True|False,
'Format': 'string',
'KmsKeyId': 'string',
'Progress': 'string',
'SnapshotId': 'string',
'Status': 'string',
'StatusMessage': 'string',
'Url': 'string',
'UserBucket': {
'S3Bucket': 'string',
'S3Key': 'string'
}
}
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
ImportSnapshotTasks (list) --
A list of zero or more import snapshot tasks that are currently active or were completed or canceled in the previous 7 days.
(dict) --
Describes an import snapshot task.
Description (string) --
A description of the import snapshot task.
ImportTaskId (string) --
The ID of the import snapshot task.
SnapshotTaskDetail (dict) --
Describes an import snapshot task.
Description (string) --
The description of the snapshot.
DiskImageSize (float) --
The size of the disk in the snapshot, in GiB.
Encrypted (boolean) --
Indicates whether the snapshot is encrypted.
Format (string) --
The format of the disk image from which the snapshot is created.
KmsKeyId (string) --
The identifier for the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to create the encrypted snapshot.
Progress (string) --
The percentage of completion for the import snapshot task.
SnapshotId (string) --
The snapshot ID of the disk being imported.
Status (string) --
A brief status for the import snapshot task.
StatusMessage (string) --
A detailed status message for the import snapshot task.
Url (string) --
The URL of the disk image from which the snapshot is created.
UserBucket (dict) --
The S3 bucket for the disk image.
S3Bucket (string) --
The S3 bucket from which the disk image was created.
S3Key (string) --
The file name of the disk image.
NextToken (string) --
The token to use to get the next page of results. This value is null when there are no more results to return.
Describes the specified attribute of the specified instance. You can specify only one attribute at a time. Valid attribute values are: instanceType | kernel | ramdisk | userData | disableApiTermination | instanceInitiatedShutdownBehavior | rootDeviceName | blockDeviceMapping | productCodes | sourceDestCheck | groupSet | ebsOptimized | sriovNetSupport
See also: AWS API Documentation
Request Syntax
response = client.describe_instance_attribute(
Attribute='instanceType'|'kernel'|'ramdisk'|'userData'|'disableApiTermination'|'instanceInitiatedShutdownBehavior'|'rootDeviceName'|'blockDeviceMapping'|'productCodes'|'sourceDestCheck'|'groupSet'|'ebsOptimized'|'sriovNetSupport'|'enaSupport',
DryRun=True|False,
InstanceId='string'
)
[REQUIRED]
The instance attribute.
Note: The enaSupport attribute is not supported at this time.
[REQUIRED]
The ID of the instance.
dict
Response Syntax
{
'Groups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'Ebs': {
'AttachTime': datetime(2015, 1, 1),
'DeleteOnTermination': True|False,
'Status': 'attaching'|'attached'|'detaching'|'detached',
'VolumeId': 'string'
}
},
],
'DisableApiTermination': {
'Value': True|False
},
'EnaSupport': {
'Value': True|False
},
'EbsOptimized': {
'Value': True|False
},
'InstanceId': 'string',
'InstanceInitiatedShutdownBehavior': {
'Value': 'string'
},
'InstanceType': {
'Value': 'string'
},
'KernelId': {
'Value': 'string'
},
'ProductCodes': [
{
'ProductCodeId': 'string',
'ProductCodeType': 'devpay'|'marketplace'
},
],
'RamdiskId': {
'Value': 'string'
},
'RootDeviceName': {
'Value': 'string'
},
'SourceDestCheck': {
'Value': True|False
},
'SriovNetSupport': {
'Value': 'string'
},
'UserData': {
'Value': 'string'
}
}
Response Structure
(dict) --
Describes an instance attribute.
Groups (list) --
The security groups associated with the instance.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
BlockDeviceMappings (list) --
The block device mapping of the instance.
(dict) --
Describes a block device mapping.
DeviceName (string) --
The device name (for example, /dev/sdh or xvdh ).
Ebs (dict) --
Parameters used to automatically set up EBS volumes when the instance is launched.
AttachTime (datetime) --
The time stamp when the attachment initiated.
DeleteOnTermination (boolean) --
Indicates whether the volume is deleted on instance termination.
Status (string) --
The attachment state.
VolumeId (string) --
The ID of the EBS volume.
DisableApiTermination (dict) --
If the value is true , you can't terminate the instance through the Amazon EC2 console, CLI, or API; otherwise, you can.
Value (boolean) --
The attribute value. The valid values are true or false .
EnaSupport (dict) --
Indicates whether enhanced networking with ENA is enabled.
Value (boolean) --
The attribute value. The valid values are true or false .
EbsOptimized (dict) --
Indicates whether the instance is optimized for Amazon EBS I/O.
Value (boolean) --
The attribute value. The valid values are true or false .
InstanceId (string) --
The ID of the instance.
InstanceInitiatedShutdownBehavior (dict) --
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
Value (string) --
The attribute value. The value is case-sensitive.
InstanceType (dict) --
The instance type.
Value (string) --
The attribute value. The value is case-sensitive.
KernelId (dict) --
The kernel ID.
Value (string) --
The attribute value. The value is case-sensitive.
ProductCodes (list) --
A list of product codes.
(dict) --
Describes a product code.
ProductCodeId (string) --
The product code.
ProductCodeType (string) --
The type of product code.
RamdiskId (dict) --
The RAM disk ID.
Value (string) --
The attribute value. The value is case-sensitive.
RootDeviceName (dict) --
The device name of the root device volume (for example, /dev/sda1 ).
Value (string) --
The attribute value. The value is case-sensitive.
SourceDestCheck (dict) --
Indicates whether source/destination checking is enabled. A value of true means that checking is enabled, and false means that checking is disabled. This value must be false for a NAT instance to perform NAT.
Value (boolean) --
The attribute value. The valid values are true or false .
SriovNetSupport (dict) --
Indicates whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
Value (string) --
The attribute value. The value is case-sensitive.
UserData (dict) --
The user data.
Value (string) --
The attribute value. The value is case-sensitive.
Examples
This example describes the instance type of the specified instance.
response = client.describe_instance_attribute(
Attribute='instanceType',
InstanceId='i-1234567890abcdef0',
)
print(response)
Expected Output:
{
'InstanceId': 'i-1234567890abcdef0',
'InstanceType': {
'Value': 't1.micro',
},
'ResponseMetadata': {
'...': '...',
},
}
This example describes the disableApiTermination attribute of the specified instance.
response = client.describe_instance_attribute(
Attribute='disableApiTermination',
InstanceId='i-1234567890abcdef0',
)
print(response)
Expected Output:
{
'DisableApiTermination': {
'Value': 'false',
},
'InstanceId': 'i-1234567890abcdef0',
'ResponseMetadata': {
'...': '...',
},
}
This example describes the blockDeviceMapping attribute of the specified instance.
response = client.describe_instance_attribute(
Attribute='blockDeviceMapping',
InstanceId='i-1234567890abcdef0',
)
print(response)
Expected Output:
{
'BlockDeviceMappings': [
{
'DeviceName': '/dev/sda1',
'Ebs': {
'AttachTime': datetime(2013, 5, 17, 22, 42, 34, 4, 137, 0),
'DeleteOnTermination': True,
'Status': 'attached',
'VolumeId': 'vol-049df61146c4d7901',
},
},
{
'DeviceName': '/dev/sdf',
'Ebs': {
'AttachTime': datetime(2013, 9, 10, 23, 7, 0, 1, 253, 0),
'DeleteOnTermination': False,
'Status': 'attached',
'VolumeId': 'vol-049df61146c4d7901',
},
},
],
'InstanceId': 'i-1234567890abcdef0',
'ResponseMetadata': {
'...': '...',
},
}
Describes the credit option for CPU usage of the specified T2 or T3 instances. The credit options are standard and unlimited .
If you do not specify an instance ID, Amazon EC2 returns T2 and T3 instances with the unlimited credit option, as well as instances that were previously configured as T2 or T3 with the unlimited credit option. For example, if you resize a T2 instance, while it is configured as unlimited , to an M4 instance, Amazon EC2 returns the M4 instance.
If you specify one or more instance IDs, Amazon EC2 returns the credit option (standard or unlimited ) of those instances. If you specify an instance ID that is not valid, such as an instance that is not a T2 or T3 instance, an error is returned.
Recently terminated instances might appear in the returned results. This interval is usually less than one hour.
If an Availability Zone is experiencing a service disruption and you specify instance IDs in the affected zone, or do not specify any instance IDs at all, the call fails. If you specify only instance IDs in an unaffected zone, the call works normally.
For more information, see Burstable Performance Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_instance_credit_specifications(
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
InstanceIds=[
'string',
],
MaxResults=123,
NextToken='string'
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The instance IDs.
Default: Describes all your instances.
Constraints: Maximum 1000 explicitly specified instance IDs.
dict
Response Syntax
{
'InstanceCreditSpecifications': [
{
'InstanceId': 'string',
'CpuCredits': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
InstanceCreditSpecifications (list) --
Information about the credit option for CPU usage of an instance.
(dict) --
Describes the credit option for CPU usage of a T2 or T3 instance.
InstanceId (string) --
The ID of the instance.
CpuCredits (string) --
The credit option for CPU usage of the instance. Valid values are standard and unlimited .
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes the status of the specified instances or all of your instances. By default, only running instances are described, unless you specifically indicate to return the status of all instances.
Instance status includes the following components:
See also: AWS API Documentation
Request Syntax
response = client.describe_instance_status(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
InstanceIds=[
'string',
],
MaxResults=123,
NextToken='string',
DryRun=True|False,
IncludeAllInstances=True|False
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The instance IDs.
Default: Describes all your instances.
Constraints: Maximum 100 explicitly specified instance IDs.
When true , includes the health status for all instances. When false , includes the health status for running instances only.
Default: false
dict
Response Syntax
{
'InstanceStatuses': [
{
'AvailabilityZone': 'string',
'Events': [
{
'InstanceEventId': 'string',
'Code': 'instance-reboot'|'system-reboot'|'system-maintenance'|'instance-retirement'|'instance-stop',
'Description': 'string',
'NotAfter': datetime(2015, 1, 1),
'NotBefore': datetime(2015, 1, 1),
'NotBeforeDeadline': datetime(2015, 1, 1)
},
],
'InstanceId': 'string',
'InstanceState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceStatus': {
'Details': [
{
'ImpairedSince': datetime(2015, 1, 1),
'Name': 'reachability',
'Status': 'passed'|'failed'|'insufficient-data'|'initializing'
},
],
'Status': 'ok'|'impaired'|'insufficient-data'|'not-applicable'|'initializing'
},
'SystemStatus': {
'Details': [
{
'ImpairedSince': datetime(2015, 1, 1),
'Name': 'reachability',
'Status': 'passed'|'failed'|'insufficient-data'|'initializing'
},
],
'Status': 'ok'|'impaired'|'insufficient-data'|'not-applicable'|'initializing'
}
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
InstanceStatuses (list) --
Information about the status of the instances.
(dict) --
Describes the status of an instance.
AvailabilityZone (string) --
The Availability Zone of the instance.
Events (list) --
Any scheduled events associated with the instance.
(dict) --
Describes a scheduled event for an instance.
InstanceEventId (string) --
The ID of the event.
Code (string) --
The event code.
Description (string) --
A description of the event.
After a scheduled event is completed, it can still be described for up to a week. If the event has been completed, this description starts with the following text: [Completed].
NotAfter (datetime) --
The latest scheduled end time for the event.
NotBefore (datetime) --
The earliest scheduled start time for the event.
NotBeforeDeadline (datetime) --
The deadline for starting the event.
InstanceId (string) --
The ID of the instance.
InstanceState (dict) --
The intended state of the instance. DescribeInstanceStatus requires that an instance be in the running state.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
InstanceStatus (dict) --
Reports impaired functionality that stems from issues internal to the instance, such as impaired reachability.
Details (list) --
The system instance health or application instance health.
(dict) --
Describes the instance status.
ImpairedSince (datetime) --
The time when a status check failed. For an instance that was launched and impaired, this is the time when the instance was launched.
Name (string) --
The type of instance status.
Status (string) --
The status.
Status (string) --
The status.
SystemStatus (dict) --
Reports impaired functionality that stems from issues related to the systems that support an instance, such as hardware failures and network connectivity problems.
Details (list) --
The system instance health or application instance health.
(dict) --
Describes the instance status.
ImpairedSince (datetime) --
The time when a status check failed. For an instance that was launched and impaired, this is the time when the instance was launched.
Name (string) --
The type of instance status.
Status (string) --
The status.
Status (string) --
The status.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes the specified instances or all of AWS account's instances.
If you specify one or more instance IDs, Amazon EC2 returns information for those instances. If you do not specify instance IDs, Amazon EC2 returns information for all relevant instances. If you specify an instance ID that is not valid, an error is returned. If you specify an instance that you do not own, it is not included in the returned results.
Recently terminated instances might appear in the returned results. This interval is usually less than one hour.
If you describe instances in the rare case where an Availability Zone is experiencing a service disruption and you specify instance IDs that are in the affected zone, or do not specify any instance IDs at all, the call fails. If you describe instances and specify only instance IDs that are in an unaffected zone, the call works normally.
See also: AWS API Documentation
Request Syntax
response = client.describe_instances(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
InstanceIds=[
'string',
],
DryRun=True|False,
MaxResults=123,
NextToken='string'
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The instance IDs.
Default: Describes all your instances.
dict
Response Syntax
{
'Reservations': [
{
'Groups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'Instances': [
{
'AmiLaunchIndex': 123,
'ImageId': 'string',
'InstanceId': 'string',
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'KernelId': 'string',
'KeyName': 'string',
'LaunchTime': datetime(2015, 1, 1),
'Monitoring': {
'State': 'disabled'|'disabling'|'enabled'|'pending'
},
'Placement': {
'AvailabilityZone': 'string',
'Affinity': 'string',
'GroupName': 'string',
'PartitionNumber': 123,
'HostId': 'string',
'Tenancy': 'default'|'dedicated'|'host',
'SpreadDomain': 'string'
},
'Platform': 'Windows',
'PrivateDnsName': 'string',
'PrivateIpAddress': 'string',
'ProductCodes': [
{
'ProductCodeId': 'string',
'ProductCodeType': 'devpay'|'marketplace'
},
],
'PublicDnsName': 'string',
'PublicIpAddress': 'string',
'RamdiskId': 'string',
'State': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'StateTransitionReason': 'string',
'SubnetId': 'string',
'VpcId': 'string',
'Architecture': 'i386'|'x86_64'|'arm64',
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'Ebs': {
'AttachTime': datetime(2015, 1, 1),
'DeleteOnTermination': True|False,
'Status': 'attaching'|'attached'|'detaching'|'detached',
'VolumeId': 'string'
}
},
],
'ClientToken': 'string',
'EbsOptimized': True|False,
'EnaSupport': True|False,
'Hypervisor': 'ovm'|'xen',
'IamInstanceProfile': {
'Arn': 'string',
'Id': 'string'
},
'InstanceLifecycle': 'spot'|'scheduled',
'ElasticGpuAssociations': [
{
'ElasticGpuId': 'string',
'ElasticGpuAssociationId': 'string',
'ElasticGpuAssociationState': 'string',
'ElasticGpuAssociationTime': 'string'
},
],
'ElasticInferenceAcceleratorAssociations': [
{
'ElasticInferenceAcceleratorArn': 'string',
'ElasticInferenceAcceleratorAssociationId': 'string',
'ElasticInferenceAcceleratorAssociationState': 'string',
'ElasticInferenceAcceleratorAssociationTime': datetime(2015, 1, 1)
},
],
'NetworkInterfaces': [
{
'Association': {
'IpOwnerId': 'string',
'PublicDnsName': 'string',
'PublicIp': 'string'
},
'Attachment': {
'AttachTime': datetime(2015, 1, 1),
'AttachmentId': 'string',
'DeleteOnTermination': True|False,
'DeviceIndex': 123,
'Status': 'attaching'|'attached'|'detaching'|'detached'
},
'Description': 'string',
'Groups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'MacAddress': 'string',
'NetworkInterfaceId': 'string',
'OwnerId': 'string',
'PrivateDnsName': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Association': {
'IpOwnerId': 'string',
'PublicDnsName': 'string',
'PublicIp': 'string'
},
'Primary': True|False,
'PrivateDnsName': 'string',
'PrivateIpAddress': 'string'
},
],
'SourceDestCheck': True|False,
'Status': 'available'|'associated'|'attaching'|'in-use'|'detaching',
'SubnetId': 'string',
'VpcId': 'string',
'InterfaceType': 'string'
},
],
'RootDeviceName': 'string',
'RootDeviceType': 'ebs'|'instance-store',
'SecurityGroups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'SourceDestCheck': True|False,
'SpotInstanceRequestId': 'string',
'SriovNetSupport': 'string',
'StateReason': {
'Code': 'string',
'Message': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VirtualizationType': 'hvm'|'paravirtual',
'CpuOptions': {
'CoreCount': 123,
'ThreadsPerCore': 123
},
'CapacityReservationId': 'string',
'CapacityReservationSpecification': {
'CapacityReservationPreference': 'open'|'none',
'CapacityReservationTarget': {
'CapacityReservationId': 'string'
}
},
'HibernationOptions': {
'Configured': True|False
},
'Licenses': [
{
'LicenseConfigurationArn': 'string'
},
]
},
],
'OwnerId': 'string',
'RequesterId': 'string',
'ReservationId': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Reservations (list) --
Information about the reservations.
(dict) --
Describes a reservation.
Groups (list) --
[EC2-Classic only] The security groups.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
Instances (list) --
The instances.
(dict) --
Describes an instance.
AmiLaunchIndex (integer) --
The AMI launch index, which can be used to find this instance in the launch group.
ImageId (string) --
The ID of the AMI used to launch the instance.
InstanceId (string) --
The ID of the instance.
InstanceType (string) --
The instance type.
KernelId (string) --
The kernel associated with this instance, if applicable.
KeyName (string) --
The name of the key pair, if this instance was launched with an associated key pair.
LaunchTime (datetime) --
The time the instance was launched.
Monitoring (dict) --
The monitoring for the instance.
State (string) --
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
Placement (dict) --
The location where the instance launched, if applicable.
AvailabilityZone (string) --
The Availability Zone of the instance.
If not specified, an Availability Zone will be automatically chosen for you based on the load balancing criteria for the Region.
Affinity (string) --
The affinity setting for the instance on the Dedicated Host. This parameter is not supported for the ImportInstance command.
GroupName (string) --
The name of the placement group the instance is in.
PartitionNumber (integer) --
The number of the partition the instance is in. Valid only if the placement group strategy is set to partition .
HostId (string) --
The ID of the Dedicated Host on which the instance resides. This parameter is not supported for the ImportInstance command.
Tenancy (string) --
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for the ImportInstance command.
SpreadDomain (string) --
Reserved for future use.
Platform (string) --
The value is Windows for Windows instances; otherwise blank.
PrivateDnsName (string) --
(IPv4 only) The private DNS hostname name assigned to the instance. This DNS hostname can only be used inside the Amazon EC2 network. This name is not available until the instance enters the running state.
[EC2-VPC] The Amazon-provided DNS server resolves Amazon-provided private DNS hostnames if you've enabled DNS resolution and DNS hostnames in your VPC. If you are not using the Amazon-provided DNS server in your VPC, your custom domain name servers must resolve the hostname as appropriate.
PrivateIpAddress (string) --
The private IPv4 address assigned to the instance.
ProductCodes (list) --
The product codes attached to this instance, if applicable.
(dict) --
Describes a product code.
ProductCodeId (string) --
The product code.
ProductCodeType (string) --
The type of product code.
PublicDnsName (string) --
(IPv4 only) The public DNS name assigned to the instance. This name is not available until the instance enters the running state. For EC2-VPC, this name is only available if you've enabled DNS hostnames for your VPC.
PublicIpAddress (string) --
The public IPv4 address assigned to the instance, if applicable.
RamdiskId (string) --
The RAM disk associated with this instance, if applicable.
State (dict) --
The current state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
StateTransitionReason (string) --
The reason for the most recent state transition. This might be an empty string.
SubnetId (string) --
[EC2-VPC] The ID of the subnet in which the instance is running.
VpcId (string) --
[EC2-VPC] The ID of the VPC in which the instance is running.
Architecture (string) --
The architecture of the image.
BlockDeviceMappings (list) --
Any block device mapping entries for the instance.
(dict) --
Describes a block device mapping.
DeviceName (string) --
The device name (for example, /dev/sdh or xvdh ).
Ebs (dict) --
Parameters used to automatically set up EBS volumes when the instance is launched.
AttachTime (datetime) --
The time stamp when the attachment initiated.
DeleteOnTermination (boolean) --
Indicates whether the volume is deleted on instance termination.
Status (string) --
The attachment state.
VolumeId (string) --
The ID of the EBS volume.
ClientToken (string) --
The idempotency token you provided when you launched the instance, if applicable.
EbsOptimized (boolean) --
Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.
EnaSupport (boolean) --
Specifies whether enhanced networking with ENA is enabled.
Hypervisor (string) --
The hypervisor type of the instance.
IamInstanceProfile (dict) --
The IAM instance profile associated with the instance, if applicable.
Arn (string) --
The Amazon Resource Name (ARN) of the instance profile.
Id (string) --
The ID of the instance profile.
InstanceLifecycle (string) --
Indicates whether this is a Spot Instance or a Scheduled Instance.
ElasticGpuAssociations (list) --
The Elastic GPU associated with the instance.
(dict) --
Describes the association between an instance and an Elastic Graphics accelerator.
ElasticGpuId (string) --
The ID of the Elastic Graphics accelerator.
ElasticGpuAssociationId (string) --
The ID of the association.
ElasticGpuAssociationState (string) --
The state of the association between the instance and the Elastic Graphics accelerator.
ElasticGpuAssociationTime (string) --
The time the Elastic Graphics accelerator was associated with the instance.
ElasticInferenceAcceleratorAssociations (list) --
The elastic inference accelerator associated with the instance.
(dict) --
Describes the association between an instance and an elastic inference accelerator.
ElasticInferenceAcceleratorArn (string) --
The Amazon Resource Name (ARN) of the elastic inference accelerator.
ElasticInferenceAcceleratorAssociationId (string) --
The ID of the association.
ElasticInferenceAcceleratorAssociationState (string) --
The state of the elastic inference accelerator.
ElasticInferenceAcceleratorAssociationTime (datetime) --
The time at which the elastic inference accelerator is associated with an instance.
NetworkInterfaces (list) --
[EC2-VPC] The network interfaces for the instance.
(dict) --
Describes a network interface.
Association (dict) --
The association information for an Elastic IPv4 associated with the network interface.
IpOwnerId (string) --
The ID of the owner of the Elastic IP address.
PublicDnsName (string) --
The public DNS name.
PublicIp (string) --
The public IP address or Elastic IP address bound to the network interface.
Attachment (dict) --
The network interface attachment.
AttachTime (datetime) --
The time stamp when the attachment initiated.
AttachmentId (string) --
The ID of the network interface attachment.
DeleteOnTermination (boolean) --
Indicates whether the network interface is deleted when the instance is terminated.
DeviceIndex (integer) --
The index of the device on the instance for the network interface attachment.
Status (string) --
The attachment state.
Description (string) --
The description.
Groups (list) --
One or more security groups.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
Ipv6Addresses (list) --
One or more IPv6 addresses associated with the network interface.
(dict) --
Describes an IPv6 address.
Ipv6Address (string) --
The IPv6 address.
MacAddress (string) --
The MAC address.
NetworkInterfaceId (string) --
The ID of the network interface.
OwnerId (string) --
The ID of the AWS account that created the network interface.
PrivateDnsName (string) --
The private DNS name.
PrivateIpAddress (string) --
The IPv4 address of the network interface within the subnet.
PrivateIpAddresses (list) --
One or more private IPv4 addresses associated with the network interface.
(dict) --
Describes a private IPv4 address.
Association (dict) --
The association information for an Elastic IP address for the network interface.
IpOwnerId (string) --
The ID of the owner of the Elastic IP address.
PublicDnsName (string) --
The public DNS name.
PublicIp (string) --
The public IP address or Elastic IP address bound to the network interface.
Primary (boolean) --
Indicates whether this IPv4 address is the primary private IP address of the network interface.
PrivateDnsName (string) --
The private IPv4 DNS name.
PrivateIpAddress (string) --
The private IPv4 address of the network interface.
SourceDestCheck (boolean) --
Indicates whether to validate network traffic to or from this network interface.
Status (string) --
The status of the network interface.
SubnetId (string) --
The ID of the subnet.
VpcId (string) --
The ID of the VPC.
InterfaceType (string) --
Describes the type of network interface.
Valid values: interface | efa
RootDeviceName (string) --
The device name of the root device volume (for example, /dev/sda1 ).
RootDeviceType (string) --
The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
SecurityGroups (list) --
The security groups for the instance.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
SourceDestCheck (boolean) --
Specifies whether to enable an instance launched in a VPC to perform NAT. This controls whether source/destination checking is enabled on the instance. A value of true means that checking is enabled, and false means that checking is disabled. The value must be false for the instance to perform NAT. For more information, see NAT Instances in the Amazon Virtual Private Cloud User Guide .
SpotInstanceRequestId (string) --
If the request is a Spot Instance request, the ID of the request.
SriovNetSupport (string) --
Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
StateReason (dict) --
The reason for the most recent state transition.
Code (string) --
The reason code for the state change.
Message (string) --
The message for the state change.
Tags (list) --
Any tags assigned to the instance.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VirtualizationType (string) --
The virtualization type of the instance.
CpuOptions (dict) --
The CPU options for the instance.
CoreCount (integer) --
The number of CPU cores for the instance.
ThreadsPerCore (integer) --
The number of threads per CPU core.
CapacityReservationId (string) --
The ID of the Capacity Reservation.
CapacityReservationSpecification (dict) --
Information about the Capacity Reservation targeting option.
CapacityReservationPreference (string) --
Describes the instance's Capacity Reservation preferences. Possible preferences include:
CapacityReservationTarget (dict) --
Information about the targeted Capacity Reservation.
CapacityReservationId (string) --
The ID of the Capacity Reservation.
HibernationOptions (dict) --
Indicates whether the instance is enabled for hibernation.
Configured (boolean) --
If this parameter is set to true , your instance is enabled for hibernation; otherwise, it is not enabled for hibernation.
Licenses (list) --
The license configurations.
(dict) --
Describes a license configuration.
LicenseConfigurationArn (string) --
The Amazon Resource Name (ARN) of the license configuration.
OwnerId (string) --
The ID of the AWS account that owns the reservation.
RequesterId (string) --
The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling).
ReservationId (string) --
The ID of the reservation.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes one or more of your internet gateways.
See also: AWS API Documentation
Request Syntax
response = client.describe_internet_gateways(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
InternetGatewayIds=[
'string',
],
NextToken='string',
MaxResults=123
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more internet gateway IDs.
Default: Describes all your internet gateways.
dict
Response Syntax
{
'InternetGateways': [
{
'Attachments': [
{
'State': 'attaching'|'attached'|'detaching'|'detached',
'VpcId': 'string'
},
],
'InternetGatewayId': 'string',
'OwnerId': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
InternetGateways (list) --
Information about one or more internet gateways.
(dict) --
Describes an internet gateway.
Attachments (list) --
Any VPCs attached to the internet gateway.
(dict) --
Describes the attachment of a VPC to an internet gateway or an egress-only internet gateway.
State (string) --
The current state of the attachment. For an internet gateway, the state is available when attached to a VPC; otherwise, this value is not returned.
VpcId (string) --
The ID of the VPC.
InternetGatewayId (string) --
The ID of the internet gateway.
OwnerId (string) --
The ID of the AWS account that owns the internet gateway.
Tags (list) --
Any tags assigned to the internet gateway.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Examples
This example describes the Internet gateway for the specified VPC.
response = client.describe_internet_gateways(
Filters=[
{
'Name': 'attachment.vpc-id',
'Values': [
'vpc-a01106c2',
],
},
],
)
print(response)
Expected Output:
{
'InternetGateways': [
{
'Attachments': [
{
'State': 'available',
'VpcId': 'vpc-a01106c2',
},
],
'InternetGatewayId': 'igw-c0a643a9',
'Tags': [
],
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes the specified key pairs or all of your key pairs.
For more information about key pairs, see Key Pairs in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_key_pairs(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
KeyNames=[
'string',
],
DryRun=True|False
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The key pair names.
Default: Describes all your key pairs.
dict
Response Syntax
{
'KeyPairs': [
{
'KeyFingerprint': 'string',
'KeyName': 'string'
},
]
}
Response Structure
(dict) --
KeyPairs (list) --
Information about the key pairs.
(dict) --
Describes a key pair.
KeyFingerprint (string) --
If you used CreateKeyPair to create the key pair, this is the SHA-1 digest of the DER encoded private key. If you used ImportKeyPair to provide AWS the public key, this is the MD5 public key fingerprint as specified in section 4 of RFC4716.
KeyName (string) --
The name of the key pair.
Examples
This example displays the fingerprint for the specified key.
response = client.describe_key_pairs(
KeyNames=[
'my-key-pair',
],
)
print(response)
Expected Output:
{
'KeyPairs': [
{
'KeyFingerprint': '1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f',
'KeyName': 'my-key-pair',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes one or more versions of a specified launch template. You can describe all versions, individual versions, or a range of versions.
See also: AWS API Documentation
Request Syntax
response = client.describe_launch_template_versions(
DryRun=True|False,
LaunchTemplateId='string',
LaunchTemplateName='string',
Versions=[
'string',
],
MinVersion='string',
MaxVersion='string',
NextToken='string',
MaxResults=123,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
]
)
One or more versions of the launch template.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'LaunchTemplateVersions': [
{
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'VersionNumber': 123,
'VersionDescription': 'string',
'CreateTime': datetime(2015, 1, 1),
'CreatedBy': 'string',
'DefaultVersion': True|False,
'LaunchTemplateData': {
'KernelId': 'string',
'EbsOptimized': True|False,
'IamInstanceProfile': {
'Arn': 'string',
'Name': 'string'
},
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'Encrypted': True|False,
'DeleteOnTermination': True|False,
'Iops': 123,
'KmsKeyId': 'string',
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1'
},
'NoDevice': 'string'
},
],
'NetworkInterfaces': [
{
'AssociatePublicIpAddress': True|False,
'DeleteOnTermination': True|False,
'Description': 'string',
'DeviceIndex': 123,
'Groups': [
'string',
],
'InterfaceType': 'string',
'Ipv6AddressCount': 123,
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'NetworkInterfaceId': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
'SecondaryPrivateIpAddressCount': 123,
'SubnetId': 'string'
},
],
'ImageId': 'string',
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'KeyName': 'string',
'Monitoring': {
'Enabled': True|False
},
'Placement': {
'AvailabilityZone': 'string',
'Affinity': 'string',
'GroupName': 'string',
'HostId': 'string',
'Tenancy': 'default'|'dedicated'|'host',
'SpreadDomain': 'string'
},
'RamDiskId': 'string',
'DisableApiTermination': True|False,
'InstanceInitiatedShutdownBehavior': 'stop'|'terminate',
'UserData': 'string',
'TagSpecifications': [
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'ElasticGpuSpecifications': [
{
'Type': 'string'
},
],
'ElasticInferenceAccelerators': [
{
'Type': 'string'
},
],
'SecurityGroupIds': [
'string',
],
'SecurityGroups': [
'string',
],
'InstanceMarketOptions': {
'MarketType': 'spot',
'SpotOptions': {
'MaxPrice': 'string',
'SpotInstanceType': 'one-time'|'persistent',
'BlockDurationMinutes': 123,
'ValidUntil': datetime(2015, 1, 1),
'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate'
}
},
'CreditSpecification': {
'CpuCredits': 'string'
},
'CpuOptions': {
'CoreCount': 123,
'ThreadsPerCore': 123
},
'CapacityReservationSpecification': {
'CapacityReservationPreference': 'open'|'none',
'CapacityReservationTarget': {
'CapacityReservationId': 'string'
}
},
'LicenseSpecifications': [
{
'LicenseConfigurationArn': 'string'
},
],
'HibernationOptions': {
'Configured': True|False
}
}
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
LaunchTemplateVersions (list) --
Information about the launch template versions.
(dict) --
Describes a launch template version.
LaunchTemplateId (string) --
The ID of the launch template.
LaunchTemplateName (string) --
The name of the launch template.
VersionNumber (integer) --
The version number.
VersionDescription (string) --
The description for the version.
CreateTime (datetime) --
The time the version was created.
CreatedBy (string) --
The principal that created the version.
DefaultVersion (boolean) --
Indicates whether the version is the default version.
LaunchTemplateData (dict) --
Information about the launch template.
KernelId (string) --
The ID of the kernel, if applicable.
EbsOptimized (boolean) --
Indicates whether the instance is optimized for Amazon EBS I/O.
IamInstanceProfile (dict) --
The IAM instance profile.
Arn (string) --
The Amazon Resource Name (ARN) of the instance profile.
Name (string) --
The name of the instance profile.
BlockDeviceMappings (list) --
The block device mappings.
(dict) --
Describes a block device mapping.
DeviceName (string) --
The device name.
VirtualName (string) --
The virtual device name (ephemeralN).
Ebs (dict) --
Information about the block device for an EBS volume.
Encrypted (boolean) --
Indicates whether the EBS volume is encrypted.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports.
KmsKeyId (string) --
The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption.
SnapshotId (string) --
The ID of the snapshot.
VolumeSize (integer) --
The size of the volume, in GiB.
VolumeType (string) --
The volume type.
NoDevice (string) --
Suppresses the specified device included in the block device mapping of the AMI.
NetworkInterfaces (list) --
The network interfaces.
(dict) --
Describes a network interface.
AssociatePublicIpAddress (boolean) --
Indicates whether to associate a public IPv4 address with eth0 for a new network interface.
DeleteOnTermination (boolean) --
Indicates whether the network interface is deleted when the instance is terminated.
Description (string) --
A description for the network interface.
DeviceIndex (integer) --
The device index for the network interface attachment.
Groups (list) --
The IDs of one or more security groups.
InterfaceType (string) --
The type of network interface.
Ipv6AddressCount (integer) --
The number of IPv6 addresses for the network interface.
Ipv6Addresses (list) --
The IPv6 addresses for the network interface.
(dict) --
Describes an IPv6 address.
Ipv6Address (string) --
The IPv6 address.
NetworkInterfaceId (string) --
The ID of the network interface.
PrivateIpAddress (string) --
The primary private IPv4 address of the network interface.
PrivateIpAddresses (list) --
One or more private IPv4 addresses.
(dict) --
Describes a secondary private IPv4 address for a network interface.
Primary (boolean) --
Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.
PrivateIpAddress (string) --
The private IPv4 addresses.
SecondaryPrivateIpAddressCount (integer) --
The number of secondary private IPv4 addresses for the network interface.
SubnetId (string) --
The ID of the subnet for the network interface.
ImageId (string) --
The ID of the AMI that was used to launch the instance.
InstanceType (string) --
The instance type.
KeyName (string) --
The name of the key pair.
Monitoring (dict) --
The monitoring for the instance.
Enabled (boolean) --
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
Placement (dict) --
The placement of the instance.
AvailabilityZone (string) --
The Availability Zone of the instance.
Affinity (string) --
The affinity setting for the instance on the Dedicated Host.
GroupName (string) --
The name of the placement group for the instance.
HostId (string) --
The ID of the Dedicated Host for the instance.
Tenancy (string) --
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware.
SpreadDomain (string) --
Reserved for future use.
RamDiskId (string) --
The ID of the RAM disk, if applicable.
DisableApiTermination (boolean) --
If set to true , indicates that the instance cannot be terminated using the Amazon EC2 console, command line tool, or API.
InstanceInitiatedShutdownBehavior (string) --
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
UserData (string) --
The user data for the instance.
TagSpecifications (list) --
The tags.
(dict) --
The tag specification for the launch template.
ResourceType (string) --
The type of resource.
Tags (list) --
The tags for the resource.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
ElasticGpuSpecifications (list) --
The elastic GPU specification.
(dict) --
Describes an elastic GPU.
Type (string) --
The elastic GPU type.
ElasticInferenceAccelerators (list) --
The elastic inference accelerator for the instance.
(dict) --
Describes an elastic inference accelerator.
Type (string) --
The type of elastic inference accelerator. The possible values are eia1.medium, eia1.large, and eia1.xlarge.
SecurityGroupIds (list) --
The security group IDs.
SecurityGroups (list) --
The security group names.
InstanceMarketOptions (dict) --
The market (purchasing) option for the instances.
MarketType (string) --
The market type.
SpotOptions (dict) --
The options for Spot Instances.
MaxPrice (string) --
The maximum hourly price you're willing to pay for the Spot Instances.
SpotInstanceType (string) --
The Spot Instance request type.
BlockDurationMinutes (integer) --
The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).
ValidUntil (datetime) --
The end date of the request. For a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached.
InstanceInterruptionBehavior (string) --
The behavior when a Spot Instance is interrupted.
CreditSpecification (dict) --
The credit option for CPU usage of the instance.
CpuCredits (string) --
The credit option for CPU usage of a T2 or T3 instance. Valid values are standard and unlimited .
CpuOptions (dict) --
The CPU options for the instance. For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide .
CoreCount (integer) --
The number of CPU cores for the instance.
ThreadsPerCore (integer) --
The number of threads per CPU core.
CapacityReservationSpecification (dict) --
Information about the Capacity Reservation targeting option.
CapacityReservationPreference (string) --
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
CapacityReservationTarget (dict) --
Information about the target Capacity Reservation.
CapacityReservationId (string) --
The ID of the Capacity Reservation.
LicenseSpecifications (list) --
The license configurations.
(dict) --
Describes a license configuration.
LicenseConfigurationArn (string) --
The Amazon Resource Name (ARN) of the license configuration.
HibernationOptions (dict) --
Indicates whether an instance is configured for hibernation. For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
Configured (boolean) --
If this parameter is set to true , the instance is enabled for hibernation; otherwise, it is not enabled for hibernation.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes one or more launch templates.
See also: AWS API Documentation
Request Syntax
response = client.describe_launch_templates(
DryRun=True|False,
LaunchTemplateIds=[
'string',
],
LaunchTemplateNames=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
NextToken='string',
MaxResults=123
)
One or more launch template IDs.
One or more launch template names.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'LaunchTemplates': [
{
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'CreateTime': datetime(2015, 1, 1),
'CreatedBy': 'string',
'DefaultVersionNumber': 123,
'LatestVersionNumber': 123,
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
LaunchTemplates (list) --
Information about the launch templates.
(dict) --
Describes a launch template.
LaunchTemplateId (string) --
The ID of the launch template.
LaunchTemplateName (string) --
The name of the launch template.
CreateTime (datetime) --
The time launch template was created.
CreatedBy (string) --
The principal that created the launch template.
DefaultVersionNumber (integer) --
The version number of the default version of the launch template.
LatestVersionNumber (integer) --
The version number of the latest version of the launch template.
Tags (list) --
The tags for the launch template.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes your Elastic IP addresses that are being moved to the EC2-VPC platform, or that are being restored to the EC2-Classic platform. This request does not return information about any other Elastic IP addresses in your account.
See also: AWS API Documentation
Request Syntax
response = client.describe_moving_addresses(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
MaxResults=123,
NextToken='string',
PublicIps=[
'string',
]
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The maximum number of results to return for the request in a single page. The remaining results of the initial request can be seen by sending another request with the returned NextToken value. This value can be between 5 and 1000; if MaxResults is given a value outside of this range, an error is returned.
Default: If no value is provided, the default is 1000.
One or more Elastic IP addresses.
dict
Response Syntax
{
'MovingAddressStatuses': [
{
'MoveStatus': 'movingToVpc'|'restoringToClassic',
'PublicIp': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
MovingAddressStatuses (list) --
The status for each Elastic IP address.
(dict) --
Describes the status of a moving Elastic IP address.
MoveStatus (string) --
The status of the Elastic IP address that's being moved to the EC2-VPC platform, or restored to the EC2-Classic platform.
PublicIp (string) --
The Elastic IP address.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Examples
This example describes all of your moving Elastic IP addresses.
response = client.describe_moving_addresses(
)
print(response)
Expected Output:
{
'MovingAddressStatuses': [
{
'MoveStatus': 'MovingToVpc',
'PublicIp': '198.51.100.0',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes one or more of your NAT gateways.
See also: AWS API Documentation
Request Syntax
response = client.describe_nat_gateways(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NatGatewayIds=[
'string',
],
NextToken='string'
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more NAT gateway IDs.
dict
Response Syntax
{
'NatGateways': [
{
'CreateTime': datetime(2015, 1, 1),
'DeleteTime': datetime(2015, 1, 1),
'FailureCode': 'string',
'FailureMessage': 'string',
'NatGatewayAddresses': [
{
'AllocationId': 'string',
'NetworkInterfaceId': 'string',
'PrivateIp': 'string',
'PublicIp': 'string'
},
],
'NatGatewayId': 'string',
'ProvisionedBandwidth': {
'ProvisionTime': datetime(2015, 1, 1),
'Provisioned': 'string',
'RequestTime': datetime(2015, 1, 1),
'Requested': 'string',
'Status': 'string'
},
'State': 'pending'|'failed'|'available'|'deleting'|'deleted',
'SubnetId': 'string',
'VpcId': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
NatGateways (list) --
Information about the NAT gateways.
(dict) --
Describes a NAT gateway.
CreateTime (datetime) --
The date and time the NAT gateway was created.
DeleteTime (datetime) --
The date and time the NAT gateway was deleted, if applicable.
FailureCode (string) --
If the NAT gateway could not be created, specifies the error code for the failure. (InsufficientFreeAddressesInSubnet | Gateway.NotAttached | InvalidAllocationID.NotFound | Resource.AlreadyAssociated | InternalError | InvalidSubnetID.NotFound )
FailureMessage (string) --
If the NAT gateway could not be created, specifies the error message for the failure, that corresponds to the error code.
NatGatewayAddresses (list) --
Information about the IP addresses and network interface associated with the NAT gateway.
(dict) --
Describes the IP addresses and network interface associated with a NAT gateway.
AllocationId (string) --
The allocation ID of the Elastic IP address that's associated with the NAT gateway.
NetworkInterfaceId (string) --
The ID of the network interface associated with the NAT gateway.
PrivateIp (string) --
The private IP address associated with the Elastic IP address.
PublicIp (string) --
The Elastic IP address associated with the NAT gateway.
NatGatewayId (string) --
The ID of the NAT gateway.
ProvisionedBandwidth (dict) --
Reserved. If you need to sustain traffic greater than the documented limits , contact us through the Support Center .
ProvisionTime (datetime) --
Reserved. If you need to sustain traffic greater than the documented limits , contact us through the Support Center .
Provisioned (string) --
Reserved. If you need to sustain traffic greater than the documented limits , contact us through the Support Center .
RequestTime (datetime) --
Reserved. If you need to sustain traffic greater than the documented limits , contact us through the Support Center .
Requested (string) --
Reserved. If you need to sustain traffic greater than the documented limits , contact us through the Support Center .
Status (string) --
Reserved. If you need to sustain traffic greater than the documented limits , contact us through the Support Center .
State (string) --
The state of the NAT gateway.
SubnetId (string) --
The ID of the subnet in which the NAT gateway is located.
VpcId (string) --
The ID of the VPC in which the NAT gateway is located.
Tags (list) --
The tags for the NAT gateway.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Examples
This example describes the NAT gateway for the specified VPC.
response = client.describe_nat_gateways(
Filter=[
{
'Name': 'vpc-id',
'Values': [
'vpc-1a2b3c4d',
],
},
],
)
print(response)
Expected Output:
{
'NatGateways': [
{
'CreateTime': datetime(2015, 12, 1, 12, 26, 55, 1, 335, 0),
'NatGatewayAddresses': [
{
'AllocationId': 'eipalloc-89c620ec',
'NetworkInterfaceId': 'eni-9dec76cd',
'PrivateIp': '10.0.0.149',
'PublicIp': '198.11.222.333',
},
],
'NatGatewayId': 'nat-05dba92075d71c408',
'State': 'available',
'SubnetId': 'subnet-847e4dc2',
'VpcId': 'vpc-1a2b3c4d',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes one or more of your network ACLs.
For more information, see Network ACLs in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_network_acls(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
NetworkAclIds=[
'string',
],
NextToken='string',
MaxResults=123
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more network ACL IDs.
Default: Describes all your network ACLs.
dict
Response Syntax
{
'NetworkAcls': [
{
'Associations': [
{
'NetworkAclAssociationId': 'string',
'NetworkAclId': 'string',
'SubnetId': 'string'
},
],
'Entries': [
{
'CidrBlock': 'string',
'Egress': True|False,
'IcmpTypeCode': {
'Code': 123,
'Type': 123
},
'Ipv6CidrBlock': 'string',
'PortRange': {
'From': 123,
'To': 123
},
'Protocol': 'string',
'RuleAction': 'allow'|'deny',
'RuleNumber': 123
},
],
'IsDefault': True|False,
'NetworkAclId': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VpcId': 'string',
'OwnerId': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
NetworkAcls (list) --
Information about one or more network ACLs.
(dict) --
Describes a network ACL.
Associations (list) --
Any associations between the network ACL and one or more subnets
(dict) --
Describes an association between a network ACL and a subnet.
NetworkAclAssociationId (string) --
The ID of the association between a network ACL and a subnet.
NetworkAclId (string) --
The ID of the network ACL.
SubnetId (string) --
The ID of the subnet.
Entries (list) --
One or more entries (rules) in the network ACL.
(dict) --
Describes an entry in a network ACL.
CidrBlock (string) --
The IPv4 network range to allow or deny, in CIDR notation.
Egress (boolean) --
Indicates whether the rule is an egress rule (applied to traffic leaving the subnet).
IcmpTypeCode (dict) --
ICMP protocol: The ICMP type and code.
Code (integer) --
The ICMP code. A value of -1 means all codes for the specified ICMP type.
Type (integer) --
The ICMP type. A value of -1 means all types.
Ipv6CidrBlock (string) --
The IPv6 network range to allow or deny, in CIDR notation.
PortRange (dict) --
TCP or UDP protocols: The range of ports the rule applies to.
From (integer) --
The first port in the range.
To (integer) --
The last port in the range.
Protocol (string) --
The protocol number. A value of "-1" means all protocols.
RuleAction (string) --
Indicates whether to allow or deny the traffic that matches the rule.
RuleNumber (integer) --
The rule number for the entry. ACL entries are processed in ascending order by rule number.
IsDefault (boolean) --
Indicates whether this is the default network ACL for the VPC.
NetworkAclId (string) --
The ID of the network ACL.
Tags (list) --
Any tags assigned to the network ACL.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VpcId (string) --
The ID of the VPC for the network ACL.
OwnerId (string) --
The ID of the AWS account that owns the network ACL.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Examples
This example describes the specified network ACL.
response = client.describe_network_acls(
NetworkAclIds=[
'acl-5fb85d36',
],
)
print(response)
Expected Output:
{
'NetworkAcls': [
{
'Associations': [
{
'NetworkAclAssociationId': 'aclassoc-66ea5f0b',
'NetworkAclId': 'acl-9aeb5ef7',
'SubnetId': 'subnet-65ea5f08',
},
],
'Entries': [
{
'CidrBlock': '0.0.0.0/0',
'Egress': True,
'Protocol': '-1',
'RuleAction': 'deny',
'RuleNumber': 32767,
},
{
'CidrBlock': '0.0.0.0/0',
'Egress': False,
'Protocol': '-1',
'RuleAction': 'deny',
'RuleNumber': 32767,
},
],
'IsDefault': False,
'NetworkAclId': 'acl-5fb85d36',
'Tags': [
],
'VpcId': 'vpc-a01106c2',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes a network interface attribute. You can specify only one attribute at a time.
See also: AWS API Documentation
Request Syntax
response = client.describe_network_interface_attribute(
Attribute='description'|'groupSet'|'sourceDestCheck'|'attachment',
DryRun=True|False,
NetworkInterfaceId='string'
)
[REQUIRED]
The ID of the network interface.
dict
Response Syntax
{
'Attachment': {
'AttachTime': datetime(2015, 1, 1),
'AttachmentId': 'string',
'DeleteOnTermination': True|False,
'DeviceIndex': 123,
'InstanceId': 'string',
'InstanceOwnerId': 'string',
'Status': 'attaching'|'attached'|'detaching'|'detached'
},
'Description': {
'Value': 'string'
},
'Groups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'NetworkInterfaceId': 'string',
'SourceDestCheck': {
'Value': True|False
}
}
Response Structure
(dict) --
Contains the output of DescribeNetworkInterfaceAttribute.
Attachment (dict) --
The attachment (if any) of the network interface.
AttachTime (datetime) --
The timestamp indicating when the attachment initiated.
AttachmentId (string) --
The ID of the network interface attachment.
DeleteOnTermination (boolean) --
Indicates whether the network interface is deleted when the instance is terminated.
DeviceIndex (integer) --
The device index of the network interface attachment on the instance.
InstanceId (string) --
The ID of the instance.
InstanceOwnerId (string) --
The AWS account ID of the owner of the instance.
Status (string) --
The attachment state.
Description (dict) --
The description of the network interface.
Value (string) --
The attribute value. The value is case-sensitive.
Groups (list) --
The security groups associated with the network interface.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
NetworkInterfaceId (string) --
The ID of the network interface.
SourceDestCheck (dict) --
Indicates whether source/destination checking is enabled.
Value (boolean) --
The attribute value. The valid values are true or false .
Examples
This example describes the attachment attribute of the specified network interface.
response = client.describe_network_interface_attribute(
Attribute='attachment',
NetworkInterfaceId='eni-686ea200',
)
print(response)
Expected Output:
{
'Attachment': {
'AttachTime': datetime(2015, 5, 21, 20, 2, 20, 3, 141, 0),
'AttachmentId': 'eni-attach-43348162',
'DeleteOnTermination': True,
'DeviceIndex': 0,
'InstanceId': 'i-1234567890abcdef0',
'InstanceOwnerId': '123456789012',
'Status': 'attached',
},
'NetworkInterfaceId': 'eni-686ea200',
'ResponseMetadata': {
'...': '...',
},
}
This example describes the description attribute of the specified network interface.
response = client.describe_network_interface_attribute(
Attribute='description',
NetworkInterfaceId='eni-686ea200',
)
print(response)
Expected Output:
{
'Description': {
'Value': 'My description',
},
'NetworkInterfaceId': 'eni-686ea200',
'ResponseMetadata': {
'...': '...',
},
}
This example describes the groupSet attribute of the specified network interface.
response = client.describe_network_interface_attribute(
Attribute='groupSet',
NetworkInterfaceId='eni-686ea200',
)
print(response)
Expected Output:
{
'Groups': [
{
'GroupId': 'sg-903004f8',
'GroupName': 'my-security-group',
},
],
'NetworkInterfaceId': 'eni-686ea200',
'ResponseMetadata': {
'...': '...',
},
}
This example describes the sourceDestCheck attribute of the specified network interface.
response = client.describe_network_interface_attribute(
Attribute='sourceDestCheck',
NetworkInterfaceId='eni-686ea200',
)
print(response)
Expected Output:
{
'NetworkInterfaceId': 'eni-686ea200',
'SourceDestCheck': {
'Value': True,
},
'ResponseMetadata': {
'...': '...',
},
}
Describes the permissions for your network interfaces.
See also: AWS API Documentation
Request Syntax
response = client.describe_network_interface_permissions(
NetworkInterfacePermissionIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
NextToken='string',
MaxResults=123
)
One or more network interface permission IDs.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'NetworkInterfacePermissions': [
{
'NetworkInterfacePermissionId': 'string',
'NetworkInterfaceId': 'string',
'AwsAccountId': 'string',
'AwsService': 'string',
'Permission': 'INSTANCE-ATTACH'|'EIP-ASSOCIATE',
'PermissionState': {
'State': 'pending'|'granted'|'revoking'|'revoked',
'StatusMessage': 'string'
}
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the output for DescribeNetworkInterfacePermissions.
NetworkInterfacePermissions (list) --
The network interface permissions.
(dict) --
Describes a permission for a network interface.
NetworkInterfacePermissionId (string) --
The ID of the network interface permission.
NetworkInterfaceId (string) --
The ID of the network interface.
AwsAccountId (string) --
The AWS account ID.
AwsService (string) --
The AWS service.
Permission (string) --
The type of permission.
PermissionState (dict) --
Information about the state of the permission.
State (string) --
The state of the permission.
StatusMessage (string) --
A status message, if applicable.
NextToken (string) --
The token to use to retrieve the next page of results.
Describes one or more of your network interfaces.
See also: AWS API Documentation
Request Syntax
response = client.describe_network_interfaces(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
NetworkInterfaceIds=[
'string',
],
NextToken='string',
MaxResults=123
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more network interface IDs.
Default: Describes all your network interfaces.
dict
Response Syntax
{
'NetworkInterfaces': [
{
'Association': {
'AllocationId': 'string',
'AssociationId': 'string',
'IpOwnerId': 'string',
'PublicDnsName': 'string',
'PublicIp': 'string'
},
'Attachment': {
'AttachTime': datetime(2015, 1, 1),
'AttachmentId': 'string',
'DeleteOnTermination': True|False,
'DeviceIndex': 123,
'InstanceId': 'string',
'InstanceOwnerId': 'string',
'Status': 'attaching'|'attached'|'detaching'|'detached'
},
'AvailabilityZone': 'string',
'Description': 'string',
'Groups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'InterfaceType': 'interface'|'natGateway'|'efa',
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'MacAddress': 'string',
'NetworkInterfaceId': 'string',
'OwnerId': 'string',
'PrivateDnsName': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Association': {
'AllocationId': 'string',
'AssociationId': 'string',
'IpOwnerId': 'string',
'PublicDnsName': 'string',
'PublicIp': 'string'
},
'Primary': True|False,
'PrivateDnsName': 'string',
'PrivateIpAddress': 'string'
},
],
'RequesterId': 'string',
'RequesterManaged': True|False,
'SourceDestCheck': True|False,
'Status': 'available'|'associated'|'attaching'|'in-use'|'detaching',
'SubnetId': 'string',
'TagSet': [
{
'Key': 'string',
'Value': 'string'
},
],
'VpcId': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the output of DescribeNetworkInterfaces.
NetworkInterfaces (list) --
Information about one or more network interfaces.
(dict) --
Describes a network interface.
Association (dict) --
The association information for an Elastic IP address (IPv4) associated with the network interface.
AllocationId (string) --
The allocation ID.
AssociationId (string) --
The association ID.
IpOwnerId (string) --
The ID of the Elastic IP address owner.
PublicDnsName (string) --
The public DNS name.
PublicIp (string) --
The address of the Elastic IP address bound to the network interface.
Attachment (dict) --
The network interface attachment.
AttachTime (datetime) --
The timestamp indicating when the attachment initiated.
AttachmentId (string) --
The ID of the network interface attachment.
DeleteOnTermination (boolean) --
Indicates whether the network interface is deleted when the instance is terminated.
DeviceIndex (integer) --
The device index of the network interface attachment on the instance.
InstanceId (string) --
The ID of the instance.
InstanceOwnerId (string) --
The AWS account ID of the owner of the instance.
Status (string) --
The attachment state.
AvailabilityZone (string) --
The Availability Zone.
Description (string) --
A description.
Groups (list) --
Any security groups for the network interface.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
InterfaceType (string) --
The type of network interface.
Ipv6Addresses (list) --
The IPv6 addresses associated with the network interface.
(dict) --
Describes an IPv6 address associated with a network interface.
Ipv6Address (string) --
The IPv6 address.
MacAddress (string) --
The MAC address.
NetworkInterfaceId (string) --
The ID of the network interface.
OwnerId (string) --
The AWS account ID of the owner of the network interface.
PrivateDnsName (string) --
The private DNS name.
PrivateIpAddress (string) --
The IPv4 address of the network interface within the subnet.
PrivateIpAddresses (list) --
The private IPv4 addresses associated with the network interface.
(dict) --
Describes the private IPv4 address of a network interface.
Association (dict) --
The association information for an Elastic IP address (IPv4) associated with the network interface.
AllocationId (string) --
The allocation ID.
AssociationId (string) --
The association ID.
IpOwnerId (string) --
The ID of the Elastic IP address owner.
PublicDnsName (string) --
The public DNS name.
PublicIp (string) --
The address of the Elastic IP address bound to the network interface.
Primary (boolean) --
Indicates whether this IPv4 address is the primary private IPv4 address of the network interface.
PrivateDnsName (string) --
The private DNS name.
PrivateIpAddress (string) --
The private IPv4 address.
RequesterId (string) --
The ID of the entity that launched the instance on your behalf (for example, AWS Management Console or Auto Scaling).
RequesterManaged (boolean) --
Indicates whether the network interface is being managed by AWS.
SourceDestCheck (boolean) --
Indicates whether traffic to or from the instance is validated.
Status (string) --
The status of the network interface.
SubnetId (string) --
The ID of the subnet.
TagSet (list) --
Any tags assigned to the network interface.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VpcId (string) --
The ID of the VPC.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Examples
response = client.describe_network_interfaces(
NetworkInterfaceIds=[
'eni-e5aa89a3',
],
)
print(response)
Expected Output:
{
'NetworkInterfaces': [
{
'Association': {
'AssociationId': 'eipassoc-0fbb766a',
'IpOwnerId': '123456789012',
'PublicDnsName': 'ec2-203-0-113-12.compute-1.amazonaws.com',
'PublicIp': '203.0.113.12',
},
'Attachment': {
'AttachTime': datetime(2013, 11, 30, 23, 36, 42, 5, 334, 0),
'AttachmentId': 'eni-attach-66c4350a',
'DeleteOnTermination': False,
'DeviceIndex': 1,
'InstanceId': 'i-1234567890abcdef0',
'InstanceOwnerId': '123456789012',
'Status': 'attached',
},
'AvailabilityZone': 'us-east-1d',
'Description': 'my network interface',
'Groups': [
{
'GroupId': 'sg-8637d3e3',
'GroupName': 'default',
},
],
'MacAddress': '02:2f:8f:b0:cf:75',
'NetworkInterfaceId': 'eni-e5aa89a3',
'OwnerId': '123456789012',
'PrivateDnsName': 'ip-10-0-1-17.ec2.internal',
'PrivateIpAddress': '10.0.1.17',
'PrivateIpAddresses': [
{
'Association': {
'AssociationId': 'eipassoc-0fbb766a',
'IpOwnerId': '123456789012',
'PublicDnsName': 'ec2-203-0-113-12.compute-1.amazonaws.com',
'PublicIp': '203.0.113.12',
},
'Primary': True,
'PrivateDnsName': 'ip-10-0-1-17.ec2.internal',
'PrivateIpAddress': '10.0.1.17',
},
],
'RequesterManaged': False,
'SourceDestCheck': True,
'Status': 'in-use',
'SubnetId': 'subnet-b61f49f0',
'TagSet': [
],
'VpcId': 'vpc-a01106c2',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes the specified placement groups or all of your placement groups. For more information, see Placement Groups in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_placement_groups(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
GroupNames=[
'string',
]
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The names of the placement groups.
Default: Describes all your placement groups, or only those otherwise specified.
dict
Response Syntax
{
'PlacementGroups': [
{
'GroupName': 'string',
'State': 'pending'|'available'|'deleting'|'deleted',
'Strategy': 'cluster'|'spread'|'partition',
'PartitionCount': 123
},
]
}
Response Structure
(dict) --
PlacementGroups (list) --
Information about the placement groups.
(dict) --
Describes a placement group.
GroupName (string) --
The name of the placement group.
State (string) --
The state of the placement group.
Strategy (string) --
The placement strategy.
PartitionCount (integer) --
The number of partitions. Valid only if strategy is set to partition .
Describes available AWS services in a prefix list format, which includes the prefix list name and prefix list ID of the service and the IP address range for the service. A prefix list ID is required for creating an outbound security group rule that allows traffic from a VPC to access an AWS service through a gateway VPC endpoint. Currently, the services that support this action are Amazon S3 and Amazon DynamoDB.
See also: AWS API Documentation
Request Syntax
response = client.describe_prefix_lists(
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string',
PrefixListIds=[
'string',
]
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more prefix list IDs.
dict
Response Syntax
{
'NextToken': 'string',
'PrefixLists': [
{
'Cidrs': [
'string',
],
'PrefixListId': 'string',
'PrefixListName': 'string'
},
]
}
Response Structure
(dict) --
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
PrefixLists (list) --
All available prefix lists.
(dict) --
Describes prefixes for AWS services.
Cidrs (list) --
The IP address range of the AWS service.
PrefixListId (string) --
The ID of the prefix.
PrefixListName (string) --
The name of the prefix.
Describes the ID format settings for the root user and all IAM roles and IAM users that have explicitly specified a longer ID (17-character ID) preference.
By default, all IAM roles and IAM users default to the same ID settings as the root user, unless they explicitly override the settings. This request is useful for identifying those IAM users and IAM roles that have overridden the default ID settings.
The following resource types support longer IDs: bundle | conversion-task | customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association | export-task | flow-log | image | import-task | instance | internet-gateway | network-acl | network-acl-association | network-interface | network-interface-attachment | prefix-list | reservation | route-table | route-table-association | security-group | snapshot | subnet | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway .
See also: AWS API Documentation
Request Syntax
response = client.describe_principal_id_format(
DryRun=True|False,
Resources=[
'string',
],
MaxResults=123,
NextToken='string'
)
The type of resource: bundle | conversion-task | customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association | export-task | flow-log | image | import-task | instance | internet-gateway | network-acl | network-acl-association | network-interface | network-interface-attachment | prefix-list | reservation | route-table | route-table-association | security-group | snapshot | subnet | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway
dict
Response Syntax
{
'Principals': [
{
'Arn': 'string',
'Statuses': [
{
'Deadline': datetime(2015, 1, 1),
'Resource': 'string',
'UseLongIds': True|False
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Principals (list) --
Information about the ID format settings for the ARN.
(dict) --
PrincipalIdFormat description
Arn (string) --
PrincipalIdFormatARN description
Statuses (list) --
PrincipalIdFormatStatuses description
(dict) --
Describes the ID format for a resource.
Deadline (datetime) --
The date in UTC at which you are permanently switched over to using longer IDs. If a deadline is not yet available for this resource type, this field is not returned.
Resource (string) --
The type of resource.
UseLongIds (boolean) --
Indicates whether longer IDs (17-character IDs) are enabled for the resource.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes the specified IPv4 address pools.
See also: AWS API Documentation
Request Syntax
response = client.describe_public_ipv4_pools(
PoolIds=[
'string',
],
NextToken='string',
MaxResults=123
)
The IDs of the address pools.
dict
Response Syntax
{
'PublicIpv4Pools': [
{
'PoolId': 'string',
'Description': 'string',
'PoolAddressRanges': [
{
'FirstAddress': 'string',
'LastAddress': 'string',
'AddressCount': 123,
'AvailableAddressCount': 123
},
],
'TotalAddressCount': 123,
'TotalAvailableAddressCount': 123
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
PublicIpv4Pools (list) --
Information about the address pools.
(dict) --
Describes an address pool.
PoolId (string) --
The ID of the IPv4 address pool.
Description (string) --
A description of the address pool.
PoolAddressRanges (list) --
The address ranges.
(dict) --
Describes an address range of an IPv4 address pool.
FirstAddress (string) --
The first IP address in the range.
LastAddress (string) --
The last IP address in the range.
AddressCount (integer) --
The number of addresses in the range.
AvailableAddressCount (integer) --
The number of available addresses in the range.
TotalAddressCount (integer) --
The total number of addresses.
TotalAvailableAddressCount (integer) --
The total number of available addresses.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes the Regions that are currently available to you. The API returns a list of all the Regions, including Regions that are disabled for your account. For information about enabling Regions for your account, see Enabling and Disabling Regions in the AWS Billing and Cost Management User Guide .
For a list of the Regions supported by Amazon EC2, see Regions and Endpoints .
See also: AWS API Documentation
Request Syntax
response = client.describe_regions(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
RegionNames=[
'string',
],
DryRun=True|False
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The names of the Regions.
dict
Response Syntax
{
'Regions': [
{
'Endpoint': 'string',
'RegionName': 'string'
},
]
}
Response Structure
(dict) --
Regions (list) --
Information about the Regions.
(dict) --
Describes a Region.
Endpoint (string) --
The Region service endpoint.
RegionName (string) --
The name of the Region.
Examples
This example describes all the regions that are available to you.
response = client.describe_regions(
)
print(response)
Expected Output:
{
'Regions': [
{
'Endpoint': 'ec2.ap-south-1.amazonaws.com',
'RegionName': 'ap-south-1',
},
{
'Endpoint': 'ec2.eu-west-1.amazonaws.com',
'RegionName': 'eu-west-1',
},
{
'Endpoint': 'ec2.ap-southeast-1.amazonaws.com',
'RegionName': 'ap-southeast-1',
},
{
'Endpoint': 'ec2.ap-southeast-2.amazonaws.com',
'RegionName': 'ap-southeast-2',
},
{
'Endpoint': 'ec2.eu-central-1.amazonaws.com',
'RegionName': 'eu-central-1',
},
{
'Endpoint': 'ec2.ap-northeast-2.amazonaws.com',
'RegionName': 'ap-northeast-2',
},
{
'Endpoint': 'ec2.ap-northeast-1.amazonaws.com',
'RegionName': 'ap-northeast-1',
},
{
'Endpoint': 'ec2.us-east-1.amazonaws.com',
'RegionName': 'us-east-1',
},
{
'Endpoint': 'ec2.sa-east-1.amazonaws.com',
'RegionName': 'sa-east-1',
},
{
'Endpoint': 'ec2.us-west-1.amazonaws.com',
'RegionName': 'us-west-1',
},
{
'Endpoint': 'ec2.us-west-2.amazonaws.com',
'RegionName': 'us-west-2',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes one or more of the Reserved Instances that you purchased.
For more information about Reserved Instances, see Reserved Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_reserved_instances(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
OfferingClass='standard'|'convertible',
ReservedInstancesIds=[
'string',
],
DryRun=True|False,
OfferingType='Heavy Utilization'|'Medium Utilization'|'Light Utilization'|'No Upfront'|'Partial Upfront'|'All Upfront'
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more Reserved Instance IDs.
Default: Describes all your Reserved Instances, or only those otherwise specified.
dict
Response Syntax
{
'ReservedInstances': [
{
'AvailabilityZone': 'string',
'Duration': 123,
'End': datetime(2015, 1, 1),
'FixedPrice': ...,
'InstanceCount': 123,
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
'ReservedInstancesId': 'string',
'Start': datetime(2015, 1, 1),
'State': 'payment-pending'|'active'|'payment-failed'|'retired',
'UsagePrice': ...,
'CurrencyCode': 'USD',
'InstanceTenancy': 'default'|'dedicated'|'host',
'OfferingClass': 'standard'|'convertible',
'OfferingType': 'Heavy Utilization'|'Medium Utilization'|'Light Utilization'|'No Upfront'|'Partial Upfront'|'All Upfront',
'RecurringCharges': [
{
'Amount': 123.0,
'Frequency': 'Hourly'
},
],
'Scope': 'Availability Zone'|'Region',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
]
}
Response Structure
(dict) --
Contains the output for DescribeReservedInstances.
ReservedInstances (list) --
A list of Reserved Instances.
(dict) --
Describes a Reserved Instance.
AvailabilityZone (string) --
The Availability Zone in which the Reserved Instance can be used.
Duration (integer) --
The duration of the Reserved Instance, in seconds.
End (datetime) --
The time when the Reserved Instance expires.
FixedPrice (float) --
The purchase price of the Reserved Instance.
InstanceCount (integer) --
The number of reservations purchased.
InstanceType (string) --
The instance type on which the Reserved Instance can be used.
ProductDescription (string) --
The Reserved Instance product platform description.
ReservedInstancesId (string) --
The ID of the Reserved Instance.
Start (datetime) --
The date and time the Reserved Instance started.
State (string) --
The state of the Reserved Instance purchase.
UsagePrice (float) --
The usage price of the Reserved Instance, per hour.
CurrencyCode (string) --
The currency of the Reserved Instance. It's specified using ISO 4217 standard currency codes. At this time, the only supported currency is USD .
InstanceTenancy (string) --
The tenancy of the instance.
OfferingClass (string) --
The offering class of the Reserved Instance.
OfferingType (string) --
The Reserved Instance offering type.
RecurringCharges (list) --
The recurring charge tag assigned to the resource.
(dict) --
Describes a recurring charge.
Amount (float) --
The amount of the recurring charge.
Frequency (string) --
The frequency of the recurring charge.
Scope (string) --
The scope of the Reserved Instance.
Tags (list) --
Any tags assigned to the resource.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Describes your account's Reserved Instance listings in the Reserved Instance Marketplace.
The Reserved Instance Marketplace matches sellers who want to resell Reserved Instance capacity that they no longer need with buyers who want to purchase additional capacity. Reserved Instances bought and sold through the Reserved Instance Marketplace work like any other Reserved Instances.
As a seller, you choose to list some or all of your Reserved Instances, and you specify the upfront price to receive for them. Your Reserved Instances are then listed in the Reserved Instance Marketplace and are available for purchase.
As a buyer, you specify the configuration of the Reserved Instance to purchase, and the Marketplace matches what you're searching for with what's available. The Marketplace first sells the lowest priced Reserved Instances to you, and continues to sell available Reserved Instance listings to you until your demand is met. You are charged based on the total price of all of the listings that you purchase.
For more information, see Reserved Instance Marketplace in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_reserved_instances_listings(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
ReservedInstancesId='string',
ReservedInstancesListingId='string'
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'ReservedInstancesListings': [
{
'ClientToken': 'string',
'CreateDate': datetime(2015, 1, 1),
'InstanceCounts': [
{
'InstanceCount': 123,
'State': 'available'|'sold'|'cancelled'|'pending'
},
],
'PriceSchedules': [
{
'Active': True|False,
'CurrencyCode': 'USD',
'Price': 123.0,
'Term': 123
},
],
'ReservedInstancesId': 'string',
'ReservedInstancesListingId': 'string',
'Status': 'active'|'pending'|'cancelled'|'closed',
'StatusMessage': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'UpdateDate': datetime(2015, 1, 1)
},
]
}
Response Structure
(dict) --
Contains the output of DescribeReservedInstancesListings.
ReservedInstancesListings (list) --
Information about the Reserved Instance listing.
(dict) --
Describes a Reserved Instance listing.
ClientToken (string) --
A unique, case-sensitive key supplied by the client to ensure that the request is idempotent. For more information, see Ensuring Idempotency .
CreateDate (datetime) --
The time the listing was created.
InstanceCounts (list) --
The number of instances in this state.
(dict) --
Describes a Reserved Instance listing state.
InstanceCount (integer) --
The number of listed Reserved Instances in the state specified by the state .
State (string) --
The states of the listed Reserved Instances.
PriceSchedules (list) --
The price of the Reserved Instance listing.
(dict) --
Describes the price for a Reserved Instance.
Active (boolean) --
The current price schedule, as determined by the term remaining for the Reserved Instance in the listing.
A specific price schedule is always in effect, but only one price schedule can be active at any time. Take, for example, a Reserved Instance listing that has five months remaining in its term. When you specify price schedules for five months and two months, this means that schedule 1, covering the first three months of the remaining term, will be active during months 5, 4, and 3. Then schedule 2, covering the last two months of the term, will be active for months 2 and 1.
CurrencyCode (string) --
The currency for transacting the Reserved Instance resale. At this time, the only supported currency is USD .
Price (float) --
The fixed price for the term.
Term (integer) --
The number of months remaining in the reservation. For example, 2 is the second to the last month before the capacity reservation expires.
ReservedInstancesId (string) --
The ID of the Reserved Instance.
ReservedInstancesListingId (string) --
The ID of the Reserved Instance listing.
Status (string) --
The status of the Reserved Instance listing.
StatusMessage (string) --
The reason for the current status of the Reserved Instance listing. The response can be blank.
Tags (list) --
Any tags assigned to the resource.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
UpdateDate (datetime) --
The last modified timestamp of the listing.
Describes the modifications made to your Reserved Instances. If no parameter is specified, information about all your Reserved Instances modification requests is returned. If a modification ID is specified, only information about the specific modification is returned.
For more information, see Modifying Reserved Instances in the Amazon Elastic Compute Cloud User Guide.
See also: AWS API Documentation
Request Syntax
response = client.describe_reserved_instances_modifications(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
ReservedInstancesModificationIds=[
'string',
],
NextToken='string'
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
IDs for the submitted modification request.
dict
Response Syntax
{
'NextToken': 'string',
'ReservedInstancesModifications': [
{
'ClientToken': 'string',
'CreateDate': datetime(2015, 1, 1),
'EffectiveDate': datetime(2015, 1, 1),
'ModificationResults': [
{
'ReservedInstancesId': 'string',
'TargetConfiguration': {
'AvailabilityZone': 'string',
'InstanceCount': 123,
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'Platform': 'string',
'Scope': 'Availability Zone'|'Region'
}
},
],
'ReservedInstancesIds': [
{
'ReservedInstancesId': 'string'
},
],
'ReservedInstancesModificationId': 'string',
'Status': 'string',
'StatusMessage': 'string',
'UpdateDate': datetime(2015, 1, 1)
},
]
}
Response Structure
(dict) --
Contains the output of DescribeReservedInstancesModifications.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
ReservedInstancesModifications (list) --
The Reserved Instance modification information.
(dict) --
Describes a Reserved Instance modification.
ClientToken (string) --
A unique, case-sensitive key supplied by the client to ensure that the request is idempotent. For more information, see Ensuring Idempotency .
CreateDate (datetime) --
The time when the modification request was created.
EffectiveDate (datetime) --
The time for the modification to become effective.
ModificationResults (list) --
Contains target configurations along with their corresponding new Reserved Instance IDs.
(dict) --
Describes the modification request/s.
ReservedInstancesId (string) --
The ID for the Reserved Instances that were created as part of the modification request. This field is only available when the modification is fulfilled.
TargetConfiguration (dict) --
The target Reserved Instances configurations supplied as part of the modification request.
AvailabilityZone (string) --
The Availability Zone for the modified Reserved Instances.
InstanceCount (integer) --
The number of modified Reserved Instances.
Note
This is a required field for a request.
InstanceType (string) --
The instance type for the modified Reserved Instances.
Platform (string) --
The network platform of the modified Reserved Instances, which is either EC2-Classic or EC2-VPC.
Scope (string) --
Whether the Reserved Instance is applied to instances in a Region or instances in a specific Availability Zone.
ReservedInstancesIds (list) --
The IDs of one or more Reserved Instances.
(dict) --
Describes the ID of a Reserved Instance.
ReservedInstancesId (string) --
The ID of the Reserved Instance.
ReservedInstancesModificationId (string) --
A unique ID for the Reserved Instance modification.
Status (string) --
The status of the Reserved Instances modification request.
StatusMessage (string) --
The reason for the status.
UpdateDate (datetime) --
The time when the modification request was last updated.
Describes Reserved Instance offerings that are available for purchase. With Reserved Instances, you purchase the right to launch instances for a period of time. During that time period, you do not receive insufficient capacity errors, and you pay a lower usage rate than the rate charged for On-Demand instances for the actual time used.
If you have listed your own Reserved Instances for sale in the Reserved Instance Marketplace, they will be excluded from these results. This is to ensure that you do not purchase your own Reserved Instances.
For more information, see Reserved Instance Marketplace in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_reserved_instances_offerings(
AvailabilityZone='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
IncludeMarketplace=True|False,
InstanceType='t1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
MaxDuration=123,
MaxInstanceCount=123,
MinDuration=123,
OfferingClass='standard'|'convertible',
ProductDescription='Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
ReservedInstancesOfferingIds=[
'string',
],
DryRun=True|False,
InstanceTenancy='default'|'dedicated'|'host',
MaxResults=123,
NextToken='string',
OfferingType='Heavy Utilization'|'Medium Utilization'|'Light Utilization'|'No Upfront'|'Partial Upfront'|'All Upfront'
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The maximum duration (in seconds) to filter when searching for offerings.
Default: 94608000 (3 years)
The maximum number of instances to filter when searching for offerings.
Default: 20
The minimum duration (in seconds) to filter when searching for offerings.
Default: 2592000 (1 month)
One or more Reserved Instances offering IDs.
The tenancy of the instances covered by the reservation. A Reserved Instance with a tenancy of dedicated is applied to instances that run in a VPC on single-tenant hardware (i.e., Dedicated Instances).
Important: The host value cannot be used with this parameter. Use the default or dedicated values only.
Default: default
The maximum number of results to return for the request in a single page. The remaining results of the initial request can be seen by sending another request with the returned NextToken value. The maximum is 100.
Default: 100
dict
Response Syntax
{
'ReservedInstancesOfferings': [
{
'AvailabilityZone': 'string',
'Duration': 123,
'FixedPrice': ...,
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
'ReservedInstancesOfferingId': 'string',
'UsagePrice': ...,
'CurrencyCode': 'USD',
'InstanceTenancy': 'default'|'dedicated'|'host',
'Marketplace': True|False,
'OfferingClass': 'standard'|'convertible',
'OfferingType': 'Heavy Utilization'|'Medium Utilization'|'Light Utilization'|'No Upfront'|'Partial Upfront'|'All Upfront',
'PricingDetails': [
{
'Count': 123,
'Price': 123.0
},
],
'RecurringCharges': [
{
'Amount': 123.0,
'Frequency': 'Hourly'
},
],
'Scope': 'Availability Zone'|'Region'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the output of DescribeReservedInstancesOfferings.
ReservedInstancesOfferings (list) --
A list of Reserved Instances offerings.
(dict) --
Describes a Reserved Instance offering.
AvailabilityZone (string) --
The Availability Zone in which the Reserved Instance can be used.
Duration (integer) --
The duration of the Reserved Instance, in seconds.
FixedPrice (float) --
The purchase price of the Reserved Instance.
InstanceType (string) --
The instance type on which the Reserved Instance can be used.
ProductDescription (string) --
The Reserved Instance product platform description.
ReservedInstancesOfferingId (string) --
The ID of the Reserved Instance offering. This is the offering ID used in GetReservedInstancesExchangeQuote to confirm that an exchange can be made.
UsagePrice (float) --
The usage price of the Reserved Instance, per hour.
CurrencyCode (string) --
The currency of the Reserved Instance offering you are purchasing. It's specified using ISO 4217 standard currency codes. At this time, the only supported currency is USD .
InstanceTenancy (string) --
The tenancy of the instance.
Marketplace (boolean) --
Indicates whether the offering is available through the Reserved Instance Marketplace (resale) or AWS. If it's a Reserved Instance Marketplace offering, this is true .
OfferingClass (string) --
If convertible it can be exchanged for Reserved Instances of the same or higher monetary value, with different configurations. If standard , it is not possible to perform an exchange.
OfferingType (string) --
The Reserved Instance offering type.
PricingDetails (list) --
The pricing details of the Reserved Instance offering.
(dict) --
Describes a Reserved Instance offering.
Count (integer) --
The number of reservations available for the price.
Price (float) --
The price per instance.
RecurringCharges (list) --
The recurring charge tag assigned to the resource.
(dict) --
Describes a recurring charge.
Amount (float) --
The amount of the recurring charge.
Frequency (string) --
The frequency of the recurring charge.
Scope (string) --
Whether the Reserved Instance is applied to instances in a Region or an Availability Zone.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes one or more of your route tables.
Each subnet in your VPC must be associated with a route table. If a subnet is not explicitly associated with any route table, it is implicitly associated with the main route table. This command does not return the subnet ID for implicit associations.
For more information, see Route Tables in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_route_tables(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
RouteTableIds=[
'string',
],
NextToken='string',
MaxResults=123
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more route table IDs.
Default: Describes all your route tables.
dict
Response Syntax
{
'RouteTables': [
{
'Associations': [
{
'Main': True|False,
'RouteTableAssociationId': 'string',
'RouteTableId': 'string',
'SubnetId': 'string'
},
],
'PropagatingVgws': [
{
'GatewayId': 'string'
},
],
'RouteTableId': 'string',
'Routes': [
{
'DestinationCidrBlock': 'string',
'DestinationIpv6CidrBlock': 'string',
'DestinationPrefixListId': 'string',
'EgressOnlyInternetGatewayId': 'string',
'GatewayId': 'string',
'InstanceId': 'string',
'InstanceOwnerId': 'string',
'NatGatewayId': 'string',
'TransitGatewayId': 'string',
'NetworkInterfaceId': 'string',
'Origin': 'CreateRouteTable'|'CreateRoute'|'EnableVgwRoutePropagation',
'State': 'active'|'blackhole',
'VpcPeeringConnectionId': 'string'
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VpcId': 'string',
'OwnerId': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the output of DescribeRouteTables.
RouteTables (list) --
Information about one or more route tables.
(dict) --
Describes a route table.
Associations (list) --
The associations between the route table and one or more subnets.
(dict) --
Describes an association between a route table and a subnet.
Main (boolean) --
Indicates whether this is the main route table.
RouteTableAssociationId (string) --
The ID of the association between a route table and a subnet.
RouteTableId (string) --
The ID of the route table.
SubnetId (string) --
The ID of the subnet. A subnet ID is not returned for an implicit association.
PropagatingVgws (list) --
Any virtual private gateway (VGW) propagating routes.
(dict) --
Describes a virtual private gateway propagating route.
GatewayId (string) --
The ID of the virtual private gateway.
RouteTableId (string) --
The ID of the route table.
Routes (list) --
The routes in the route table.
(dict) --
Describes a route in a route table.
DestinationCidrBlock (string) --
The IPv4 CIDR block used for the destination match.
DestinationIpv6CidrBlock (string) --
The IPv6 CIDR block used for the destination match.
DestinationPrefixListId (string) --
The prefix of the AWS service.
EgressOnlyInternetGatewayId (string) --
The ID of the egress-only internet gateway.
GatewayId (string) --
The ID of a gateway attached to your VPC.
InstanceId (string) --
The ID of a NAT instance in your VPC.
InstanceOwnerId (string) --
The AWS account ID of the owner of the instance.
NatGatewayId (string) --
The ID of a NAT gateway.
TransitGatewayId (string) --
The ID of a transit gateway.
NetworkInterfaceId (string) --
The ID of the network interface.
Origin (string) --
Describes how the route was created.
State (string) --
The state of the route. The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, or the specified NAT instance has been terminated).
VpcPeeringConnectionId (string) --
The ID of a VPC peering connection.
Tags (list) --
Any tags assigned to the route table.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VpcId (string) --
The ID of the VPC.
OwnerId (string) --
The ID of the AWS account that owns the route table.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Examples
This example describes the specified route table.
response = client.describe_route_tables(
RouteTableIds=[
'rtb-1f382e7d',
],
)
print(response)
Expected Output:
{
'RouteTables': [
{
'Associations': [
{
'Main': True,
'RouteTableAssociationId': 'rtbassoc-d8ccddba',
'RouteTableId': 'rtb-1f382e7d',
},
],
'PropagatingVgws': [
],
'RouteTableId': 'rtb-1f382e7d',
'Routes': [
{
'DestinationCidrBlock': '10.0.0.0/16',
'GatewayId': 'local',
'State': 'active',
},
],
'Tags': [
],
'VpcId': 'vpc-a01106c2',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Finds available schedules that meet the specified criteria.
You can search for an available schedule no more than 3 months in advance. You must meet the minimum required duration of 1,200 hours per year. For example, the minimum daily schedule is 4 hours, the minimum weekly schedule is 24 hours, and the minimum monthly schedule is 100 hours.
After you find a schedule that meets your needs, call PurchaseScheduledInstances to purchase Scheduled Instances with that schedule.
See also: AWS API Documentation
Request Syntax
response = client.describe_scheduled_instance_availability(
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
FirstSlotStartTimeRange={
'EarliestTime': datetime(2015, 1, 1),
'LatestTime': datetime(2015, 1, 1)
},
MaxResults=123,
MaxSlotDurationInHours=123,
MinSlotDurationInHours=123,
NextToken='string',
Recurrence={
'Frequency': 'string',
'Interval': 123,
'OccurrenceDays': [
123,
],
'OccurrenceRelativeToEnd': True|False,
'OccurrenceUnit': 'string'
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
[REQUIRED]
The time period for the first schedule to start.
The earliest date and time, in UTC, for the Scheduled Instance to start.
The latest date and time, in UTC, for the Scheduled Instance to start. This value must be later than or equal to the earliest date and at most three months in the future.
[REQUIRED]
The schedule recurrence.
The frequency (Daily , Weekly , or Monthly ).
The interval quantity. The interval unit depends on the value of Frequency . For example, every 2 weeks or every 2 months.
The days. For a monthly schedule, this is one or more days of the month (1-31). For a weekly schedule, this is one or more days of the week (1-7, where 1 is Sunday). You can't specify this value with a daily schedule. If the occurrence is relative to the end of the month, you can specify only a single day.
Indicates whether the occurrence is relative to the end of the specified week or month. You can't specify this value with a daily schedule.
The unit for OccurrenceDays (DayOfWeek or DayOfMonth ). This value is required for a monthly schedule. You can't specify DayOfWeek with a weekly schedule. You can't specify this value with a daily schedule.
dict
Response Syntax
{
'NextToken': 'string',
'ScheduledInstanceAvailabilitySet': [
{
'AvailabilityZone': 'string',
'AvailableInstanceCount': 123,
'FirstSlotStartTime': datetime(2015, 1, 1),
'HourlyPrice': 'string',
'InstanceType': 'string',
'MaxTermDurationInDays': 123,
'MinTermDurationInDays': 123,
'NetworkPlatform': 'string',
'Platform': 'string',
'PurchaseToken': 'string',
'Recurrence': {
'Frequency': 'string',
'Interval': 123,
'OccurrenceDaySet': [
123,
],
'OccurrenceRelativeToEnd': True|False,
'OccurrenceUnit': 'string'
},
'SlotDurationInHours': 123,
'TotalScheduledInstanceHours': 123
},
]
}
Response Structure
(dict) --
Contains the output of DescribeScheduledInstanceAvailability.
NextToken (string) --
The token required to retrieve the next set of results. This value is null when there are no more results to return.
ScheduledInstanceAvailabilitySet (list) --
Information about the available Scheduled Instances.
(dict) --
Describes a schedule that is available for your Scheduled Instances.
AvailabilityZone (string) --
The Availability Zone.
AvailableInstanceCount (integer) --
The number of available instances.
FirstSlotStartTime (datetime) --
The time period for the first schedule to start.
HourlyPrice (string) --
The hourly price for a single instance.
InstanceType (string) --
The instance type. You can specify one of the C3, C4, M4, or R3 instance types.
MaxTermDurationInDays (integer) --
The maximum term. The only possible value is 365 days.
MinTermDurationInDays (integer) --
The minimum term. The only possible value is 365 days.
NetworkPlatform (string) --
The network platform (EC2-Classic or EC2-VPC ).
Platform (string) --
The platform (Linux/UNIX or Windows ).
PurchaseToken (string) --
The purchase token. This token expires in two hours.
Recurrence (dict) --
The schedule recurrence.
Frequency (string) --
The frequency (Daily , Weekly , or Monthly ).
Interval (integer) --
The interval quantity. The interval unit depends on the value of frequency . For example, every 2 weeks or every 2 months.
OccurrenceDaySet (list) --
The days. For a monthly schedule, this is one or more days of the month (1-31). For a weekly schedule, this is one or more days of the week (1-7, where 1 is Sunday).
OccurrenceRelativeToEnd (boolean) --
Indicates whether the occurrence is relative to the end of the specified week or month.
OccurrenceUnit (string) --
The unit for occurrenceDaySet (DayOfWeek or DayOfMonth ).
SlotDurationInHours (integer) --
The number of hours in the schedule.
TotalScheduledInstanceHours (integer) --
The total number of hours for a single instance for the entire term.
Examples
This example describes a schedule that occurs every week on Sunday, starting on the specified date. Note that the output contains a single schedule as an example.
response = client.describe_scheduled_instance_availability(
FirstSlotStartTimeRange={
'EarliestTime': datetime(2016, 1, 31, 0, 0, 0, 6, 31, 0),
'LatestTime': datetime(2016, 1, 31, 4, 0, 0, 6, 31, 0),
},
Recurrence={
'Frequency': 'Weekly',
'Interval': 1,
'OccurrenceDays': [
1,
],
},
)
print(response)
Expected Output:
{
'ScheduledInstanceAvailabilitySet': [
{
'AvailabilityZone': 'us-west-2b',
'AvailableInstanceCount': 20,
'FirstSlotStartTime': datetime(2016, 1, 31, 0, 0, 0, 6, 31, 0),
'HourlyPrice': '0.095',
'InstanceType': 'c4.large',
'MaxTermDurationInDays': 366,
'MinTermDurationInDays': 366,
'NetworkPlatform': 'EC2-VPC',
'Platform': 'Linux/UNIX',
'PurchaseToken': 'eyJ2IjoiMSIsInMiOjEsImMiOi...',
'Recurrence': {
'Frequency': 'Weekly',
'Interval': 1,
'OccurrenceDaySet': [
1,
],
'OccurrenceRelativeToEnd': False,
},
'SlotDurationInHours': 23,
'TotalScheduledInstanceHours': 1219,
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes the specified Scheduled Instances or all your Scheduled Instances.
See also: AWS API Documentation
Request Syntax
response = client.describe_scheduled_instances(
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string',
ScheduledInstanceIds=[
'string',
],
SlotStartTimeRange={
'EarliestTime': datetime(2015, 1, 1),
'LatestTime': datetime(2015, 1, 1)
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The Scheduled Instance IDs.
The time period for the first schedule to start.
The earliest date and time, in UTC, for the Scheduled Instance to start.
The latest date and time, in UTC, for the Scheduled Instance to start.
dict
Response Syntax
{
'NextToken': 'string',
'ScheduledInstanceSet': [
{
'AvailabilityZone': 'string',
'CreateDate': datetime(2015, 1, 1),
'HourlyPrice': 'string',
'InstanceCount': 123,
'InstanceType': 'string',
'NetworkPlatform': 'string',
'NextSlotStartTime': datetime(2015, 1, 1),
'Platform': 'string',
'PreviousSlotEndTime': datetime(2015, 1, 1),
'Recurrence': {
'Frequency': 'string',
'Interval': 123,
'OccurrenceDaySet': [
123,
],
'OccurrenceRelativeToEnd': True|False,
'OccurrenceUnit': 'string'
},
'ScheduledInstanceId': 'string',
'SlotDurationInHours': 123,
'TermEndDate': datetime(2015, 1, 1),
'TermStartDate': datetime(2015, 1, 1),
'TotalScheduledInstanceHours': 123
},
]
}
Response Structure
(dict) --
Contains the output of DescribeScheduledInstances.
NextToken (string) --
The token required to retrieve the next set of results. This value is null when there are no more results to return.
ScheduledInstanceSet (list) --
Information about the Scheduled Instances.
(dict) --
Describes a Scheduled Instance.
AvailabilityZone (string) --
The Availability Zone.
CreateDate (datetime) --
The date when the Scheduled Instance was purchased.
HourlyPrice (string) --
The hourly price for a single instance.
InstanceCount (integer) --
The number of instances.
InstanceType (string) --
The instance type.
NetworkPlatform (string) --
The network platform (EC2-Classic or EC2-VPC ).
NextSlotStartTime (datetime) --
The time for the next schedule to start.
Platform (string) --
The platform (Linux/UNIX or Windows ).
PreviousSlotEndTime (datetime) --
The time that the previous schedule ended or will end.
Recurrence (dict) --
The schedule recurrence.
Frequency (string) --
The frequency (Daily , Weekly , or Monthly ).
Interval (integer) --
The interval quantity. The interval unit depends on the value of frequency . For example, every 2 weeks or every 2 months.
OccurrenceDaySet (list) --
The days. For a monthly schedule, this is one or more days of the month (1-31). For a weekly schedule, this is one or more days of the week (1-7, where 1 is Sunday).
OccurrenceRelativeToEnd (boolean) --
Indicates whether the occurrence is relative to the end of the specified week or month.
OccurrenceUnit (string) --
The unit for occurrenceDaySet (DayOfWeek or DayOfMonth ).
ScheduledInstanceId (string) --
The Scheduled Instance ID.
SlotDurationInHours (integer) --
The number of hours in the schedule.
TermEndDate (datetime) --
The end date for the Scheduled Instance.
TermStartDate (datetime) --
The start date for the Scheduled Instance.
TotalScheduledInstanceHours (integer) --
The total number of hours for a single instance for the entire term.
Examples
This example describes the specified Scheduled Instance.
response = client.describe_scheduled_instances(
ScheduledInstanceIds=[
'sci-1234-1234-1234-1234-123456789012',
],
)
print(response)
Expected Output:
{
'ScheduledInstanceSet': [
{
'AvailabilityZone': 'us-west-2b',
'CreateDate': datetime(2016, 1, 25, 21, 43, 38, 0, 25, 0),
'HourlyPrice': '0.095',
'InstanceCount': 1,
'InstanceType': 'c4.large',
'NetworkPlatform': 'EC2-VPC',
'NextSlotStartTime': datetime(2016, 1, 31, 9, 0, 0, 6, 31, 0),
'Platform': 'Linux/UNIX',
'Recurrence': {
'Frequency': 'Weekly',
'Interval': 1,
'OccurrenceDaySet': [
1,
],
'OccurrenceRelativeToEnd': False,
'OccurrenceUnit': '',
},
'ScheduledInstanceId': 'sci-1234-1234-1234-1234-123456789012',
'SlotDurationInHours': 32,
'TermEndDate': datetime(2017, 1, 31, 9, 0, 0, 1, 31, 0),
'TermStartDate': datetime(2016, 1, 31, 9, 0, 0, 6, 31, 0),
'TotalScheduledInstanceHours': 1696,
},
],
'ResponseMetadata': {
'...': '...',
},
}
[VPC only] Describes the VPCs on the other side of a VPC peering connection that are referencing the security groups you've specified in this request.
See also: AWS API Documentation
Request Syntax
response = client.describe_security_group_references(
DryRun=True|False,
GroupId=[
'string',
]
)
[REQUIRED]
The IDs of the security groups in your account.
dict
Response Syntax
{
'SecurityGroupReferenceSet': [
{
'GroupId': 'string',
'ReferencingVpcId': 'string',
'VpcPeeringConnectionId': 'string'
},
]
}
Response Structure
(dict) --
SecurityGroupReferenceSet (list) --
Information about the VPCs with the referencing security groups.
(dict) --
Describes a VPC with a security group that references your security group.
GroupId (string) --
The ID of your security group.
ReferencingVpcId (string) --
The ID of the VPC with the referencing security group.
VpcPeeringConnectionId (string) --
The ID of the VPC peering connection.
Describes the specified security groups or all of your security groups.
A security group is for use with instances either in the EC2-Classic platform or in a specific VPC. For more information, see Amazon EC2 Security Groups in the Amazon Elastic Compute Cloud User Guide and Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_security_groups(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
GroupIds=[
'string',
],
GroupNames=[
'string',
],
DryRun=True|False,
NextToken='string',
MaxResults=123
)
The filters. If using multiple filters for rules, the results include security groups for which any combination of rules - not necessarily a single rule - match all filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The IDs of the security groups. Required for security groups in a nondefault VPC.
Default: Describes all your security groups.
[EC2-Classic and default VPC only] The names of the security groups. You can specify either the security group name or the security group ID. For security groups in a nondefault VPC, use the group-name filter to describe security groups by name.
Default: Describes all your security groups.
dict
Response Syntax
{
'SecurityGroups': [
{
'Description': 'string',
'GroupName': 'string',
'IpPermissions': [
{
'FromPort': 123,
'IpProtocol': 'string',
'IpRanges': [
{
'CidrIp': 'string',
'Description': 'string'
},
],
'Ipv6Ranges': [
{
'CidrIpv6': 'string',
'Description': 'string'
},
],
'PrefixListIds': [
{
'Description': 'string',
'PrefixListId': 'string'
},
],
'ToPort': 123,
'UserIdGroupPairs': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'PeeringStatus': 'string',
'UserId': 'string',
'VpcId': 'string',
'VpcPeeringConnectionId': 'string'
},
]
},
],
'OwnerId': 'string',
'GroupId': 'string',
'IpPermissionsEgress': [
{
'FromPort': 123,
'IpProtocol': 'string',
'IpRanges': [
{
'CidrIp': 'string',
'Description': 'string'
},
],
'Ipv6Ranges': [
{
'CidrIpv6': 'string',
'Description': 'string'
},
],
'PrefixListIds': [
{
'Description': 'string',
'PrefixListId': 'string'
},
],
'ToPort': 123,
'UserIdGroupPairs': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'PeeringStatus': 'string',
'UserId': 'string',
'VpcId': 'string',
'VpcPeeringConnectionId': 'string'
},
]
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VpcId': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
SecurityGroups (list) --
Information about the security groups.
(dict) --
Describes a security group
Description (string) --
A description of the security group.
GroupName (string) --
The name of the security group.
IpPermissions (list) --
The inbound rules associated with the security group.
(dict) --
Describes a set of permissions for a security group rule.
FromPort (integer) --
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
IpProtocol (string) --
The IP protocol name (tcp , udp , icmp , icmpv6 ) or number (see Protocol Numbers ).
[VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp , udp , icmp , or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp , udp , and icmp , you must specify a port range. For icmpv6 , the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
IpRanges (list) --
The IPv4 ranges.
(dict) --
Describes an IPv4 range.
CidrIp (string) --
The IPv4 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv4 address, use the /32 prefix length.
Description (string) --
A description for the security group rule that references this IPv4 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
Ipv6Ranges (list) --
[VPC only] The IPv6 ranges.
(dict) --
[EC2-VPC only] Describes an IPv6 range.
CidrIpv6 (string) --
The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv6 address, use the /128 prefix length.
Description (string) --
A description for the security group rule that references this IPv6 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
PrefixListIds (list) --
[VPC only] The prefix list IDs for an AWS service. With outbound rules, this is the AWS service to access through a VPC endpoint from instances associated with the security group.
(dict) --
Describes a prefix list ID.
Description (string) --
A description for the security group rule that references this prefix list ID.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
PrefixListId (string) --
The ID of the prefix.
ToPort (integer) --
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
UserIdGroupPairs (list) --
The security group and AWS account ID pairs.
(dict) --
Describes a security group and AWS account ID pair.
Description (string) --
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
GroupId (string) --
The ID of the security group.
GroupName (string) --
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
PeeringStatus (string) --
The status of a VPC peering connection, if applicable.
UserId (string) --
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
VpcId (string) --
The ID of the VPC for the referenced security group, if applicable.
VpcPeeringConnectionId (string) --
The ID of the VPC peering connection, if applicable.
OwnerId (string) --
The AWS account ID of the owner of the security group.
GroupId (string) --
The ID of the security group.
IpPermissionsEgress (list) --
[VPC only] The outbound rules associated with the security group.
(dict) --
Describes a set of permissions for a security group rule.
FromPort (integer) --
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
IpProtocol (string) --
The IP protocol name (tcp , udp , icmp , icmpv6 ) or number (see Protocol Numbers ).
[VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp , udp , icmp , or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp , udp , and icmp , you must specify a port range. For icmpv6 , the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
IpRanges (list) --
The IPv4 ranges.
(dict) --
Describes an IPv4 range.
CidrIp (string) --
The IPv4 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv4 address, use the /32 prefix length.
Description (string) --
A description for the security group rule that references this IPv4 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
Ipv6Ranges (list) --
[VPC only] The IPv6 ranges.
(dict) --
[EC2-VPC only] Describes an IPv6 range.
CidrIpv6 (string) --
The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv6 address, use the /128 prefix length.
Description (string) --
A description for the security group rule that references this IPv6 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
PrefixListIds (list) --
[VPC only] The prefix list IDs for an AWS service. With outbound rules, this is the AWS service to access through a VPC endpoint from instances associated with the security group.
(dict) --
Describes a prefix list ID.
Description (string) --
A description for the security group rule that references this prefix list ID.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
PrefixListId (string) --
The ID of the prefix.
ToPort (integer) --
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
UserIdGroupPairs (list) --
The security group and AWS account ID pairs.
(dict) --
Describes a security group and AWS account ID pair.
Description (string) --
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
GroupId (string) --
The ID of the security group.
GroupName (string) --
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
PeeringStatus (string) --
The status of a VPC peering connection, if applicable.
UserId (string) --
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
VpcId (string) --
The ID of the VPC for the referenced security group, if applicable.
VpcPeeringConnectionId (string) --
The ID of the VPC peering connection, if applicable.
Tags (list) --
Any tags assigned to the security group.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VpcId (string) --
[VPC only] The ID of the VPC for the security group.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes the specified attribute of the specified snapshot. You can specify only one attribute at a time.
For more information about EBS snapshots, see Amazon EBS Snapshots in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_snapshot_attribute(
Attribute='productCodes'|'createVolumePermission',
SnapshotId='string',
DryRun=True|False
)
[REQUIRED]
The snapshot attribute you would like to view.
[REQUIRED]
The ID of the EBS snapshot.
dict
Response Syntax
{
'CreateVolumePermissions': [
{
'Group': 'all',
'UserId': 'string'
},
],
'ProductCodes': [
{
'ProductCodeId': 'string',
'ProductCodeType': 'devpay'|'marketplace'
},
],
'SnapshotId': 'string'
}
Response Structure
(dict) --
Contains the output of DescribeSnapshotAttribute.
CreateVolumePermissions (list) --
The users and groups that have the permissions for creating volumes from the snapshot.
(dict) --
Describes the user or group to be added or removed from the list of create volume permissions for a volume.
Group (string) --
The group to be added or removed. The possible value is all .
UserId (string) --
The AWS account ID to be added or removed.
ProductCodes (list) --
The product codes.
(dict) --
Describes a product code.
ProductCodeId (string) --
The product code.
ProductCodeType (string) --
The type of product code.
SnapshotId (string) --
The ID of the EBS snapshot.
Examples
This example describes the createVolumePermission attribute on a snapshot with the snapshot ID of snap-066877671789bd71b.
response = client.describe_snapshot_attribute(
Attribute='createVolumePermission',
SnapshotId='snap-066877671789bd71b',
)
print(response)
Expected Output:
{
'CreateVolumePermissions': [
],
'SnapshotId': 'snap-066877671789bd71b',
'ResponseMetadata': {
'...': '...',
},
}
Describes the specified EBS snapshots available to you or all of the EBS snapshots available to you.
The snapshots available to you include public snapshots, private snapshots that you own, and private snapshots owned by other AWS accounts for which you have explicit create volume permissions.
The create volume permissions fall into the following categories:
The list of snapshots returned can be modified by specifying snapshot IDs, snapshot owners, or AWS accounts with create volume permissions. If no options are specified, Amazon EC2 returns all snapshots for which you have create volume permissions.
If you specify one or more snapshot IDs, only snapshots that have the specified IDs are returned. If you specify an invalid snapshot ID, an error is returned. If you specify a snapshot ID for which you do not have access, it is not included in the returned results.
If you specify one or more snapshot owners using the OwnerIds option, only snapshots from the specified owners and for which you have access are returned. The results can include the AWS account IDs of the specified owners, amazon for snapshots owned by Amazon, or self for snapshots that you own.
If you specify a list of restorable users, only snapshots with create snapshot permissions for those users are returned. You can specify AWS account IDs (if you own the snapshots), self for snapshots for which you own or have explicit permissions, or all for public snapshots.
If you are describing a long list of snapshots, you can paginate the output to make the list more manageable. The MaxResults parameter sets the maximum number of results returned in a single page. If the list of results exceeds your MaxResults value, then that number of results is returned along with a NextToken value that can be passed to a subsequent DescribeSnapshots request to retrieve the remaining results.
For more information about EBS snapshots, see Amazon EBS Snapshots in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_snapshots(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string',
OwnerIds=[
'string',
],
RestorableByUserIds=[
'string',
],
SnapshotIds=[
'string',
],
DryRun=True|False
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
Describes the snapshots owned by these owners.
The IDs of the AWS accounts that can create volumes from the snapshot.
The snapshot IDs.
Default: Describes the snapshots for which you have create volume permissions.
dict
Response Syntax
{
'Snapshots': [
{
'DataEncryptionKeyId': 'string',
'Description': 'string',
'Encrypted': True|False,
'KmsKeyId': 'string',
'OwnerId': 'string',
'Progress': 'string',
'SnapshotId': 'string',
'StartTime': datetime(2015, 1, 1),
'State': 'pending'|'completed'|'error',
'StateMessage': 'string',
'VolumeId': 'string',
'VolumeSize': 123,
'OwnerAlias': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Snapshots (list) --
Information about the snapshots.
(dict) --
Describes a snapshot.
DataEncryptionKeyId (string) --
The data encryption key identifier for the snapshot. This value is a unique identifier that corresponds to the data encryption key that was used to encrypt the original volume or snapshot copy. Because data encryption keys are inherited by volumes created from snapshots, and vice versa, if snapshots share the same data encryption key identifier, then they belong to the same volume/snapshot lineage. This parameter is only returned by DescribeSnapshots .
Description (string) --
The description for the snapshot.
Encrypted (boolean) --
Indicates whether the snapshot is encrypted.
KmsKeyId (string) --
The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the volume encryption key for the parent volume.
OwnerId (string) --
The AWS account ID of the EBS snapshot owner.
Progress (string) --
The progress of the snapshot, as a percentage.
SnapshotId (string) --
The ID of the snapshot. Each snapshot receives a unique identifier when it is created.
StartTime (datetime) --
The time stamp when the snapshot was initiated.
State (string) --
The snapshot state.
StateMessage (string) --
Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy operation fails (for example, if the proper AWS Key Management Service (AWS KMS) permissions are not obtained) this field displays error state details to help you diagnose why the error occurred. This parameter is only returned by DescribeSnapshots .
VolumeId (string) --
The ID of the volume that was used to create the snapshot. Snapshots created by the CopySnapshot action have an arbitrary volume ID that should not be used for any purpose.
VolumeSize (integer) --
The size of the volume, in GiB.
OwnerAlias (string) --
Value from an Amazon-maintained list (amazon | self | all | aws-marketplace | microsoft ) of snapshot owners. Not to be confused with the user-configured AWS account alias, which is set from the IAM console.
Tags (list) --
Any tags assigned to the snapshot.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
NextToken (string) --
The NextToken value to include in a future DescribeSnapshots request. When the results of a DescribeSnapshots request exceed MaxResults , this value can be used to retrieve the next page of results. This value is null when there are no more results to return.
Examples
This example describes a snapshot with the snapshot ID of snap-1234567890abcdef0.
response = client.describe_snapshots(
SnapshotIds=[
'snap-1234567890abcdef0',
],
)
print(response)
Expected Output:
{
'NextToken': '',
'Snapshots': [
{
'Description': 'This is my snapshot.',
'OwnerId': '012345678910',
'Progress': '100%',
'SnapshotId': 'snap-1234567890abcdef0',
'StartTime': datetime(2014, 2, 28, 21, 28, 32, 4, 59, 0),
'State': 'completed',
'VolumeId': 'vol-049df61146c4d7901',
'VolumeSize': 8,
},
],
'ResponseMetadata': {
'...': '...',
},
}
This example describes all snapshots owned by the ID 012345678910 that are in the pending status.
response = client.describe_snapshots(
Filters=[
{
'Name': 'status',
'Values': [
'pending',
],
},
],
OwnerIds=[
'012345678910',
],
)
print(response)
Expected Output:
{
'NextToken': '',
'Snapshots': [
{
'Description': 'This is my copied snapshot.',
'OwnerId': '012345678910',
'Progress': '87%',
'SnapshotId': 'snap-066877671789bd71b',
'StartTime': datetime(2014, 2, 28, 21, 37, 27, 4, 59, 0),
'State': 'pending',
'VolumeId': 'vol-1234567890abcdef0',
'VolumeSize': 8,
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes the data feed for Spot Instances. For more information, see Spot Instance Data Feed in the Amazon EC2 User Guide for Linux Instances .
See also: AWS API Documentation
Request Syntax
response = client.describe_spot_datafeed_subscription(
DryRun=True|False
)
{
'SpotDatafeedSubscription': {
'Bucket': 'string',
'Fault': {
'Code': 'string',
'Message': 'string'
},
'OwnerId': 'string',
'Prefix': 'string',
'State': 'Active'|'Inactive'
}
}
Response Structure
Contains the output of DescribeSpotDatafeedSubscription.
The Spot Instance data feed subscription.
The Amazon S3 bucket where the Spot Instance data feed is located.
The fault codes for the Spot Instance request, if any.
The reason code for the Spot Instance state change.
The message for the Spot Instance state change.
The AWS account ID of the account.
The prefix that is prepended to data feed files.
The state of the Spot Instance data feed subscription.
Examples
This example describes the Spot Instance datafeed subscription for your AWS account.
response = client.describe_spot_datafeed_subscription(
)
print(response)
Expected Output:
{
'SpotDatafeedSubscription': {
'Bucket': 'my-s3-bucket',
'OwnerId': '123456789012',
'Prefix': 'spotdata',
'State': 'Active',
},
'ResponseMetadata': {
'...': '...',
},
}
Describes the running instances for the specified Spot Fleet.
See also: AWS API Documentation
Request Syntax
response = client.describe_spot_fleet_instances(
DryRun=True|False,
MaxResults=123,
NextToken='string',
SpotFleetRequestId='string'
)
[REQUIRED]
The ID of the Spot Fleet request.
dict
Response Syntax
{
'ActiveInstances': [
{
'InstanceId': 'string',
'InstanceType': 'string',
'SpotInstanceRequestId': 'string',
'InstanceHealth': 'healthy'|'unhealthy'
},
],
'NextToken': 'string',
'SpotFleetRequestId': 'string'
}
Response Structure
(dict) --
Contains the output of DescribeSpotFleetInstances.
ActiveInstances (list) --
The running instances. This list is refreshed periodically and might be out of date.
(dict) --
Describes a running instance in a Spot Fleet.
InstanceId (string) --
The ID of the instance.
InstanceType (string) --
The instance type.
SpotInstanceRequestId (string) --
The ID of the Spot Instance request.
InstanceHealth (string) --
The health status of the instance. If the status of either the instance status check or the system status check is impaired , the health status of the instance is unhealthy . Otherwise, the health status is healthy .
NextToken (string) --
The token required to retrieve the next set of results. This value is null when there are no more results to return.
SpotFleetRequestId (string) --
The ID of the Spot Fleet request.
Examples
This example lists the Spot Instances associated with the specified Spot fleet.
response = client.describe_spot_fleet_instances(
SpotFleetRequestId='sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE',
)
print(response)
Expected Output:
{
'ActiveInstances': [
{
'InstanceId': 'i-1234567890abcdef0',
'InstanceType': 'm3.medium',
'SpotInstanceRequestId': 'sir-08b93456',
},
],
'SpotFleetRequestId': 'sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE',
'ResponseMetadata': {
'...': '...',
},
}
Describes the events for the specified Spot Fleet request during the specified time.
Spot Fleet events are delayed by up to 30 seconds before they can be described. This ensures that you can query by the last evaluated time and not miss a recorded event. Spot Fleet events are available for 48 hours.
See also: AWS API Documentation
Request Syntax
response = client.describe_spot_fleet_request_history(
DryRun=True|False,
EventType='instanceChange'|'fleetRequestChange'|'error'|'information',
MaxResults=123,
NextToken='string',
SpotFleetRequestId='string',
StartTime=datetime(2015, 1, 1)
)
[REQUIRED]
The ID of the Spot Fleet request.
[REQUIRED]
The starting date and time for the events, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).
dict
Response Syntax
{
'HistoryRecords': [
{
'EventInformation': {
'EventDescription': 'string',
'EventSubType': 'string',
'InstanceId': 'string'
},
'EventType': 'instanceChange'|'fleetRequestChange'|'error'|'information',
'Timestamp': datetime(2015, 1, 1)
},
],
'LastEvaluatedTime': datetime(2015, 1, 1),
'NextToken': 'string',
'SpotFleetRequestId': 'string',
'StartTime': datetime(2015, 1, 1)
}
Response Structure
(dict) --
Contains the output of DescribeSpotFleetRequestHistory.
HistoryRecords (list) --
Information about the events in the history of the Spot Fleet request.
(dict) --
Describes an event in the history of the Spot Fleet request.
EventInformation (dict) --
Information about the event.
EventDescription (string) --
The description of the event.
EventSubType (string) --
The event.
The following are the error events:
The following are the fleetRequestChange events:
The following are the instanceChange events:
The following are the Information events:
InstanceId (string) --
The ID of the instance. This information is available only for instanceChange events.
EventType (string) --
The event type.
Timestamp (datetime) --
The date and time of the event, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).
LastEvaluatedTime (datetime) --
The last date and time for the events, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). All records up to this time were retrieved.
If nextToken indicates that there are more results, this value is not present.
NextToken (string) --
The token required to retrieve the next set of results. This value is null when there are no more results to return.
SpotFleetRequestId (string) --
The ID of the Spot Fleet request.
StartTime (datetime) --
The starting date and time for the events, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).
Examples
This example returns the history for the specified Spot fleet starting at the specified time.
response = client.describe_spot_fleet_request_history(
SpotFleetRequestId='sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE',
StartTime=datetime(2015, 5, 26, 0, 0, 0, 1, 146, 0),
)
print(response)
Expected Output:
{
'HistoryRecords': [
{
'EventInformation': {
'EventSubType': 'submitted',
},
'EventType': 'fleetRequestChange',
'Timestamp': datetime(2015, 5, 26, 23, 17, 20, 1, 146, 0),
},
{
'EventInformation': {
'EventSubType': 'active',
},
'EventType': 'fleetRequestChange',
'Timestamp': datetime(2015, 5, 26, 23, 17, 20, 1, 146, 0),
},
{
'EventInformation': {
'EventSubType': 'launched',
'InstanceId': 'i-1234567890abcdef0',
},
'EventType': 'instanceChange',
'Timestamp': datetime(2015, 5, 26, 23, 21, 21, 1, 146, 0),
},
{
'EventInformation': {
'EventSubType': 'launched',
'InstanceId': 'i-1234567890abcdef1',
},
'EventType': 'instanceChange',
'Timestamp': datetime(2015, 5, 26, 23, 21, 21, 1, 146, 0),
},
],
'NextToken': 'CpHNsscimcV5oH7bSbub03CI2Qms5+ypNpNm+53MNlR0YcXAkp0xFlfKf91yVxSExmbtma3awYxMFzNA663ZskT0AHtJ6TCb2Z8bQC2EnZgyELbymtWPfpZ1ZbauVg+P+TfGlWxWWB/Vr5dk5d4LfdgA/DRAHUrYgxzrEXAMPLE=',
'SpotFleetRequestId': 'sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE',
'StartTime': datetime(2015, 5, 26, 0, 0, 0, 1, 146, 0),
'ResponseMetadata': {
'...': '...',
},
}
Describes your Spot Fleet requests.
Spot Fleet requests are deleted 48 hours after they are canceled and their instances are terminated.
See also: AWS API Documentation
Request Syntax
response = client.describe_spot_fleet_requests(
DryRun=True|False,
MaxResults=123,
NextToken='string',
SpotFleetRequestIds=[
'string',
]
)
The IDs of the Spot Fleet requests.
dict
Response Syntax
{
'NextToken': 'string',
'SpotFleetRequestConfigs': [
{
'ActivityStatus': 'error'|'pending_fulfillment'|'pending_termination'|'fulfilled',
'CreateTime': datetime(2015, 1, 1),
'SpotFleetRequestConfig': {
'AllocationStrategy': 'lowestPrice'|'diversified',
'OnDemandAllocationStrategy': 'lowestPrice'|'prioritized',
'ClientToken': 'string',
'ExcessCapacityTerminationPolicy': 'noTermination'|'default',
'FulfilledCapacity': 123.0,
'OnDemandFulfilledCapacity': 123.0,
'IamFleetRole': 'string',
'LaunchSpecifications': [
{
'SecurityGroups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'AddressingType': 'string',
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'Iops': 123,
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Encrypted': True|False,
'KmsKeyId': 'string'
},
'NoDevice': 'string'
},
],
'EbsOptimized': True|False,
'IamInstanceProfile': {
'Arn': 'string',
'Name': 'string'
},
'ImageId': 'string',
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'KernelId': 'string',
'KeyName': 'string',
'Monitoring': {
'Enabled': True|False
},
'NetworkInterfaces': [
{
'AssociatePublicIpAddress': True|False,
'DeleteOnTermination': True|False,
'Description': 'string',
'DeviceIndex': 123,
'Groups': [
'string',
],
'Ipv6AddressCount': 123,
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'NetworkInterfaceId': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
'SecondaryPrivateIpAddressCount': 123,
'SubnetId': 'string',
'InterfaceType': 'string'
},
],
'Placement': {
'AvailabilityZone': 'string',
'GroupName': 'string',
'Tenancy': 'default'|'dedicated'|'host'
},
'RamdiskId': 'string',
'SpotPrice': 'string',
'SubnetId': 'string',
'UserData': 'string',
'WeightedCapacity': 123.0,
'TagSpecifications': [
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
]
},
],
'LaunchTemplateConfigs': [
{
'LaunchTemplateSpecification': {
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'Version': 'string'
},
'Overrides': [
{
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'SpotPrice': 'string',
'SubnetId': 'string',
'AvailabilityZone': 'string',
'WeightedCapacity': 123.0,
'Priority': 123.0
},
]
},
],
'SpotPrice': 'string',
'TargetCapacity': 123,
'OnDemandTargetCapacity': 123,
'OnDemandMaxTotalPrice': 'string',
'SpotMaxTotalPrice': 'string',
'TerminateInstancesWithExpiration': True|False,
'Type': 'request'|'maintain'|'instant',
'ValidFrom': datetime(2015, 1, 1),
'ValidUntil': datetime(2015, 1, 1),
'ReplaceUnhealthyInstances': True|False,
'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate',
'LoadBalancersConfig': {
'ClassicLoadBalancersConfig': {
'ClassicLoadBalancers': [
{
'Name': 'string'
},
]
},
'TargetGroupsConfig': {
'TargetGroups': [
{
'Arn': 'string'
},
]
}
},
'InstancePoolsToUseCount': 123
},
'SpotFleetRequestId': 'string',
'SpotFleetRequestState': 'submitted'|'active'|'cancelled'|'failed'|'cancelled_running'|'cancelled_terminating'|'modifying'
},
]
}
Response Structure
(dict) --
Contains the output of DescribeSpotFleetRequests.
NextToken (string) --
The token required to retrieve the next set of results. This value is null when there are no more results to return.
SpotFleetRequestConfigs (list) --
Information about the configuration of your Spot Fleet.
(dict) --
Describes a Spot Fleet request.
ActivityStatus (string) --
The progress of the Spot Fleet request. If there is an error, the status is error . After all requests are placed, the status is pending_fulfillment . If the size of the fleet is equal to or greater than its target capacity, the status is fulfilled . If the size of the fleet is decreased, the status is pending_termination while Spot Instances are terminating.
CreateTime (datetime) --
The creation date and time of the request.
SpotFleetRequestConfig (dict) --
The configuration of the Spot Fleet request.
AllocationStrategy (string) --
Indicates how to allocate the target capacity across the Spot pools specified by the Spot Fleet request. The default is lowestPrice .
OnDemandAllocationStrategy (string) --
The order of the launch template overrides to use in fulfilling On-Demand capacity. If you specify lowestPrice , Spot Fleet uses price to determine the order, launching the lowest price first. If you specify prioritized , Spot Fleet uses the priority that you assign to each Spot Fleet launch template override, launching the highest priority first. If you do not specify a value, Spot Fleet defaults to lowestPrice .
ClientToken (string) --
A unique, case-sensitive identifier that you provide to ensure the idempotency of your listings. This helps to avoid duplicate listings. For more information, see Ensuring Idempotency .
ExcessCapacityTerminationPolicy (string) --
Indicates whether running Spot Instances should be terminated if you decrease the target capacity of the Spot Fleet request below the current size of the Spot Fleet.
FulfilledCapacity (float) --
The number of units fulfilled by this request compared to the set target capacity. You cannot set this value.
OnDemandFulfilledCapacity (float) --
The number of On-Demand units fulfilled by this request compared to the set target On-Demand capacity.
IamFleetRole (string) --
The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) role that grants the Spot Fleet the permission to request, launch, terminate, and tag instances on your behalf. For more information, see Spot Fleet Prerequisites in the Amazon EC2 User Guide for Linux Instances . Spot Fleet can terminate Spot Instances on your behalf when you cancel its Spot Fleet request using CancelSpotFleetRequests or when the Spot Fleet request expires, if you set TerminateInstancesWithExpiration .
LaunchSpecifications (list) --
The launch specifications for the Spot Fleet request. If you specify LaunchSpecifications , you can't specify LaunchTemplateConfigs . If you include On-Demand capacity in your request, you must use LaunchTemplateConfigs .
(dict) --
Describes the launch specification for one or more Spot Instances. If you include On-Demand capacity in your fleet request, you can't use SpotFleetLaunchSpecification ; you must use LaunchTemplateConfig .
SecurityGroups (list) --
One or more security groups. When requesting instances in a VPC, you must specify the IDs of the security groups. When requesting instances in EC2-Classic, you can specify the names or the IDs of the security groups.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
AddressingType (string) --
Deprecated.
BlockDeviceMappings (list) --
One or more block devices that are mapped to the Spot instances. You can't specify both a snapshot ID and an encryption value. This is because only blank volumes can be encrypted on creation. If a snapshot is the basis for a volume, it is not blank and its encryption status is used for the volume encryption status.
(dict) --
Describes a block device mapping.
DeviceName (string) --
The device name (for example, /dev/sdh or xvdh ).
VirtualName (string) --
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Ebs (dict) --
Parameters used to automatically set up EBS volumes when the instance is launched.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports. For io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
SnapshotId (string) --
The ID of the snapshot.
VolumeSize (integer) --
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Constraints: 1-16384 for General Purpose SSD (gp2 ), 4-16384 for Provisioned IOPS SSD (io1 ), 500-16384 for Throughput Optimized HDD (st1 ), 500-16384 for Cold HDD (sc1 ), and 1-1024 for Magnetic (standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
VolumeType (string) --
The volume type. If you set the type to io1 , you must also set the Iops property.
Default: standard
Encrypted (boolean) --
Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
In no case can you remove encryption from an encrypted volume.
Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
KmsKeyId (string) --
Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is encrypted.
This parameter is only supported on BlockDeviceMapping objects called by RunInstances , RequestSpotFleet , and RequestSpotInstances .
NoDevice (string) --
Suppresses the specified device included in the block device mapping of the AMI.
EbsOptimized (boolean) --
Indicates whether the instances are optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.
Default: false
IamInstanceProfile (dict) --
The IAM instance profile.
Arn (string) --
The Amazon Resource Name (ARN) of the instance profile.
Name (string) --
The name of the instance profile.
ImageId (string) --
The ID of the AMI.
InstanceType (string) --
The instance type.
KernelId (string) --
The ID of the kernel.
KeyName (string) --
The name of the key pair.
Monitoring (dict) --
Enable or disable monitoring for the instances.
Enabled (boolean) --
Enables monitoring for the instance.
Default: false
NetworkInterfaces (list) --
One or more network interfaces. If you specify a network interface, you must specify subnet IDs and security group IDs using the network interface.
(dict) --
Describes a network interface.
AssociatePublicIpAddress (boolean) --
Indicates whether to assign a public IPv4 address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is true .
DeleteOnTermination (boolean) --
If set to true , the interface is deleted when the instance is terminated. You can specify true only if creating a new network interface when launching an instance.
Description (string) --
The description of the network interface. Applies only if creating a network interface when launching an instance.
DeviceIndex (integer) --
The position of the network interface in the attachment order. A primary network interface has a device index of 0.
If you specify a network interface when launching an instance, you must specify the device index.
Groups (list) --
The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.
Ipv6AddressCount (integer) --
A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.
Ipv6Addresses (list) --
One or more IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.
(dict) --
Describes an IPv6 address.
Ipv6Address (string) --
The IPv6 address.
NetworkInterfaceId (string) --
The ID of the network interface.
PrivateIpAddress (string) --
The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance. You cannot specify this option if you're launching more than one instance in a RunInstances request.
PrivateIpAddresses (list) --
One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you're launching more than one instance in a RunInstances request.
(dict) --
Describes a secondary private IPv4 address for a network interface.
Primary (boolean) --
Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.
PrivateIpAddress (string) --
The private IPv4 addresses.
SecondaryPrivateIpAddressCount (integer) --
The number of secondary private IPv4 addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you're launching more than one instance in a RunInstances request.
SubnetId (string) --
The ID of the subnet associated with the network string. Applies only if creating a network interface when launching an instance.
InterfaceType (string) --
The type of network interface. To create an Elastic Fabric Adapter (EFA), specify efa . For more information, see Elastic Fabric Adapter in the Amazon Elastic Compute Cloud User Guide .
If you are not creating an EFA, specify interface or omit this parameter.
Valid values: interface | efa
Placement (dict) --
The placement information.
AvailabilityZone (string) --
The Availability Zone.
[Spot Fleet only] To specify multiple Availability Zones, separate them using commas; for example, "us-west-2a, us-west-2b".
GroupName (string) --
The name of the placement group.
Tenancy (string) --
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for Spot Instances.
RamdiskId (string) --
The ID of the RAM disk. Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, refer to the AWS Resource Center and search for the kernel ID.
SpotPrice (string) --
The maximum price per unit hour that you are willing to pay for a Spot Instance. If this value is not specified, the default is the Spot price specified for the fleet. To determine the Spot price per unit hour, divide the Spot price by the value of WeightedCapacity .
SubnetId (string) --
The ID of the subnet in which to launch the instances. To specify multiple subnets, separate them using commas; for example, "subnet-a61dafcf, subnet-65ea5f08".
UserData (string) --
The Base64-encoded user data that instances use when starting up.
WeightedCapacity (float) --
The number of units provided by the specified instance type. These are the same units that you chose to set the target capacity in terms of instances, or a performance characteristic such as vCPUs, memory, or I/O.
If the target capacity divided by this value is not a whole number, Amazon EC2 rounds the number of instances to the next whole number. If this value is not specified, the default is 1.
TagSpecifications (list) --
The tags to apply during creation.
(dict) --
The tags for a Spot Fleet resource.
ResourceType (string) --
The type of resource. Currently, the only resource type that is supported is instance .
Tags (list) --
The tags.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
LaunchTemplateConfigs (list) --
The launch template and overrides. If you specify LaunchTemplateConfigs , you can't specify LaunchSpecifications . If you include On-Demand capacity in your request, you must use LaunchTemplateConfigs .
(dict) --
Describes a launch template and overrides.
LaunchTemplateSpecification (dict) --
The launch template.
LaunchTemplateId (string) --
The ID of the launch template. You must specify either a template ID or a template name.
LaunchTemplateName (string) --
The name of the launch template. You must specify either a template name or a template ID.
Version (string) --
The version number of the launch template. You must specify a version number.
Overrides (list) --
Any parameters that you specify override the same parameters in the launch template.
(dict) --
Describes overrides for a launch template.
InstanceType (string) --
The instance type.
SpotPrice (string) --
The maximum price per unit hour that you are willing to pay for a Spot Instance.
SubnetId (string) --
The ID of the subnet in which to launch the instances.
AvailabilityZone (string) --
The Availability Zone in which to launch the instances.
WeightedCapacity (float) --
The number of units provided by the specified instance type.
Priority (float) --
The priority for the launch template override. If OnDemandAllocationStrategy is set to prioritized , Spot Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity. The highest priority is launched first. Valid values are whole numbers starting at 0 . The lower the number, the higher the priority. If no number is set, the launch template override has the lowest priority.
SpotPrice (string) --
The maximum price per unit hour that you are willing to pay for a Spot Instance. The default is the On-Demand price.
TargetCapacity (integer) --
The number of units to request for the Spot Fleet. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is maintain , you can specify a target capacity of 0 and add capacity later.
OnDemandTargetCapacity (integer) --
The number of On-Demand units to request. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is maintain , you can specify a target capacity of 0 and add capacity later.
OnDemandMaxTotalPrice (string) --
The maximum amount per hour for On-Demand Instances that you're willing to pay. You can use the onDemandMaxTotalPrice parameter, the spotMaxTotalPrice parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you're willing to pay. When the maximum amount you're willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.
SpotMaxTotalPrice (string) --
The maximum amount per hour for Spot Instances that you're willing to pay. You can use the spotdMaxTotalPrice parameter, the onDemandMaxTotalPrice parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you're willing to pay. When the maximum amount you're willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.
TerminateInstancesWithExpiration (boolean) --
Indicates whether running Spot Instances are terminated when the Spot Fleet request expires.
Type (string) --
The type of request. Indicates whether the Spot Fleet only requests the target capacity or also attempts to maintain it. When this value is request , the Spot Fleet only places the required requests. It does not attempt to replenish Spot Instances if capacity is diminished, nor does it submit requests in alternative Spot pools if capacity is not available. When this value is maintain , the Spot Fleet maintains the target capacity. The Spot Fleet places the required requests to meet capacity and automatically replenishes any interrupted instances. Default: maintain . instant is listed but is not used by Spot Fleet.
ValidFrom (datetime) --
The start date and time of the request, in UTC format (YYYY -MM -DD T*HH* :MM :SS Z). By default, Amazon EC2 starts fulfilling the request immediately.
ValidUntil (datetime) --
The end date and time of the request, in UTC format (YYYY -MM -DD T*HH* :MM :SS Z). After the end date and time, no new Spot Instance requests are placed or able to fulfill the request. If no value is specified, the Spot Fleet request remains until you cancel it.
ReplaceUnhealthyInstances (boolean) --
Indicates whether Spot Fleet should replace unhealthy instances.
InstanceInterruptionBehavior (string) --
The behavior when a Spot Instance is interrupted. The default is terminate .
LoadBalancersConfig (dict) --
One or more Classic Load Balancers and target groups to attach to the Spot Fleet request. Spot Fleet registers the running Spot Instances with the specified Classic Load Balancers and target groups.
With Network Load Balancers, Spot Fleet cannot register instances that have the following instance types: C1, CC1, CC2, CG1, CG2, CR1, CS1, G1, G2, HI1, HS1, M1, M2, M3, and T1.
ClassicLoadBalancersConfig (dict) --
The Classic Load Balancers.
ClassicLoadBalancers (list) --
One or more Classic Load Balancers.
(dict) --
Describes a Classic Load Balancer.
Name (string) --
The name of the load balancer.
TargetGroupsConfig (dict) --
The target groups.
TargetGroups (list) --
One or more target groups.
(dict) --
Describes a load balancer target group.
Arn (string) --
The Amazon Resource Name (ARN) of the target group.
InstancePoolsToUseCount (integer) --
The number of Spot pools across which to allocate your target Spot capacity. Valid only when Spot AllocationStrategy is set to lowest-price . Spot Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify.
SpotFleetRequestId (string) --
The ID of the Spot Fleet request.
SpotFleetRequestState (string) --
The state of the Spot Fleet request.
Examples
This example describes the specified Spot fleet request.
response = client.describe_spot_fleet_requests(
SpotFleetRequestIds=[
'sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE',
],
)
print(response)
Expected Output:
{
'SpotFleetRequestConfigs': [
{
'SpotFleetRequestConfig': {
'IamFleetRole': 'arn:aws:iam::123456789012:role/my-spot-fleet-role',
'LaunchSpecifications': [
{
'EbsOptimized': False,
'ImageId': 'ami-1a2b3c4d',
'InstanceType': 'cc2.8xlarge',
'NetworkInterfaces': [
{
'AssociatePublicIpAddress': True,
'DeleteOnTermination': False,
'DeviceIndex': 0,
'SecondaryPrivateIpAddressCount': 0,
'SubnetId': 'subnet-a61dafcf',
},
],
},
{
'EbsOptimized': False,
'ImageId': 'ami-1a2b3c4d',
'InstanceType': 'r3.8xlarge',
'NetworkInterfaces': [
{
'AssociatePublicIpAddress': True,
'DeleteOnTermination': False,
'DeviceIndex': 0,
'SecondaryPrivateIpAddressCount': 0,
'SubnetId': 'subnet-a61dafcf',
},
],
},
],
'SpotPrice': '0.05',
'TargetCapacity': 20,
},
'SpotFleetRequestId': 'sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE',
'SpotFleetRequestState': 'active',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes the specified Spot Instance requests.
You can use DescribeSpotInstanceRequests to find a running Spot Instance by examining the response. If the status of the Spot Instance is fulfilled , the instance ID appears in the response and contains the identifier of the instance. Alternatively, you can use DescribeInstances with a filter to look for instances where the instance lifecycle is spot .
We recommend that you set MaxResults to a value between 5 and 1000 to limit the number of results returned. This paginates the output, which makes the list more manageable and returns the results faster. If the list of results exceeds your MaxResults value, then that number of results is returned along with a NextToken value that can be passed to a subsequent DescribeSpotInstanceRequests request to retrieve the remaining results.
Spot Instance requests are deleted four hours after they are canceled and their instances are terminated.
See also: AWS API Documentation
Request Syntax
response = client.describe_spot_instance_requests(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
SpotInstanceRequestIds=[
'string',
],
NextToken='string',
MaxResults=123
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more Spot Instance request IDs.
dict
Response Syntax
{
'SpotInstanceRequests': [
{
'ActualBlockHourlyPrice': 'string',
'AvailabilityZoneGroup': 'string',
'BlockDurationMinutes': 123,
'CreateTime': datetime(2015, 1, 1),
'Fault': {
'Code': 'string',
'Message': 'string'
},
'InstanceId': 'string',
'LaunchGroup': 'string',
'LaunchSpecification': {
'UserData': 'string',
'SecurityGroups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'AddressingType': 'string',
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'Iops': 123,
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Encrypted': True|False,
'KmsKeyId': 'string'
},
'NoDevice': 'string'
},
],
'EbsOptimized': True|False,
'IamInstanceProfile': {
'Arn': 'string',
'Name': 'string'
},
'ImageId': 'string',
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'KernelId': 'string',
'KeyName': 'string',
'NetworkInterfaces': [
{
'AssociatePublicIpAddress': True|False,
'DeleteOnTermination': True|False,
'Description': 'string',
'DeviceIndex': 123,
'Groups': [
'string',
],
'Ipv6AddressCount': 123,
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'NetworkInterfaceId': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
'SecondaryPrivateIpAddressCount': 123,
'SubnetId': 'string',
'InterfaceType': 'string'
},
],
'Placement': {
'AvailabilityZone': 'string',
'GroupName': 'string',
'Tenancy': 'default'|'dedicated'|'host'
},
'RamdiskId': 'string',
'SubnetId': 'string',
'Monitoring': {
'Enabled': True|False
}
},
'LaunchedAvailabilityZone': 'string',
'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
'SpotInstanceRequestId': 'string',
'SpotPrice': 'string',
'State': 'open'|'active'|'closed'|'cancelled'|'failed',
'Status': {
'Code': 'string',
'Message': 'string',
'UpdateTime': datetime(2015, 1, 1)
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'Type': 'one-time'|'persistent',
'ValidFrom': datetime(2015, 1, 1),
'ValidUntil': datetime(2015, 1, 1),
'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the output of DescribeSpotInstanceRequests.
SpotInstanceRequests (list) --
One or more Spot Instance requests.
(dict) --
Describes a Spot Instance request.
ActualBlockHourlyPrice (string) --
If you specified a duration and your Spot Instance request was fulfilled, this is the fixed hourly price in effect for the Spot Instance while it runs.
AvailabilityZoneGroup (string) --
The Availability Zone group. If you specify the same Availability Zone group for all Spot Instance requests, all Spot Instances are launched in the same Availability Zone.
BlockDurationMinutes (integer) --
The duration for the Spot Instance, in minutes.
CreateTime (datetime) --
The date and time when the Spot Instance request was created, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).
Fault (dict) --
The fault codes for the Spot Instance request, if any.
Code (string) --
The reason code for the Spot Instance state change.
Message (string) --
The message for the Spot Instance state change.
InstanceId (string) --
The instance ID, if an instance has been launched to fulfill the Spot Instance request.
LaunchGroup (string) --
The instance launch group. Launch groups are Spot Instances that launch together and terminate together.
LaunchSpecification (dict) --
Additional information for launching instances.
UserData (string) --
The Base64-encoded user data for the instance.
SecurityGroups (list) --
One or more security groups. When requesting instances in a VPC, you must specify the IDs of the security groups. When requesting instances in EC2-Classic, you can specify the names or the IDs of the security groups.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
AddressingType (string) --
Deprecated.
BlockDeviceMappings (list) --
One or more block device mapping entries.
(dict) --
Describes a block device mapping.
DeviceName (string) --
The device name (for example, /dev/sdh or xvdh ).
VirtualName (string) --
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Ebs (dict) --
Parameters used to automatically set up EBS volumes when the instance is launched.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports. For io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
SnapshotId (string) --
The ID of the snapshot.
VolumeSize (integer) --
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Constraints: 1-16384 for General Purpose SSD (gp2 ), 4-16384 for Provisioned IOPS SSD (io1 ), 500-16384 for Throughput Optimized HDD (st1 ), 500-16384 for Cold HDD (sc1 ), and 1-1024 for Magnetic (standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
VolumeType (string) --
The volume type. If you set the type to io1 , you must also set the Iops property.
Default: standard
Encrypted (boolean) --
Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
In no case can you remove encryption from an encrypted volume.
Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
KmsKeyId (string) --
Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is encrypted.
This parameter is only supported on BlockDeviceMapping objects called by RunInstances , RequestSpotFleet , and RequestSpotInstances .
NoDevice (string) --
Suppresses the specified device included in the block device mapping of the AMI.
EbsOptimized (boolean) --
Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.
Default: false
IamInstanceProfile (dict) --
The IAM instance profile.
Arn (string) --
The Amazon Resource Name (ARN) of the instance profile.
Name (string) --
The name of the instance profile.
ImageId (string) --
The ID of the AMI.
InstanceType (string) --
The instance type.
KernelId (string) --
The ID of the kernel.
KeyName (string) --
The name of the key pair.
NetworkInterfaces (list) --
One or more network interfaces. If you specify a network interface, you must specify subnet IDs and security group IDs using the network interface.
(dict) --
Describes a network interface.
AssociatePublicIpAddress (boolean) --
Indicates whether to assign a public IPv4 address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is true .
DeleteOnTermination (boolean) --
If set to true , the interface is deleted when the instance is terminated. You can specify true only if creating a new network interface when launching an instance.
Description (string) --
The description of the network interface. Applies only if creating a network interface when launching an instance.
DeviceIndex (integer) --
The position of the network interface in the attachment order. A primary network interface has a device index of 0.
If you specify a network interface when launching an instance, you must specify the device index.
Groups (list) --
The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.
Ipv6AddressCount (integer) --
A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.
Ipv6Addresses (list) --
One or more IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.
(dict) --
Describes an IPv6 address.
Ipv6Address (string) --
The IPv6 address.
NetworkInterfaceId (string) --
The ID of the network interface.
PrivateIpAddress (string) --
The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance. You cannot specify this option if you're launching more than one instance in a RunInstances request.
PrivateIpAddresses (list) --
One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you're launching more than one instance in a RunInstances request.
(dict) --
Describes a secondary private IPv4 address for a network interface.
Primary (boolean) --
Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.
PrivateIpAddress (string) --
The private IPv4 addresses.
SecondaryPrivateIpAddressCount (integer) --
The number of secondary private IPv4 addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you're launching more than one instance in a RunInstances request.
SubnetId (string) --
The ID of the subnet associated with the network string. Applies only if creating a network interface when launching an instance.
InterfaceType (string) --
The type of network interface. To create an Elastic Fabric Adapter (EFA), specify efa . For more information, see Elastic Fabric Adapter in the Amazon Elastic Compute Cloud User Guide .
If you are not creating an EFA, specify interface or omit this parameter.
Valid values: interface | efa
Placement (dict) --
The placement information for the instance.
AvailabilityZone (string) --
The Availability Zone.
[Spot Fleet only] To specify multiple Availability Zones, separate them using commas; for example, "us-west-2a, us-west-2b".
GroupName (string) --
The name of the placement group.
Tenancy (string) --
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for Spot Instances.
RamdiskId (string) --
The ID of the RAM disk.
SubnetId (string) --
The ID of the subnet in which to launch the instance.
Monitoring (dict) --
Describes the monitoring of an instance.
Enabled (boolean) --
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
LaunchedAvailabilityZone (string) --
The Availability Zone in which the request is launched.
ProductDescription (string) --
The product description associated with the Spot Instance.
SpotInstanceRequestId (string) --
The ID of the Spot Instance request.
SpotPrice (string) --
The maximum price per hour that you are willing to pay for a Spot Instance.
State (string) --
The state of the Spot Instance request. Spot status information helps track your Spot Instance requests. For more information, see Spot Status in the Amazon EC2 User Guide for Linux Instances .
Status (dict) --
The status code and status message describing the Spot Instance request.
Code (string) --
The status code. For a list of status codes, see Spot Status Codes in the Amazon EC2 User Guide for Linux Instances .
Message (string) --
The description for the status code.
UpdateTime (datetime) --
The date and time of the most recent status update, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).
Tags (list) --
Any tags assigned to the resource.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Type (string) --
The Spot Instance request type.
ValidFrom (datetime) --
The start date of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). The request becomes active at this date and time.
ValidUntil (datetime) --
The end date of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). If this is a one-time request, it remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date is reached. The default end date is 7 days from the current date.
InstanceInterruptionBehavior (string) --
The behavior when a Spot Instance is interrupted.
NextToken (string) --
The token to use to retrieve the next set of results. This value is null when there are no more results to return.
Examples
This example describes the specified Spot Instance request.
response = client.describe_spot_instance_requests(
SpotInstanceRequestIds=[
'sir-08b93456',
],
)
print(response)
Expected Output:
{
'SpotInstanceRequests': [
{
'CreateTime': datetime(2014, 4, 30, 18, 14, 55, 2, 120, 0),
'InstanceId': 'i-1234567890abcdef0',
'LaunchSpecification': {
'BlockDeviceMappings': [
{
'DeviceName': '/dev/sda1',
'Ebs': {
'DeleteOnTermination': True,
'VolumeSize': 8,
'VolumeType': 'standard',
},
},
],
'EbsOptimized': False,
'ImageId': 'ami-7aba833f',
'InstanceType': 'm1.small',
'KeyName': 'my-key-pair',
'SecurityGroups': [
{
'GroupId': 'sg-e38f24a7',
'GroupName': 'my-security-group',
},
],
},
'LaunchedAvailabilityZone': 'us-west-1b',
'ProductDescription': 'Linux/UNIX',
'SpotInstanceRequestId': 'sir-08b93456',
'SpotPrice': '0.010000',
'State': 'active',
'Status': {
'Code': 'fulfilled',
'Message': 'Your Spot request is fulfilled.',
'UpdateTime': datetime(2014, 4, 30, 18, 16, 21, 2, 120, 0),
},
'Type': 'one-time',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes the Spot price history. For more information, see Spot Instance Pricing History in the Amazon EC2 User Guide for Linux Instances .
When you specify a start and end time, this operation returns the prices of the instance types within the time range that you specified and the time when the price changed. The price is valid within the time period that you specified; the response merely indicates the last time that the price changed.
See also: AWS API Documentation
Request Syntax
response = client.describe_spot_price_history(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
AvailabilityZone='string',
DryRun=True|False,
EndTime=datetime(2015, 1, 1),
InstanceTypes=[
't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
],
MaxResults=123,
NextToken='string',
ProductDescriptions=[
'string',
],
StartTime=datetime(2015, 1, 1)
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
Filters the results by the specified instance types.
Filters the results by the specified basic product descriptions.
dict
Response Syntax
{
'NextToken': 'string',
'SpotPriceHistory': [
{
'AvailabilityZone': 'string',
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
'SpotPrice': 'string',
'Timestamp': datetime(2015, 1, 1)
},
]
}
Response Structure
(dict) --
Contains the output of DescribeSpotPriceHistory.
NextToken (string) --
The token required to retrieve the next set of results. This value is null or an empty string when there are no more results to return.
SpotPriceHistory (list) --
The historical Spot prices.
(dict) --
Describes the maximum price per hour that you are willing to pay for a Spot Instance.
AvailabilityZone (string) --
The Availability Zone.
InstanceType (string) --
The instance type.
ProductDescription (string) --
A general description of the AMI.
SpotPrice (string) --
The maximum price per hour that you are willing to pay for a Spot Instance.
Timestamp (datetime) --
The date and time the request was created, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).
Examples
This example returns the Spot Price history for m1.xlarge, Linux/UNIX (Amazon VPC) instances for a particular day in January.
response = client.describe_spot_price_history(
EndTime=datetime(2014, 1, 6, 8, 9, 10, 0, 6, -1),
InstanceTypes=[
'm1.xlarge',
],
ProductDescriptions=[
'Linux/UNIX (Amazon VPC)',
],
StartTime=datetime(2014, 1, 6, 7, 8, 9, 0, 6, -1),
)
print(response)
Expected Output:
{
'SpotPriceHistory': [
{
'AvailabilityZone': 'us-west-1a',
'InstanceType': 'm1.xlarge',
'ProductDescription': 'Linux/UNIX (Amazon VPC)',
'SpotPrice': '0.080000',
'Timestamp': datetime(2014, 1, 6, 4, 32, 53, 0, 6, 0),
},
{
'AvailabilityZone': 'us-west-1c',
'InstanceType': 'm1.xlarge',
'ProductDescription': 'Linux/UNIX (Amazon VPC)',
'SpotPrice': '0.080000',
'Timestamp': datetime(2014, 1, 5, 11, 28, 26, 6, 5, 0),
},
],
'ResponseMetadata': {
'...': '...',
},
}
[VPC only] Describes the stale security group rules for security groups in a specified VPC. Rules are stale when they reference a deleted security group in a peer VPC, or a security group in a peer VPC for which the VPC peering connection has been deleted.
See also: AWS API Documentation
Request Syntax
response = client.describe_stale_security_groups(
DryRun=True|False,
MaxResults=123,
NextToken='string',
VpcId='string'
)
[REQUIRED]
The ID of the VPC.
dict
Response Syntax
{
'NextToken': 'string',
'StaleSecurityGroupSet': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'StaleIpPermissions': [
{
'FromPort': 123,
'IpProtocol': 'string',
'IpRanges': [
'string',
],
'PrefixListIds': [
'string',
],
'ToPort': 123,
'UserIdGroupPairs': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'PeeringStatus': 'string',
'UserId': 'string',
'VpcId': 'string',
'VpcPeeringConnectionId': 'string'
},
]
},
],
'StaleIpPermissionsEgress': [
{
'FromPort': 123,
'IpProtocol': 'string',
'IpRanges': [
'string',
],
'PrefixListIds': [
'string',
],
'ToPort': 123,
'UserIdGroupPairs': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'PeeringStatus': 'string',
'UserId': 'string',
'VpcId': 'string',
'VpcPeeringConnectionId': 'string'
},
]
},
],
'VpcId': 'string'
},
]
}
Response Structure
(dict) --
NextToken (string) --
The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.
StaleSecurityGroupSet (list) --
Information about the stale security groups.
(dict) --
Describes a stale security group (a security group that contains stale rules).
Description (string) --
The description of the security group.
GroupId (string) --
The ID of the security group.
GroupName (string) --
The name of the security group.
StaleIpPermissions (list) --
Information about the stale inbound rules in the security group.
(dict) --
Describes a stale rule in a security group.
FromPort (integer) --
The start of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.
IpProtocol (string) --
The IP protocol name (for tcp , udp , and icmp ) or number (see Protocol Numbers) .
IpRanges (list) --
The IP ranges. Not applicable for stale security group rules.
PrefixListIds (list) --
The prefix list IDs for an AWS service. Not applicable for stale security group rules.
ToPort (integer) --
The end of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.
UserIdGroupPairs (list) --
The security group pairs. Returns the ID of the referenced security group and VPC, and the ID and status of the VPC peering connection.
(dict) --
Describes a security group and AWS account ID pair.
Description (string) --
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
GroupId (string) --
The ID of the security group.
GroupName (string) --
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
PeeringStatus (string) --
The status of a VPC peering connection, if applicable.
UserId (string) --
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
VpcId (string) --
The ID of the VPC for the referenced security group, if applicable.
VpcPeeringConnectionId (string) --
The ID of the VPC peering connection, if applicable.
StaleIpPermissionsEgress (list) --
Information about the stale outbound rules in the security group.
(dict) --
Describes a stale rule in a security group.
FromPort (integer) --
The start of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.
IpProtocol (string) --
The IP protocol name (for tcp , udp , and icmp ) or number (see Protocol Numbers) .
IpRanges (list) --
The IP ranges. Not applicable for stale security group rules.
PrefixListIds (list) --
The prefix list IDs for an AWS service. Not applicable for stale security group rules.
ToPort (integer) --
The end of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.
UserIdGroupPairs (list) --
The security group pairs. Returns the ID of the referenced security group and VPC, and the ID and status of the VPC peering connection.
(dict) --
Describes a security group and AWS account ID pair.
Description (string) --
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
GroupId (string) --
The ID of the security group.
GroupName (string) --
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
PeeringStatus (string) --
The status of a VPC peering connection, if applicable.
UserId (string) --
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
VpcId (string) --
The ID of the VPC for the referenced security group, if applicable.
VpcPeeringConnectionId (string) --
The ID of the VPC peering connection, if applicable.
VpcId (string) --
The ID of the VPC for the security group.
Describes one or more of your subnets.
For more information, see Your VPC and Subnets in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_subnets(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
SubnetIds=[
'string',
],
DryRun=True|False,
NextToken='string',
MaxResults=123
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more subnet IDs.
Default: Describes all your subnets.
dict
Response Syntax
{
'Subnets': [
{
'AvailabilityZone': 'string',
'AvailabilityZoneId': 'string',
'AvailableIpAddressCount': 123,
'CidrBlock': 'string',
'DefaultForAz': True|False,
'MapPublicIpOnLaunch': True|False,
'State': 'pending'|'available',
'SubnetId': 'string',
'VpcId': 'string',
'OwnerId': 'string',
'AssignIpv6AddressOnCreation': True|False,
'Ipv6CidrBlockAssociationSet': [
{
'AssociationId': 'string',
'Ipv6CidrBlock': 'string',
'Ipv6CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
}
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'SubnetArn': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Subnets (list) --
Information about one or more subnets.
(dict) --
Describes a subnet.
AvailabilityZone (string) --
The Availability Zone of the subnet.
AvailabilityZoneId (string) --
The AZ ID of the subnet.
AvailableIpAddressCount (integer) --
The number of unused private IPv4 addresses in the subnet. The IPv4 addresses for any stopped instances are considered unavailable.
CidrBlock (string) --
The IPv4 CIDR block assigned to the subnet.
DefaultForAz (boolean) --
Indicates whether this is the default subnet for the Availability Zone.
MapPublicIpOnLaunch (boolean) --
Indicates whether instances launched in this subnet receive a public IPv4 address.
State (string) --
The current state of the subnet.
SubnetId (string) --
The ID of the subnet.
VpcId (string) --
The ID of the VPC the subnet is in.
OwnerId (string) --
The ID of the AWS account that owns the subnet.
AssignIpv6AddressOnCreation (boolean) --
Indicates whether a network interface created in this subnet (including a network interface created by RunInstances ) receives an IPv6 address.
Ipv6CidrBlockAssociationSet (list) --
Information about the IPv6 CIDR blocks associated with the subnet.
(dict) --
Describes an IPv6 CIDR block associated with a subnet.
AssociationId (string) --
The association ID for the CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
Ipv6CidrBlockState (dict) --
Information about the state of the CIDR block.
State (string) --
The state of a CIDR block.
StatusMessage (string) --
A message about the status of the CIDR block, if applicable.
Tags (list) --
Any tags assigned to the subnet.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
SubnetArn (string) --
The Amazon Resource Name (ARN) of the subnet.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Examples
This example describes the subnets for the specified VPC.
response = client.describe_subnets(
Filters=[
{
'Name': 'vpc-id',
'Values': [
'vpc-a01106c2',
],
},
],
)
print(response)
Expected Output:
{
'Subnets': [
{
'AvailabilityZone': 'us-east-1c',
'AvailableIpAddressCount': 251,
'CidrBlock': '10.0.1.0/24',
'DefaultForAz': False,
'MapPublicIpOnLaunch': False,
'State': 'available',
'SubnetId': 'subnet-9d4a7b6c',
'VpcId': 'vpc-a01106c2',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes the specified tags for your EC2 resources.
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_tags(
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string'
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'NextToken': 'string',
'Tags': [
{
'Key': 'string',
'ResourceId': 'string',
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Value': 'string'
},
]
}
Response Structure
(dict) --
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Tags (list) --
The tags.
(dict) --
Describes a tag.
Key (string) --
The tag key.
ResourceId (string) --
The ID of the resource.
ResourceType (string) --
The resource type.
Value (string) --
The tag value.
Examples
This example describes the tags for the specified instance.
response = client.describe_tags(
Filters=[
{
'Name': 'resource-id',
'Values': [
'i-1234567890abcdef8',
],
},
],
)
print(response)
Expected Output:
{
'Tags': [
{
'Key': 'Stack',
'ResourceId': 'i-1234567890abcdef8',
'ResourceType': 'instance',
'Value': 'test',
},
{
'Key': 'Name',
'ResourceId': 'i-1234567890abcdef8',
'ResourceType': 'instance',
'Value': 'Beta Server',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes one or more Traffic Mirror filters.
See also: AWS API Documentation
Request Syntax
response = client.describe_traffic_mirror_filters(
TrafficMirrorFilterIds=[
'string',
],
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string'
)
The ID of the Traffic Mirror filter.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'TrafficMirrorFilters': [
{
'TrafficMirrorFilterId': 'string',
'IngressFilterRules': [
{
'TrafficMirrorFilterRuleId': 'string',
'TrafficMirrorFilterId': 'string',
'TrafficDirection': 'ingress'|'egress',
'RuleNumber': 123,
'RuleAction': 'accept'|'reject',
'Protocol': 123,
'DestinationPortRange': {
'FromPort': 123,
'ToPort': 123
},
'SourcePortRange': {
'FromPort': 123,
'ToPort': 123
},
'DestinationCidrBlock': 'string',
'SourceCidrBlock': 'string',
'Description': 'string'
},
],
'EgressFilterRules': [
{
'TrafficMirrorFilterRuleId': 'string',
'TrafficMirrorFilterId': 'string',
'TrafficDirection': 'ingress'|'egress',
'RuleNumber': 123,
'RuleAction': 'accept'|'reject',
'Protocol': 123,
'DestinationPortRange': {
'FromPort': 123,
'ToPort': 123
},
'SourcePortRange': {
'FromPort': 123,
'ToPort': 123
},
'DestinationCidrBlock': 'string',
'SourceCidrBlock': 'string',
'Description': 'string'
},
],
'NetworkServices': [
'amazon-dns',
],
'Description': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
TrafficMirrorFilters (list) --
Information about one or more Traffic Mirror filters.
(dict) --
Describes the Traffic Mirror filter.
TrafficMirrorFilterId (string) --
The ID of the Traffic Mirror filter.
IngressFilterRules (list) --
Information about the ingress rules that are associated with the Traffic Mirror filter.
(dict) --
Describes the Traffic Mirror rule.
TrafficMirrorFilterRuleId (string) --
The ID of the Traffic Mirror rule.
TrafficMirrorFilterId (string) --
The ID of the Traffic Mirror filter that the rule is associated with.
TrafficDirection (string) --
The traffic direction assigned to the Traffic Mirror rule.
RuleNumber (integer) --
The rule number of the Traffic Mirror rule.
RuleAction (string) --
The action assigned to the Traffic Mirror rule.
Protocol (integer) --
The protocol assigned to the Traffic Mirror rule.
DestinationPortRange (dict) --
The destination port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
SourcePortRange (dict) --
The source port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
DestinationCidrBlock (string) --
The destination CIDR block assigned to the Traffic Mirror rule.
SourceCidrBlock (string) --
The source CIDR block assigned to the Traffic Mirror rule.
Description (string) --
The description of the Traffic Mirror rule.
EgressFilterRules (list) --
Information about the egress rules that are associated with the Traffic Mirror filter.
(dict) --
Describes the Traffic Mirror rule.
TrafficMirrorFilterRuleId (string) --
The ID of the Traffic Mirror rule.
TrafficMirrorFilterId (string) --
The ID of the Traffic Mirror filter that the rule is associated with.
TrafficDirection (string) --
The traffic direction assigned to the Traffic Mirror rule.
RuleNumber (integer) --
The rule number of the Traffic Mirror rule.
RuleAction (string) --
The action assigned to the Traffic Mirror rule.
Protocol (integer) --
The protocol assigned to the Traffic Mirror rule.
DestinationPortRange (dict) --
The destination port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
SourcePortRange (dict) --
The source port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
DestinationCidrBlock (string) --
The destination CIDR block assigned to the Traffic Mirror rule.
SourceCidrBlock (string) --
The source CIDR block assigned to the Traffic Mirror rule.
Description (string) --
The description of the Traffic Mirror rule.
NetworkServices (list) --
The network service traffic that is associated with the Traffic Mirror filter.
Description (string) --
The description of the Traffic Mirror filter.
Tags (list) --
The tags assigned to the Traffic Mirror filter.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
NextToken (string) --
The token to use to retrieve the next page of results. The value is null when there are no more results to return.
Describes one or more Traffic Mirror sessions. By default, all Traffic Mirror sessions are described. Alternatively, you can filter the results.
See also: AWS API Documentation
Request Syntax
response = client.describe_traffic_mirror_sessions(
TrafficMirrorSessionIds=[
'string',
],
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string'
)
The ID of the Traffic Mirror session.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'TrafficMirrorSessions': [
{
'TrafficMirrorSessionId': 'string',
'TrafficMirrorTargetId': 'string',
'TrafficMirrorFilterId': 'string',
'NetworkInterfaceId': 'string',
'OwnerId': 'string',
'PacketLength': 123,
'SessionNumber': 123,
'VirtualNetworkId': 123,
'Description': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
TrafficMirrorSessions (list) --
Describes one or more Traffic Mirror sessions. By default, all Traffic Mirror sessions are described. Alternatively, you can filter the results.
(dict) --
Describes a Traffic Mirror session.
TrafficMirrorSessionId (string) --
The ID for the Traffic Mirror session.
TrafficMirrorTargetId (string) --
The ID of the Traffic Mirror target.
TrafficMirrorFilterId (string) --
The ID of the Traffic Mirror filter.
NetworkInterfaceId (string) --
The ID of the Traffic Mirror session's network interface.
OwnerId (string) --
The ID of the account that owns the Traffic Mirror session.
PacketLength (integer) --
The number of bytes in each packet to mirror. These are the bytes after the VXLAN header. To mirror a subset, set this to the length (in bytes) to mirror. For example, if you set this value to 100, then the first 100 bytes that meet the filter criteria are copied to the target. Do not specify this parameter when you want to mirror the entire packet
SessionNumber (integer) --
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
Valid values are 1-32766.
VirtualNetworkId (integer) --
The virtual network ID associated with the Traffic Mirror session.
Description (string) --
The description of the Traffic Mirror session.
Tags (list) --
The tags assigned to the Traffic Mirror session.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
NextToken (string) --
The token to use to retrieve the next page of results. The value is null when there are no more results to return.
Information about one or more Traffic Mirror targets.
See also: AWS API Documentation
Request Syntax
response = client.describe_traffic_mirror_targets(
TrafficMirrorTargetIds=[
'string',
],
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string'
)
The ID of the Traffic Mirror targets.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'TrafficMirrorTargets': [
{
'TrafficMirrorTargetId': 'string',
'NetworkInterfaceId': 'string',
'NetworkLoadBalancerArn': 'string',
'Type': 'network-interface'|'network-load-balancer',
'Description': 'string',
'OwnerId': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
TrafficMirrorTargets (list) --
Information about one or more Traffic Mirror targets.
(dict) --
Describes a Traffic Mirror target.
TrafficMirrorTargetId (string) --
The ID of the Traffic Mirror target.
NetworkInterfaceId (string) --
The network interface ID that is attached to the target.
NetworkLoadBalancerArn (string) --
The Amazon Resource Name (ARN) of the Network Load Balancer.
Type (string) --
The type of Traffic Mirror target.
Description (string) --
Information about the Traffic Mirror target.
OwnerId (string) --
The ID of the account that owns the Traffic Mirror target.
Tags (list) --
The tags assigned to the Traffic Mirror target.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
NextToken (string) --
The token to use to retrieve the next page of results. The value is null when there are no more results to return.
Describes one or more attachments between resources and transit gateways. By default, all attachments are described. Alternatively, you can filter the results by attachment ID, attachment state, resource ID, or resource owner.
See also: AWS API Documentation
Request Syntax
response = client.describe_transit_gateway_attachments(
TransitGatewayAttachmentIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string',
DryRun=True|False
)
The IDs of the attachments.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'TransitGatewayAttachments': [
{
'TransitGatewayAttachmentId': 'string',
'TransitGatewayId': 'string',
'TransitGatewayOwnerId': 'string',
'ResourceOwnerId': 'string',
'ResourceType': 'vpc'|'vpn'|'direct-connect-gateway',
'ResourceId': 'string',
'State': 'pendingAcceptance'|'rollingBack'|'pending'|'available'|'modifying'|'deleting'|'deleted'|'failed'|'rejected'|'rejecting'|'failing',
'Association': {
'TransitGatewayRouteTableId': 'string',
'State': 'associating'|'associated'|'disassociating'|'disassociated'
},
'CreationTime': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
TransitGatewayAttachments (list) --
Information about the attachments.
(dict) --
Describes an attachment between a resource and a transit gateway.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
TransitGatewayId (string) --
The ID of the transit gateway.
TransitGatewayOwnerId (string) --
The ID of the AWS account that owns the transit gateway.
ResourceOwnerId (string) --
The ID of the AWS account that owns the resource.
ResourceType (string) --
The resource type.
ResourceId (string) --
The ID of the resource.
State (string) --
The attachment state.
Association (dict) --
The association.
TransitGatewayRouteTableId (string) --
The ID of the route table for the transit gateway.
State (string) --
The state of the association.
CreationTime (datetime) --
The creation time.
Tags (list) --
The tags for the attachment.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes one or more transit gateway route tables. By default, all transit gateway route tables are described. Alternatively, you can filter the results.
See also: AWS API Documentation
Request Syntax
response = client.describe_transit_gateway_route_tables(
TransitGatewayRouteTableIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string',
DryRun=True|False
)
The IDs of the transit gateway route tables.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'TransitGatewayRouteTables': [
{
'TransitGatewayRouteTableId': 'string',
'TransitGatewayId': 'string',
'State': 'pending'|'available'|'deleting'|'deleted',
'DefaultAssociationRouteTable': True|False,
'DefaultPropagationRouteTable': True|False,
'CreationTime': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
TransitGatewayRouteTables (list) --
Information about the transit gateway route tables.
(dict) --
Describes a transit gateway route table.
TransitGatewayRouteTableId (string) --
The ID of the transit gateway route table.
TransitGatewayId (string) --
The ID of the transit gateway.
State (string) --
The state of the transit gateway route table.
DefaultAssociationRouteTable (boolean) --
Indicates whether this is the default association route table for the transit gateway.
DefaultPropagationRouteTable (boolean) --
Indicates whether this is the default propagation route table for the transit gateway.
CreationTime (datetime) --
The creation time.
Tags (list) --
Any tags assigned to the route table.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes one or more VPC attachments. By default, all VPC attachments are described. Alternatively, you can filter the results.
See also: AWS API Documentation
Request Syntax
response = client.describe_transit_gateway_vpc_attachments(
TransitGatewayAttachmentIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string',
DryRun=True|False
)
The IDs of the attachments.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'TransitGatewayVpcAttachments': [
{
'TransitGatewayAttachmentId': 'string',
'TransitGatewayId': 'string',
'VpcId': 'string',
'VpcOwnerId': 'string',
'State': 'pendingAcceptance'|'rollingBack'|'pending'|'available'|'modifying'|'deleting'|'deleted'|'failed'|'rejected'|'rejecting'|'failing',
'SubnetIds': [
'string',
],
'CreationTime': datetime(2015, 1, 1),
'Options': {
'DnsSupport': 'enable'|'disable',
'Ipv6Support': 'enable'|'disable'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
TransitGatewayVpcAttachments (list) --
Information about the VPC attachments.
(dict) --
Describes a VPC attachment.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
TransitGatewayId (string) --
The ID of the transit gateway.
VpcId (string) --
The ID of the VPC.
VpcOwnerId (string) --
The ID of the AWS account that owns the VPC.
State (string) --
The state of the VPC attachment.
SubnetIds (list) --
The IDs of the subnets.
CreationTime (datetime) --
The creation time.
Options (dict) --
The VPC attachment options.
DnsSupport (string) --
Indicates whether DNS support is enabled.
Ipv6Support (string) --
Indicates whether IPv6 support is enabled.
Tags (list) --
The tags for the VPC attachment.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes one or more transit gateways. By default, all transit gateways are described. Alternatively, you can filter the results.
See also: AWS API Documentation
Request Syntax
response = client.describe_transit_gateways(
TransitGatewayIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string',
DryRun=True|False
)
The IDs of the transit gateways.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'TransitGateways': [
{
'TransitGatewayId': 'string',
'TransitGatewayArn': 'string',
'State': 'pending'|'available'|'modifying'|'deleting'|'deleted',
'OwnerId': 'string',
'Description': 'string',
'CreationTime': datetime(2015, 1, 1),
'Options': {
'AmazonSideAsn': 123,
'AutoAcceptSharedAttachments': 'enable'|'disable',
'DefaultRouteTableAssociation': 'enable'|'disable',
'AssociationDefaultRouteTableId': 'string',
'DefaultRouteTablePropagation': 'enable'|'disable',
'PropagationDefaultRouteTableId': 'string',
'VpnEcmpSupport': 'enable'|'disable',
'DnsSupport': 'enable'|'disable'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
TransitGateways (list) --
Information about the transit gateways.
(dict) --
Describes a transit gateway.
TransitGatewayId (string) --
The ID of the transit gateway.
TransitGatewayArn (string) --
The Amazon Resource Name (ARN) of the transit gateway.
State (string) --
The state of the transit gateway.
OwnerId (string) --
The ID of the AWS account ID that owns the transit gateway.
Description (string) --
The description of the transit gateway.
CreationTime (datetime) --
The creation time.
Options (dict) --
The transit gateway options.
AmazonSideAsn (integer) --
A private Autonomous System Number (ASN) for the Amazon side of a BGP session. The range is 64512 to 65534 for 16-bit ASNs and 4200000000 to 4294967294 for 32-bit ASNs.
AutoAcceptSharedAttachments (string) --
Indicates whether attachment requests are automatically accepted.
DefaultRouteTableAssociation (string) --
Indicates whether resource attachments are automatically associated with the default association route table.
AssociationDefaultRouteTableId (string) --
The ID of the default association route table.
DefaultRouteTablePropagation (string) --
Indicates whether resource attachments automatically propagate routes to the default propagation route table.
PropagationDefaultRouteTableId (string) --
The ID of the default propagation route table.
VpnEcmpSupport (string) --
Indicates whether Equal Cost Multipath Protocol support is enabled.
DnsSupport (string) --
Indicates whether DNS support is enabled.
Tags (list) --
The tags for the transit gateway.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes the specified attribute of the specified volume. You can specify only one attribute at a time.
For more information about EBS volumes, see Amazon EBS Volumes in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_volume_attribute(
Attribute='autoEnableIO'|'productCodes',
VolumeId='string',
DryRun=True|False
)
[REQUIRED]
The attribute of the volume. This parameter is required.
[REQUIRED]
The ID of the volume.
dict
Response Syntax
{
'AutoEnableIO': {
'Value': True|False
},
'ProductCodes': [
{
'ProductCodeId': 'string',
'ProductCodeType': 'devpay'|'marketplace'
},
],
'VolumeId': 'string'
}
Response Structure
(dict) --
Contains the output of DescribeVolumeAttribute.
AutoEnableIO (dict) --
The state of autoEnableIO attribute.
Value (boolean) --
The attribute value. The valid values are true or false .
ProductCodes (list) --
A list of product codes.
(dict) --
Describes a product code.
ProductCodeId (string) --
The product code.
ProductCodeType (string) --
The type of product code.
VolumeId (string) --
The ID of the volume.
Examples
This example describes the autoEnableIo attribute of the volume with the ID vol-049df61146c4d7901.
response = client.describe_volume_attribute(
Attribute='autoEnableIO',
VolumeId='vol-049df61146c4d7901',
)
print(response)
Expected Output:
{
'AutoEnableIO': {
'Value': False,
},
'VolumeId': 'vol-049df61146c4d7901',
'ResponseMetadata': {
'...': '...',
},
}
Describes the status of the specified volumes. Volume status provides the result of the checks performed on your volumes to determine events that can impair the performance of your volumes. The performance of a volume can be affected if an issue occurs on the volume's underlying host. If the volume's underlying host experiences a power outage or system issue, after the system is restored, there could be data inconsistencies on the volume. Volume events notify you if this occurs. Volume actions notify you if any action needs to be taken in response to the event.
The DescribeVolumeStatus operation provides the following information about the specified volumes:
Status : Reflects the current status of the volume. The possible values are ok , impaired , warning , or insufficient-data . If all checks pass, the overall status of the volume is ok . If the check fails, the overall status is impaired . If the status is insufficient-data , then the checks may still be taking place on your volume at the time. We recommend that you retry the request. For more information about volume status, see Monitoring the Status of Your Volumes in the Amazon Elastic Compute Cloud User Guide .
Events : Reflect the cause of a volume status and may require you to take action. For example, if your volume returns an impaired status, then the volume event might be potential-data-inconsistency . This means that your volume has been affected by an issue with the underlying host, has all I/O operations disabled, and may have inconsistent data.
Actions : Reflect the actions you may have to take in response to an event. For example, if the status of the volume is impaired and the volume event shows potential-data-inconsistency , then the action shows enable-volume-io . This means that you may want to enable the I/O operations for the volume by calling the EnableVolumeIO action and then check the volume for data consistency.
Volume status is based on the volume status checks, and does not reflect the volume state. Therefore, volume status does not indicate volumes in the error state (for example, when a volume is incapable of accepting I/O.)
See also: AWS API Documentation
Request Syntax
response = client.describe_volume_status(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string',
VolumeIds=[
'string',
],
DryRun=True|False
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The IDs of the volumes.
Default: Describes all your volumes.
dict
Response Syntax
{
'NextToken': 'string',
'VolumeStatuses': [
{
'Actions': [
{
'Code': 'string',
'Description': 'string',
'EventId': 'string',
'EventType': 'string'
},
],
'AvailabilityZone': 'string',
'Events': [
{
'Description': 'string',
'EventId': 'string',
'EventType': 'string',
'NotAfter': datetime(2015, 1, 1),
'NotBefore': datetime(2015, 1, 1)
},
],
'VolumeId': 'string',
'VolumeStatus': {
'Details': [
{
'Name': 'io-enabled'|'io-performance',
'Status': 'string'
},
],
'Status': 'ok'|'impaired'|'insufficient-data'
}
},
]
}
Response Structure
(dict) --
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
VolumeStatuses (list) --
Information about the status of the volumes.
(dict) --
Describes the volume status.
Actions (list) --
The details of the operation.
(dict) --
Describes a volume status operation code.
Code (string) --
The code identifying the operation, for example, enable-volume-io .
Description (string) --
A description of the operation.
EventId (string) --
The ID of the event associated with this operation.
EventType (string) --
The event type associated with this operation.
AvailabilityZone (string) --
The Availability Zone of the volume.
Events (list) --
A list of events associated with the volume.
(dict) --
Describes a volume status event.
Description (string) --
A description of the event.
EventId (string) --
The ID of this event.
EventType (string) --
The type of this event.
NotAfter (datetime) --
The latest end time of the event.
NotBefore (datetime) --
The earliest start time of the event.
VolumeId (string) --
The volume ID.
VolumeStatus (dict) --
The volume status.
Details (list) --
The details of the volume status.
(dict) --
Describes a volume status.
Name (string) --
The name of the volume status.
Status (string) --
The intended status of the volume status.
Status (string) --
The status of the volume.
Examples
This example describes the status for the volume vol-1234567890abcdef0.
response = client.describe_volume_status(
VolumeIds=[
'vol-1234567890abcdef0',
],
)
print(response)
Expected Output:
{
'VolumeStatuses': [
{
'Actions': [
],
'AvailabilityZone': 'us-east-1a',
'Events': [
],
'VolumeId': 'vol-1234567890abcdef0',
'VolumeStatus': {
'Details': [
{
'Name': 'io-enabled',
'Status': 'passed',
},
{
'Name': 'io-performance',
'Status': 'not-applicable',
},
],
'Status': 'ok',
},
},
],
'ResponseMetadata': {
'...': '...',
},
}
This example describes the status for all volumes that are impaired. In this example output, there are no impaired volumes.
response = client.describe_volume_status(
Filters=[
{
'Name': 'volume-status.status',
'Values': [
'impaired',
],
},
],
)
print(response)
Expected Output:
{
'VolumeStatuses': [
],
'ResponseMetadata': {
'...': '...',
},
}
Describes the specified EBS volumes or all of your EBS volumes.
If you are describing a long list of volumes, you can paginate the output to make the list more manageable. The MaxResults parameter sets the maximum number of results returned in a single page. If the list of results exceeds your MaxResults value, then that number of results is returned along with a NextToken value that can be passed to a subsequent DescribeVolumes request to retrieve the remaining results.
For more information about EBS volumes, see Amazon EBS Volumes in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_volumes(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
VolumeIds=[
'string',
],
DryRun=True|False,
MaxResults=123,
NextToken='string'
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The volume IDs.
dict
Response Syntax
{
'Volumes': [
{
'Attachments': [
{
'AttachTime': datetime(2015, 1, 1),
'Device': 'string',
'InstanceId': 'string',
'State': 'attaching'|'attached'|'detaching'|'detached'|'busy',
'VolumeId': 'string',
'DeleteOnTermination': True|False
},
],
'AvailabilityZone': 'string',
'CreateTime': datetime(2015, 1, 1),
'Encrypted': True|False,
'KmsKeyId': 'string',
'Size': 123,
'SnapshotId': 'string',
'State': 'creating'|'available'|'in-use'|'deleting'|'deleted'|'error',
'VolumeId': 'string',
'Iops': 123,
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Volumes (list) --
Information about the volumes.
(dict) --
Describes a volume.
Attachments (list) --
Information about the volume attachments.
(dict) --
Describes volume attachment details.
AttachTime (datetime) --
The time stamp when the attachment initiated.
Device (string) --
The device name.
InstanceId (string) --
The ID of the instance.
State (string) --
The attachment state of the volume.
VolumeId (string) --
The ID of the volume.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
AvailabilityZone (string) --
The Availability Zone for the volume.
CreateTime (datetime) --
The time stamp when volume creation was initiated.
Encrypted (boolean) --
Indicates whether the volume is encrypted.
KmsKeyId (string) --
The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the volume encryption key for the volume.
Size (integer) --
The size of the volume, in GiBs.
SnapshotId (string) --
The snapshot from which the volume was created, if applicable.
State (string) --
The volume state.
VolumeId (string) --
The ID of the volume.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports. For Provisioned IOPS SSD volumes, this represents the number of IOPS that are provisioned for the volume. For General Purpose SSD volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes, in most Regions. The maximum IOPS for io1 of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS.
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
Tags (list) --
Any tags assigned to the volume.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VolumeType (string) --
The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.
NextToken (string) --
The NextToken value to include in a future DescribeVolumes request. When the results of a DescribeVolumes request exceed MaxResults , this value can be used to retrieve the next page of results. This value is null when there are no more results to return.
Examples
This example describes all of your volumes in the default region.
response = client.describe_volumes(
)
print(response)
Expected Output:
{
'NextToken': '',
'Volumes': [
{
'Attachments': [
{
'AttachTime': datetime(2013, 12, 18, 22, 35, 0, 2, 352, 0),
'DeleteOnTermination': True,
'Device': '/dev/sda1',
'InstanceId': 'i-1234567890abcdef0',
'State': 'attached',
'VolumeId': 'vol-049df61146c4d7901',
},
],
'AvailabilityZone': 'us-east-1a',
'CreateTime': datetime(2013, 12, 18, 22, 35, 0, 2, 352, 0),
'Size': 8,
'SnapshotId': 'snap-1234567890abcdef0',
'State': 'in-use',
'VolumeId': 'vol-049df61146c4d7901',
'VolumeType': 'standard',
},
],
'ResponseMetadata': {
'...': '...',
},
}
This example describes all volumes that are both attached to the instance with the ID i-1234567890abcdef0 and set to delete when the instance terminates.
response = client.describe_volumes(
Filters=[
{
'Name': 'attachment.instance-id',
'Values': [
'i-1234567890abcdef0',
],
},
{
'Name': 'attachment.delete-on-termination',
'Values': [
'true',
],
},
],
)
print(response)
Expected Output:
{
'Volumes': [
{
'Attachments': [
{
'AttachTime': datetime(2013, 12, 18, 22, 35, 0, 2, 352, 0),
'DeleteOnTermination': True,
'Device': '/dev/sda1',
'InstanceId': 'i-1234567890abcdef0',
'State': 'attached',
'VolumeId': 'vol-049df61146c4d7901',
},
],
'AvailabilityZone': 'us-east-1a',
'CreateTime': datetime(2013, 12, 18, 22, 35, 0, 2, 352, 0),
'Size': 8,
'SnapshotId': 'snap-1234567890abcdef0',
'State': 'in-use',
'VolumeId': 'vol-049df61146c4d7901',
'VolumeType': 'standard',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Reports the current modification status of EBS volumes.
Current-generation EBS volumes support modification of attributes including type, size, and (for io1 volumes) IOPS provisioning while either attached to or detached from an instance. Following an action from the API or the console to modify a volume, the status of the modification may be modifying , optimizing , completed , or failed . If a volume has never been modified, then certain elements of the returned VolumeModification objects are null.
You can also use CloudWatch Events to check the status of a modification to an EBS volume. For information about CloudWatch Events, see the Amazon CloudWatch Events User Guide . For more information, see Monitoring Volume Modifications" in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_volumes_modifications(
DryRun=True|False,
VolumeIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
NextToken='string',
MaxResults=123
)
The IDs of the volumes for which in-progress modifications will be described.
The filters. Supported filters: volume-id , modification-state , target-size , target-iops , target-volume-type , original-size , original-iops , original-volume-type , start-time .
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'VolumesModifications': [
{
'VolumeId': 'string',
'ModificationState': 'modifying'|'optimizing'|'completed'|'failed',
'StatusMessage': 'string',
'TargetSize': 123,
'TargetIops': 123,
'TargetVolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'OriginalSize': 123,
'OriginalIops': 123,
'OriginalVolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Progress': 123,
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
VolumesModifications (list) --
Information about the volume modifications.
(dict) --
Describes the modification status of an EBS volume.
If the volume has never been modified, some element values will be null.
VolumeId (string) --
The ID of the volume.
ModificationState (string) --
The current modification state. The modification state is null for unmodified volumes.
StatusMessage (string) --
A status message about the modification progress or failure.
TargetSize (integer) --
The target size of the volume, in GiB.
TargetIops (integer) --
The target IOPS rate of the volume.
TargetVolumeType (string) --
The target EBS volume type of the volume.
OriginalSize (integer) --
The original size of the volume.
OriginalIops (integer) --
The original IOPS rate of the volume.
OriginalVolumeType (string) --
The original EBS volume type of the volume.
Progress (integer) --
The modification progress, from 0 to 100 percent complete.
StartTime (datetime) --
The modification start time.
EndTime (datetime) --
The modification completion or failure time.
NextToken (string) --
Token for pagination, null if there are no more results
Describes the specified attribute of the specified VPC. You can specify only one attribute at a time.
See also: AWS API Documentation
Request Syntax
response = client.describe_vpc_attribute(
Attribute='enableDnsSupport'|'enableDnsHostnames',
VpcId='string',
DryRun=True|False
)
[REQUIRED]
The VPC attribute.
[REQUIRED]
The ID of the VPC.
dict
Response Syntax
{
'VpcId': 'string',
'EnableDnsHostnames': {
'Value': True|False
},
'EnableDnsSupport': {
'Value': True|False
}
}
Response Structure
(dict) --
VpcId (string) --
The ID of the VPC.
EnableDnsHostnames (dict) --
Indicates whether the instances launched in the VPC get DNS hostnames. If this attribute is true , instances in the VPC get DNS hostnames; otherwise, they do not.
Value (boolean) --
The attribute value. The valid values are true or false .
EnableDnsSupport (dict) --
Indicates whether DNS resolution is enabled for the VPC. If this attribute is true , the Amazon DNS server resolves DNS hostnames for your instances to their corresponding IP addresses; otherwise, it does not.
Value (boolean) --
The attribute value. The valid values are true or false .
Examples
This example describes the enableDnsSupport attribute. This attribute indicates whether DNS resolution is enabled for the VPC. If this attribute is true, the Amazon DNS server resolves DNS hostnames for your instances to their corresponding IP addresses; otherwise, it does not.
response = client.describe_vpc_attribute(
Attribute='enableDnsSupport',
VpcId='vpc-a01106c2',
)
print(response)
Expected Output:
{
'EnableDnsSupport': {
'Value': True,
},
'VpcId': 'vpc-a01106c2',
'ResponseMetadata': {
'...': '...',
},
}
This example describes the enableDnsHostnames attribute. This attribute indicates whether the instances launched in the VPC get DNS hostnames. If this attribute is true, instances in the VPC get DNS hostnames; otherwise, they do not.
response = client.describe_vpc_attribute(
Attribute='enableDnsHostnames',
VpcId='vpc-a01106c2',
)
print(response)
Expected Output:
{
'EnableDnsHostnames': {
'Value': True,
},
'VpcId': 'vpc-a01106c2',
'ResponseMetadata': {
'...': '...',
},
}
Describes the ClassicLink status of one or more VPCs.
See also: AWS API Documentation
Request Syntax
response = client.describe_vpc_classic_link(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
VpcIds=[
'string',
]
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more VPCs for which you want to describe the ClassicLink status.
dict
Response Syntax
{
'Vpcs': [
{
'ClassicLinkEnabled': True|False,
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VpcId': 'string'
},
]
}
Response Structure
(dict) --
Vpcs (list) --
The ClassicLink status of one or more VPCs.
(dict) --
Describes whether a VPC is enabled for ClassicLink.
ClassicLinkEnabled (boolean) --
Indicates whether the VPC is enabled for ClassicLink.
Tags (list) --
Any tags assigned to the VPC.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VpcId (string) --
The ID of the VPC.
Describes the ClassicLink DNS support status of one or more VPCs. If enabled, the DNS hostname of a linked EC2-Classic instance resolves to its private IP address when addressed from an instance in the VPC to which it's linked. Similarly, the DNS hostname of an instance in a VPC resolves to its private IP address when addressed from a linked EC2-Classic instance. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_vpc_classic_link_dns_support(
MaxResults=123,
NextToken='string',
VpcIds=[
'string',
]
)
One or more VPC IDs.
dict
Response Syntax
{
'NextToken': 'string',
'Vpcs': [
{
'ClassicLinkDnsSupported': True|False,
'VpcId': 'string'
},
]
}
Response Structure
(dict) --
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Vpcs (list) --
Information about the ClassicLink DNS support status of the VPCs.
(dict) --
Describes the ClassicLink DNS support status of a VPC.
ClassicLinkDnsSupported (boolean) --
Indicates whether ClassicLink DNS support is enabled for the VPC.
VpcId (string) --
The ID of the VPC.
Describes the connection notifications for VPC endpoints and VPC endpoint services.
See also: AWS API Documentation
Request Syntax
response = client.describe_vpc_endpoint_connection_notifications(
DryRun=True|False,
ConnectionNotificationId='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string'
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'ConnectionNotificationSet': [
{
'ConnectionNotificationId': 'string',
'ServiceId': 'string',
'VpcEndpointId': 'string',
'ConnectionNotificationType': 'Topic',
'ConnectionNotificationArn': 'string',
'ConnectionEvents': [
'string',
],
'ConnectionNotificationState': 'Enabled'|'Disabled'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
ConnectionNotificationSet (list) --
One or more notifications.
(dict) --
Describes a connection notification for a VPC endpoint or VPC endpoint service.
ConnectionNotificationId (string) --
The ID of the notification.
ServiceId (string) --
The ID of the endpoint service.
VpcEndpointId (string) --
The ID of the VPC endpoint.
ConnectionNotificationType (string) --
The type of notification.
ConnectionNotificationArn (string) --
The ARN of the SNS topic for the notification.
ConnectionEvents (list) --
The events for the notification. Valid values are Accept , Connect , Delete , and Reject .
ConnectionNotificationState (string) --
The state of the notification.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes the VPC endpoint connections to your VPC endpoint services, including any endpoints that are pending your acceptance.
See also: AWS API Documentation
Request Syntax
response = client.describe_vpc_endpoint_connections(
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string'
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'VpcEndpointConnections': [
{
'ServiceId': 'string',
'VpcEndpointId': 'string',
'VpcEndpointOwner': 'string',
'VpcEndpointState': 'PendingAcceptance'|'Pending'|'Available'|'Deleting'|'Deleted'|'Rejected'|'Failed'|'Expired',
'CreationTimestamp': datetime(2015, 1, 1),
'DnsEntries': [
{
'DnsName': 'string',
'HostedZoneId': 'string'
},
],
'NetworkLoadBalancerArns': [
'string',
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
VpcEndpointConnections (list) --
Information about one or more VPC endpoint connections.
(dict) --
Describes a VPC endpoint connection to a service.
ServiceId (string) --
The ID of the service to which the endpoint is connected.
VpcEndpointId (string) --
The ID of the VPC endpoint.
VpcEndpointOwner (string) --
The AWS account ID of the owner of the VPC endpoint.
VpcEndpointState (string) --
The state of the VPC endpoint.
CreationTimestamp (datetime) --
The date and time the VPC endpoint was created.
DnsEntries (list) --
The DNS entries for the VPC endpoint.
(dict) --
Describes a DNS entry.
DnsName (string) --
The DNS name.
HostedZoneId (string) --
The ID of the private hosted zone.
NetworkLoadBalancerArns (list) --
The Amazon Resource Names (ARNs) of the network load balancers for the service.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes the VPC endpoint service configurations in your account (your services).
See also: AWS API Documentation
Request Syntax
response = client.describe_vpc_endpoint_service_configurations(
DryRun=True|False,
ServiceIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string'
)
The IDs of one or more services.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'ServiceConfigurations': [
{
'ServiceType': [
{
'ServiceType': 'Interface'|'Gateway'
},
],
'ServiceId': 'string',
'ServiceName': 'string',
'ServiceState': 'Pending'|'Available'|'Deleting'|'Deleted'|'Failed',
'AvailabilityZones': [
'string',
],
'AcceptanceRequired': True|False,
'ManagesVpcEndpoints': True|False,
'NetworkLoadBalancerArns': [
'string',
],
'BaseEndpointDnsNames': [
'string',
],
'PrivateDnsName': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
ServiceConfigurations (list) --
Information about one or more services.
(dict) --
Describes a service configuration for a VPC endpoint service.
ServiceType (list) --
The type of service.
(dict) --
Describes the type of service for a VPC endpoint.
ServiceType (string) --
The type of service.
ServiceId (string) --
The ID of the service.
ServiceName (string) --
The name of the service.
ServiceState (string) --
The service state.
AvailabilityZones (list) --
In the Availability Zones in which the service is available.
AcceptanceRequired (boolean) --
Indicates whether requests from other AWS accounts to create an endpoint to the service must first be accepted.
ManagesVpcEndpoints (boolean) --
Indicates whether the service manages it's VPC endpoints. Management of the service VPC endpoints using the VPC endpoint API is restricted.
NetworkLoadBalancerArns (list) --
The Amazon Resource Names (ARNs) of the Network Load Balancers for the service.
BaseEndpointDnsNames (list) --
The DNS names for the service.
PrivateDnsName (string) --
The private DNS name for the service.
Tags (list) --
Any tags assigned to the service.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes the principals (service consumers) that are permitted to discover your VPC endpoint service.
See also: AWS API Documentation
Request Syntax
response = client.describe_vpc_endpoint_service_permissions(
DryRun=True|False,
ServiceId='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string'
)
[REQUIRED]
The ID of the service.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'AllowedPrincipals': [
{
'PrincipalType': 'All'|'Service'|'OrganizationUnit'|'Account'|'User'|'Role',
'Principal': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
AllowedPrincipals (list) --
Information about one or more allowed principals.
(dict) --
Describes a principal.
PrincipalType (string) --
The type of principal.
Principal (string) --
The Amazon Resource Name (ARN) of the principal.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes available services to which you can create a VPC endpoint.
See also: AWS API Documentation
Request Syntax
response = client.describe_vpc_endpoint_services(
DryRun=True|False,
ServiceNames=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string'
)
One or more service names.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The maximum number of items to return for this request. The request returns a token that you can specify in a subsequent call to get the next set of results.
Constraint: If the value is greater than 1000, we return only 1000 items.
dict
Response Syntax
{
'ServiceNames': [
'string',
],
'ServiceDetails': [
{
'ServiceName': 'string',
'ServiceId': 'string',
'ServiceType': [
{
'ServiceType': 'Interface'|'Gateway'
},
],
'AvailabilityZones': [
'string',
],
'Owner': 'string',
'BaseEndpointDnsNames': [
'string',
],
'PrivateDnsName': 'string',
'VpcEndpointPolicySupported': True|False,
'AcceptanceRequired': True|False,
'ManagesVpcEndpoints': True|False,
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the output of DescribeVpcEndpointServices.
ServiceNames (list) --
A list of supported services.
ServiceDetails (list) --
Information about the service.
(dict) --
Describes a VPC endpoint service.
ServiceName (string) --
The Amazon Resource Name (ARN) of the service.
ServiceId (string) --
The ID of the endpoint service.
ServiceType (list) --
The type of service.
(dict) --
Describes the type of service for a VPC endpoint.
ServiceType (string) --
The type of service.
AvailabilityZones (list) --
The Availability Zones in which the service is available.
Owner (string) --
The AWS account ID of the service owner.
BaseEndpointDnsNames (list) --
The DNS names for the service.
PrivateDnsName (string) --
The private DNS name for the service.
VpcEndpointPolicySupported (boolean) --
Indicates whether the service supports endpoint policies.
AcceptanceRequired (boolean) --
Indicates whether VPC endpoint connection requests to the service must be accepted by the service owner.
ManagesVpcEndpoints (boolean) --
Indicates whether the service manages it's VPC endpoints. Management of the service VPC endpoints using the VPC endpoint API is restricted.
Tags (list) --
Any tags assigned to the service.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
NextToken (string) --
The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.
Describes one or more of your VPC endpoints.
See also: AWS API Documentation
Request Syntax
response = client.describe_vpc_endpoints(
DryRun=True|False,
VpcEndpointIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string'
)
One or more endpoint IDs.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The maximum number of items to return for this request. The request returns a token that you can specify in a subsequent call to get the next set of results.
Constraint: If the value is greater than 1000, we return only 1000 items.
dict
Response Syntax
{
'VpcEndpoints': [
{
'VpcEndpointId': 'string',
'VpcEndpointType': 'Interface'|'Gateway',
'VpcId': 'string',
'ServiceName': 'string',
'State': 'PendingAcceptance'|'Pending'|'Available'|'Deleting'|'Deleted'|'Rejected'|'Failed'|'Expired',
'PolicyDocument': 'string',
'RouteTableIds': [
'string',
],
'SubnetIds': [
'string',
],
'Groups': [
{
'GroupId': 'string',
'GroupName': 'string'
},
],
'PrivateDnsEnabled': True|False,
'RequesterManaged': True|False,
'NetworkInterfaceIds': [
'string',
],
'DnsEntries': [
{
'DnsName': 'string',
'HostedZoneId': 'string'
},
],
'CreationTimestamp': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'OwnerId': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the output of DescribeVpcEndpoints.
VpcEndpoints (list) --
Information about the endpoints.
(dict) --
Describes a VPC endpoint.
VpcEndpointId (string) --
The ID of the VPC endpoint.
VpcEndpointType (string) --
The type of endpoint.
VpcId (string) --
The ID of the VPC to which the endpoint is associated.
ServiceName (string) --
The name of the service to which the endpoint is associated.
State (string) --
The state of the VPC endpoint.
PolicyDocument (string) --
The policy document associated with the endpoint, if applicable.
RouteTableIds (list) --
(Gateway endpoint) One or more route tables associated with the endpoint.
SubnetIds (list) --
(Interface endpoint) One or more subnets in which the endpoint is located.
Groups (list) --
(Interface endpoint) Information about the security groups associated with the network interface.
(dict) --
Describes a security group.
GroupId (string) --
The ID of the security group.
GroupName (string) --
The name of the security group.
PrivateDnsEnabled (boolean) --
(Interface endpoint) Indicates whether the VPC is associated with a private hosted zone.
RequesterManaged (boolean) --
Indicates whether the VPC endpoint is being managed by its service.
NetworkInterfaceIds (list) --
(Interface endpoint) One or more network interfaces for the endpoint.
DnsEntries (list) --
(Interface endpoint) The DNS entries for the endpoint.
(dict) --
Describes a DNS entry.
DnsName (string) --
The DNS name.
HostedZoneId (string) --
The ID of the private hosted zone.
CreationTimestamp (datetime) --
The date and time the VPC endpoint was created.
Tags (list) --
Any tags assigned to the VPC endpoint.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
OwnerId (string) --
The ID of the AWS account that owns the VPC endpoint.
NextToken (string) --
The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.
Describes one or more of your VPC peering connections.
See also: AWS API Documentation
Request Syntax
response = client.describe_vpc_peering_connections(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
VpcPeeringConnectionIds=[
'string',
],
NextToken='string',
MaxResults=123
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more VPC peering connection IDs.
Default: Describes all your VPC peering connections.
dict
Response Syntax
{
'VpcPeeringConnections': [
{
'AccepterVpcInfo': {
'CidrBlock': 'string',
'Ipv6CidrBlockSet': [
{
'Ipv6CidrBlock': 'string'
},
],
'CidrBlockSet': [
{
'CidrBlock': 'string'
},
],
'OwnerId': 'string',
'PeeringOptions': {
'AllowDnsResolutionFromRemoteVpc': True|False,
'AllowEgressFromLocalClassicLinkToRemoteVpc': True|False,
'AllowEgressFromLocalVpcToRemoteClassicLink': True|False
},
'VpcId': 'string',
'Region': 'string'
},
'ExpirationTime': datetime(2015, 1, 1),
'RequesterVpcInfo': {
'CidrBlock': 'string',
'Ipv6CidrBlockSet': [
{
'Ipv6CidrBlock': 'string'
},
],
'CidrBlockSet': [
{
'CidrBlock': 'string'
},
],
'OwnerId': 'string',
'PeeringOptions': {
'AllowDnsResolutionFromRemoteVpc': True|False,
'AllowEgressFromLocalClassicLinkToRemoteVpc': True|False,
'AllowEgressFromLocalVpcToRemoteClassicLink': True|False
},
'VpcId': 'string',
'Region': 'string'
},
'Status': {
'Code': 'initiating-request'|'pending-acceptance'|'active'|'deleted'|'rejected'|'failed'|'expired'|'provisioning'|'deleting',
'Message': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VpcPeeringConnectionId': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
VpcPeeringConnections (list) --
Information about the VPC peering connections.
(dict) --
Describes a VPC peering connection.
AccepterVpcInfo (dict) --
Information about the accepter VPC. CIDR block information is only returned when describing an active VPC peering connection.
CidrBlock (string) --
The IPv4 CIDR block for the VPC.
Ipv6CidrBlockSet (list) --
The IPv6 CIDR block for the VPC.
(dict) --
Describes an IPv6 CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
CidrBlockSet (list) --
Information about the IPv4 CIDR blocks for the VPC.
(dict) --
Describes an IPv4 CIDR block.
CidrBlock (string) --
The IPv4 CIDR block.
OwnerId (string) --
The AWS account ID of the VPC owner.
PeeringOptions (dict) --
Information about the VPC peering connection options for the accepter or requester VPC.
AllowDnsResolutionFromRemoteVpc (boolean) --
Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
AllowEgressFromLocalClassicLinkToRemoteVpc (boolean) --
Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection.
AllowEgressFromLocalVpcToRemoteClassicLink (boolean) --
Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection.
VpcId (string) --
The ID of the VPC.
Region (string) --
The Region in which the VPC is located.
ExpirationTime (datetime) --
The time that an unaccepted VPC peering connection will expire.
RequesterVpcInfo (dict) --
Information about the requester VPC. CIDR block information is only returned when describing an active VPC peering connection.
CidrBlock (string) --
The IPv4 CIDR block for the VPC.
Ipv6CidrBlockSet (list) --
The IPv6 CIDR block for the VPC.
(dict) --
Describes an IPv6 CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
CidrBlockSet (list) --
Information about the IPv4 CIDR blocks for the VPC.
(dict) --
Describes an IPv4 CIDR block.
CidrBlock (string) --
The IPv4 CIDR block.
OwnerId (string) --
The AWS account ID of the VPC owner.
PeeringOptions (dict) --
Information about the VPC peering connection options for the accepter or requester VPC.
AllowDnsResolutionFromRemoteVpc (boolean) --
Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
AllowEgressFromLocalClassicLinkToRemoteVpc (boolean) --
Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection.
AllowEgressFromLocalVpcToRemoteClassicLink (boolean) --
Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection.
VpcId (string) --
The ID of the VPC.
Region (string) --
The Region in which the VPC is located.
Status (dict) --
The status of the VPC peering connection.
Code (string) --
The status of the VPC peering connection.
Message (string) --
A message that provides more information about the status, if applicable.
Tags (list) --
Any tags assigned to the resource.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VpcPeeringConnectionId (string) --
The ID of the VPC peering connection.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Describes one or more of your VPCs.
See also: AWS API Documentation
Request Syntax
response = client.describe_vpcs(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
VpcIds=[
'string',
],
DryRun=True|False,
NextToken='string',
MaxResults=123
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more VPC IDs.
Default: Describes all your VPCs.
dict
Response Syntax
{
'Vpcs': [
{
'CidrBlock': 'string',
'DhcpOptionsId': 'string',
'State': 'pending'|'available',
'VpcId': 'string',
'OwnerId': 'string',
'InstanceTenancy': 'default'|'dedicated'|'host',
'Ipv6CidrBlockAssociationSet': [
{
'AssociationId': 'string',
'Ipv6CidrBlock': 'string',
'Ipv6CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
}
},
],
'CidrBlockAssociationSet': [
{
'AssociationId': 'string',
'CidrBlock': 'string',
'CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
}
},
],
'IsDefault': True|False,
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Vpcs (list) --
Information about one or more VPCs.
(dict) --
Describes a VPC.
CidrBlock (string) --
The primary IPv4 CIDR block for the VPC.
DhcpOptionsId (string) --
The ID of the set of DHCP options you've associated with the VPC (or default if the default options are associated with the VPC).
State (string) --
The current state of the VPC.
VpcId (string) --
The ID of the VPC.
OwnerId (string) --
The ID of the AWS account that owns the VPC.
InstanceTenancy (string) --
The allowed tenancy of instances launched into the VPC.
Ipv6CidrBlockAssociationSet (list) --
Information about the IPv6 CIDR blocks associated with the VPC.
(dict) --
Describes an IPv6 CIDR block associated with a VPC.
AssociationId (string) --
The association ID for the IPv6 CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
Ipv6CidrBlockState (dict) --
Information about the state of the CIDR block.
State (string) --
The state of the CIDR block.
StatusMessage (string) --
A message about the status of the CIDR block, if applicable.
CidrBlockAssociationSet (list) --
Information about the IPv4 CIDR blocks associated with the VPC.
(dict) --
Describes an IPv4 CIDR block associated with a VPC.
AssociationId (string) --
The association ID for the IPv4 CIDR block.
CidrBlock (string) --
The IPv4 CIDR block.
CidrBlockState (dict) --
Information about the state of the CIDR block.
State (string) --
The state of the CIDR block.
StatusMessage (string) --
A message about the status of the CIDR block, if applicable.
IsDefault (boolean) --
Indicates whether the VPC is the default VPC.
Tags (list) --
Any tags assigned to the VPC.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Examples
This example describes the specified VPC.
response = client.describe_vpcs(
VpcIds=[
'vpc-a01106c2',
],
)
print(response)
Expected Output:
{
'Vpcs': [
{
'CidrBlock': '10.0.0.0/16',
'DhcpOptionsId': 'dopt-7a8b9c2d',
'InstanceTenancy': 'default',
'IsDefault': False,
'State': 'available',
'Tags': [
{
'Key': 'Name',
'Value': 'MyVPC',
},
],
'VpcId': 'vpc-a01106c2',
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes one or more of your VPN connections.
For more information, see AWS Site-to-Site VPN in the AWS Site-to-Site VPN User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_vpn_connections(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
VpnConnectionIds=[
'string',
],
DryRun=True|False
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more VPN connection IDs.
Default: Describes your VPN connections.
dict
Response Syntax
{
'VpnConnections': [
{
'CustomerGatewayConfiguration': 'string',
'CustomerGatewayId': 'string',
'Category': 'string',
'State': 'pending'|'available'|'deleting'|'deleted',
'Type': 'ipsec.1',
'VpnConnectionId': 'string',
'VpnGatewayId': 'string',
'TransitGatewayId': 'string',
'Options': {
'StaticRoutesOnly': True|False
},
'Routes': [
{
'DestinationCidrBlock': 'string',
'Source': 'Static',
'State': 'pending'|'available'|'deleting'|'deleted'
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VgwTelemetry': [
{
'AcceptedRouteCount': 123,
'LastStatusChange': datetime(2015, 1, 1),
'OutsideIpAddress': 'string',
'Status': 'UP'|'DOWN',
'StatusMessage': 'string'
},
]
},
]
}
Response Structure
(dict) --
Contains the output of DescribeVpnConnections.
VpnConnections (list) --
Information about one or more VPN connections.
(dict) --
Describes a VPN connection.
CustomerGatewayConfiguration (string) --
The configuration information for the VPN connection's customer gateway (in the native XML format). This element is always present in the CreateVpnConnection response; however, it's present in the DescribeVpnConnections response only if the VPN connection is in the pending or available state.
CustomerGatewayId (string) --
The ID of the customer gateway at your end of the VPN connection.
Category (string) --
The category of the VPN connection. A value of VPN indicates an AWS VPN connection. A value of VPN-Classic indicates an AWS Classic VPN connection.
State (string) --
The current state of the VPN connection.
Type (string) --
The type of VPN connection.
VpnConnectionId (string) --
The ID of the VPN connection.
VpnGatewayId (string) --
The ID of the virtual private gateway at the AWS side of the VPN connection.
TransitGatewayId (string) --
The ID of the transit gateway associated with the VPN connection.
Options (dict) --
The VPN connection options.
StaticRoutesOnly (boolean) --
Indicates whether the VPN connection uses static routes only. Static routes must be used for devices that don't support BGP.
Routes (list) --
The static routes associated with the VPN connection.
(dict) --
Describes a static route for a VPN connection.
DestinationCidrBlock (string) --
The CIDR block associated with the local subnet of the customer data center.
Source (string) --
Indicates how the routes were provided.
State (string) --
The current state of the static route.
Tags (list) --
Any tags assigned to the VPN connection.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VgwTelemetry (list) --
Information about the VPN tunnel.
(dict) --
Describes telemetry for a VPN tunnel.
AcceptedRouteCount (integer) --
The number of accepted routes.
LastStatusChange (datetime) --
The date and time of the last change in status.
OutsideIpAddress (string) --
The Internet-routable IP address of the virtual private gateway's outside interface.
Status (string) --
The status of the VPN tunnel.
StatusMessage (string) --
If an error occurs, a description of the error.
Describes one or more of your virtual private gateways.
For more information, see AWS Site-to-Site VPN in the AWS Site-to-Site VPN User Guide .
See also: AWS API Documentation
Request Syntax
response = client.describe_vpn_gateways(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
VpnGatewayIds=[
'string',
],
DryRun=True|False
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more virtual private gateway IDs.
Default: Describes all your virtual private gateways.
dict
Response Syntax
{
'VpnGateways': [
{
'AvailabilityZone': 'string',
'State': 'pending'|'available'|'deleting'|'deleted',
'Type': 'ipsec.1',
'VpcAttachments': [
{
'State': 'attaching'|'attached'|'detaching'|'detached',
'VpcId': 'string'
},
],
'VpnGatewayId': 'string',
'AmazonSideAsn': 123,
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
]
}
Response Structure
(dict) --
Contains the output of DescribeVpnGateways.
VpnGateways (list) --
Information about one or more virtual private gateways.
(dict) --
Describes a virtual private gateway.
AvailabilityZone (string) --
The Availability Zone where the virtual private gateway was created, if applicable. This field may be empty or not returned.
State (string) --
The current state of the virtual private gateway.
Type (string) --
The type of VPN connection the virtual private gateway supports.
VpcAttachments (list) --
Any VPCs attached to the virtual private gateway.
(dict) --
Describes an attachment between a virtual private gateway and a VPC.
State (string) --
The current state of the attachment.
VpcId (string) --
The ID of the VPC.
VpnGatewayId (string) --
The ID of the virtual private gateway.
AmazonSideAsn (integer) --
The private Autonomous System Number (ASN) for the Amazon side of a BGP session.
Tags (list) --
Any tags assigned to the virtual private gateway.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Unlinks (detaches) a linked EC2-Classic instance from a VPC. After the instance has been unlinked, the VPC security groups are no longer associated with it. An instance is automatically unlinked from a VPC when it's stopped.
See also: AWS API Documentation
Request Syntax
response = client.detach_classic_link_vpc(
DryRun=True|False,
InstanceId='string',
VpcId='string'
)
[REQUIRED]
The ID of the instance to unlink from the VPC.
[REQUIRED]
The ID of the VPC to which the instance is linked.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Detaches an internet gateway from a VPC, disabling connectivity between the internet and the VPC. The VPC must not contain any running instances with Elastic IP addresses or public IPv4 addresses.
See also: AWS API Documentation
Request Syntax
response = client.detach_internet_gateway(
DryRun=True|False,
InternetGatewayId='string',
VpcId='string'
)
[REQUIRED]
The ID of the internet gateway.
[REQUIRED]
The ID of the VPC.
None
Examples
This example detaches the specified Internet gateway from the specified VPC.
response = client.detach_internet_gateway(
InternetGatewayId='igw-c0a643a9',
VpcId='vpc-a01106c2',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Detaches a network interface from an instance.
See also: AWS API Documentation
Request Syntax
response = client.detach_network_interface(
AttachmentId='string',
DryRun=True|False,
Force=True|False
)
[REQUIRED]
The ID of the attachment.
None
Examples
This example detaches the specified network interface from its attached instance.
response = client.detach_network_interface(
AttachmentId='eni-attach-66c4350a',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Detaches an EBS volume from an instance. Make sure to unmount any file systems on the device within your operating system before detaching the volume. Failure to do so can result in the volume becoming stuck in the busy state while detaching. If this happens, detachment can be delayed indefinitely until you unmount the volume, force detachment, reboot the instance, or all three. If an EBS volume is the root device of an instance, it can't be detached while the instance is running. To detach the root volume, stop the instance first.
When a volume with an AWS Marketplace product code is detached from an instance, the product code is no longer associated with the instance.
For more information, see Detaching an Amazon EBS Volume in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.detach_volume(
Device='string',
Force=True|False,
InstanceId='string',
VolumeId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the volume.
dict
Response Syntax
{
'AttachTime': datetime(2015, 1, 1),
'Device': 'string',
'InstanceId': 'string',
'State': 'attaching'|'attached'|'detaching'|'detached'|'busy',
'VolumeId': 'string',
'DeleteOnTermination': True|False
}
Response Structure
(dict) --
Describes volume attachment details.
AttachTime (datetime) --
The time stamp when the attachment initiated.
Device (string) --
The device name.
InstanceId (string) --
The ID of the instance.
State (string) --
The attachment state of the volume.
VolumeId (string) --
The ID of the volume.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
Examples
This example detaches the volume (vol-049df61146c4d7901) from the instance it is attached to.
response = client.detach_volume(
VolumeId='vol-1234567890abcdef0',
)
print(response)
Expected Output:
{
'AttachTime': datetime(2014, 2, 27, 19, 23, 6, 3, 58, 0),
'Device': '/dev/sdb',
'InstanceId': 'i-1234567890abcdef0',
'State': 'detaching',
'VolumeId': 'vol-049df61146c4d7901',
'ResponseMetadata': {
'...': '...',
},
}
Detaches a virtual private gateway from a VPC. You do this if you're planning to turn off the VPC and not use it anymore. You can confirm a virtual private gateway has been completely detached from a VPC by describing the virtual private gateway (any attachments to the virtual private gateway are also described).
You must wait for the attachment's state to switch to detached before you can delete the VPC or attach a different VPC to the virtual private gateway.
See also: AWS API Documentation
Request Syntax
response = client.detach_vpn_gateway(
VpcId='string',
VpnGatewayId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the VPC.
[REQUIRED]
The ID of the virtual private gateway.
None
Disables EBS encryption by default for your account in the current Region.
After you disable encryption by default, you can still create encrypted volumes by enabling encryption when you create each volume.
Disabling encryption by default does not change the encryption status of your existing volumes.
For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.disable_ebs_encryption_by_default(
DryRun=True|False
)
{
'EbsEncryptionByDefault': True|False
}
Response Structure
The updated status of encryption by default.
Disables the specified resource attachment from propagating routes to the specified propagation route table.
See also: AWS API Documentation
Request Syntax
response = client.disable_transit_gateway_route_table_propagation(
TransitGatewayRouteTableId='string',
TransitGatewayAttachmentId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the propagation route table.
[REQUIRED]
The ID of the attachment.
dict
Response Syntax
{
'Propagation': {
'TransitGatewayAttachmentId': 'string',
'ResourceId': 'string',
'ResourceType': 'vpc'|'vpn'|'direct-connect-gateway',
'TransitGatewayRouteTableId': 'string',
'State': 'enabling'|'enabled'|'disabling'|'disabled'
}
}
Response Structure
(dict) --
Propagation (dict) --
Information about route propagation.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
ResourceId (string) --
The ID of the resource.
ResourceType (string) --
The resource type.
TransitGatewayRouteTableId (string) --
The ID of the transit gateway route table.
State (string) --
The state.
Disables a virtual private gateway (VGW) from propagating routes to a specified route table of a VPC.
See also: AWS API Documentation
Request Syntax
response = client.disable_vgw_route_propagation(
GatewayId='string',
RouteTableId='string'
)
[REQUIRED]
The ID of the virtual private gateway.
[REQUIRED]
The ID of the route table.
None
Examples
This example disables the specified virtual private gateway from propagating static routes to the specified route table.
response = client.disable_vgw_route_propagation(
GatewayId='vgw-9a4cacf3',
RouteTableId='rtb-22574640',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Disables ClassicLink for a VPC. You cannot disable ClassicLink for a VPC that has EC2-Classic instances linked to it.
See also: AWS API Documentation
Request Syntax
response = client.disable_vpc_classic_link(
DryRun=True|False,
VpcId='string'
)
[REQUIRED]
The ID of the VPC.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Disables ClassicLink DNS support for a VPC. If disabled, DNS hostnames resolve to public IP addresses when addressed between a linked EC2-Classic instance and instances in the VPC to which it's linked. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.disable_vpc_classic_link_dns_support(
VpcId='string'
)
{
'Return': True|False
}
Response Structure
Returns true if the request succeeds; otherwise, it returns an error.
Disassociates an Elastic IP address from the instance or network interface it's associated with.
An Elastic IP address is for use in either the EC2-Classic platform or in a VPC. For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide .
This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error.
See also: AWS API Documentation
Request Syntax
response = client.disassociate_address(
AssociationId='string',
PublicIp='string',
DryRun=True|False
)
None
Examples
This example disassociates an Elastic IP address from an instance in a VPC.
response = client.disassociate_address(
AssociationId='eipassoc-2bebb745',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
This example disassociates an Elastic IP address from an instance in EC2-Classic.
response = client.disassociate_address(
PublicIp='198.51.100.0',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Disassociates a target network from the specified Client VPN endpoint. When you disassociate the last target network from a Client VPN, the following happens:
See also: AWS API Documentation
Request Syntax
response = client.disassociate_client_vpn_target_network(
ClientVpnEndpointId='string',
AssociationId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the Client VPN endpoint from which to disassociate the target network.
[REQUIRED]
The ID of the target network association.
dict
Response Syntax
{
'AssociationId': 'string',
'Status': {
'Code': 'associating'|'associated'|'association-failed'|'disassociating'|'disassociated',
'Message': 'string'
}
}
Response Structure
(dict) --
AssociationId (string) --
The ID of the target network association.
Status (dict) --
The current state of the target network association.
Code (string) --
The state of the target network association.
Message (string) --
A message about the status of the target network association, if applicable.
Disassociates an IAM instance profile from a running or stopped instance.
Use DescribeIamInstanceProfileAssociations to get the association ID.
See also: AWS API Documentation
Request Syntax
response = client.disassociate_iam_instance_profile(
AssociationId='string'
)
[REQUIRED]
The ID of the IAM instance profile association.
{
'IamInstanceProfileAssociation': {
'AssociationId': 'string',
'InstanceId': 'string',
'IamInstanceProfile': {
'Arn': 'string',
'Id': 'string'
},
'State': 'associating'|'associated'|'disassociating'|'disassociated',
'Timestamp': datetime(2015, 1, 1)
}
}
Response Structure
Information about the IAM instance profile association.
The ID of the association.
The ID of the instance.
The IAM instance profile.
The Amazon Resource Name (ARN) of the instance profile.
The ID of the instance profile.
The state of the association.
The time the IAM instance profile was associated with the instance.
Disassociates a subnet from a route table.
After you perform this action, the subnet no longer uses the routes in the route table. Instead, it uses the routes in the VPC's main route table. For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.disassociate_route_table(
AssociationId='string',
DryRun=True|False
)
[REQUIRED]
The association ID representing the current association between the route table and subnet.
None
Examples
This example disassociates the specified route table from its associated subnet.
response = client.disassociate_route_table(
AssociationId='rtbassoc-781d0d1a',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Disassociates a CIDR block from a subnet. Currently, you can disassociate an IPv6 CIDR block only. You must detach or delete all gateways and resources that are associated with the CIDR block before you can disassociate it.
See also: AWS API Documentation
Request Syntax
response = client.disassociate_subnet_cidr_block(
AssociationId='string'
)
[REQUIRED]
The association ID for the CIDR block.
{
'Ipv6CidrBlockAssociation': {
'AssociationId': 'string',
'Ipv6CidrBlock': 'string',
'Ipv6CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
}
},
'SubnetId': 'string'
}
Response Structure
Information about the IPv6 CIDR block association.
The association ID for the CIDR block.
The IPv6 CIDR block.
Information about the state of the CIDR block.
The state of a CIDR block.
A message about the status of the CIDR block, if applicable.
The ID of the subnet.
Disassociates a resource attachment from a transit gateway route table.
See also: AWS API Documentation
Request Syntax
response = client.disassociate_transit_gateway_route_table(
TransitGatewayRouteTableId='string',
TransitGatewayAttachmentId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the transit gateway route table.
[REQUIRED]
The ID of the attachment.
dict
Response Syntax
{
'Association': {
'TransitGatewayRouteTableId': 'string',
'TransitGatewayAttachmentId': 'string',
'ResourceId': 'string',
'ResourceType': 'vpc'|'vpn'|'direct-connect-gateway',
'State': 'associating'|'associated'|'disassociating'|'disassociated'
}
}
Response Structure
(dict) --
Association (dict) --
Information about the association.
TransitGatewayRouteTableId (string) --
The ID of the transit gateway route table.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
ResourceId (string) --
The ID of the resource.
ResourceType (string) --
The resource type.
State (string) --
The state of the association.
Disassociates a CIDR block from a VPC. To disassociate the CIDR block, you must specify its association ID. You can get the association ID by using DescribeVpcs . You must detach or delete all gateways and resources that are associated with the CIDR block before you can disassociate it.
You cannot disassociate the CIDR block with which you originally created the VPC (the primary CIDR block).
See also: AWS API Documentation
Request Syntax
response = client.disassociate_vpc_cidr_block(
AssociationId='string'
)
[REQUIRED]
The association ID for the CIDR block.
{
'Ipv6CidrBlockAssociation': {
'AssociationId': 'string',
'Ipv6CidrBlock': 'string',
'Ipv6CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
}
},
'CidrBlockAssociation': {
'AssociationId': 'string',
'CidrBlock': 'string',
'CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
}
},
'VpcId': 'string'
}
Response Structure
Information about the IPv6 CIDR block association.
The association ID for the IPv6 CIDR block.
The IPv6 CIDR block.
Information about the state of the CIDR block.
The state of the CIDR block.
A message about the status of the CIDR block, if applicable.
Information about the IPv4 CIDR block association.
The association ID for the IPv4 CIDR block.
The IPv4 CIDR block.
Information about the state of the CIDR block.
The state of the CIDR block.
A message about the status of the CIDR block, if applicable.
The ID of the VPC.
Enables EBS encryption by default for your account in the current Region.
After you enable encryption by default, the EBS volumes that you create are are always encrypted, either using the default CMK or the CMK that you specified when you created each volume. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
You can specify the default CMK for encryption by default using ModifyEbsDefaultKmsKeyId or ResetEbsDefaultKmsKeyId .
Enabling encryption by default has no effect on the encryption status of your existing volumes.
After you enable encryption by default, you can no longer launch instances using instance types that do not support encryption. For more information, see Supported Instance Types .
See also: AWS API Documentation
Request Syntax
response = client.enable_ebs_encryption_by_default(
DryRun=True|False
)
{
'EbsEncryptionByDefault': True|False
}
Response Structure
The updated status of encryption by default.
Enables the specified attachment to propagate routes to the specified propagation route table.
See also: AWS API Documentation
Request Syntax
response = client.enable_transit_gateway_route_table_propagation(
TransitGatewayRouteTableId='string',
TransitGatewayAttachmentId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the propagation route table.
[REQUIRED]
The ID of the attachment.
dict
Response Syntax
{
'Propagation': {
'TransitGatewayAttachmentId': 'string',
'ResourceId': 'string',
'ResourceType': 'vpc'|'vpn'|'direct-connect-gateway',
'TransitGatewayRouteTableId': 'string',
'State': 'enabling'|'enabled'|'disabling'|'disabled'
}
}
Response Structure
(dict) --
Propagation (dict) --
Information about route propagation.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
ResourceId (string) --
The ID of the resource.
ResourceType (string) --
The resource type.
TransitGatewayRouteTableId (string) --
The ID of the transit gateway route table.
State (string) --
The state.
Enables a virtual private gateway (VGW) to propagate routes to the specified route table of a VPC.
See also: AWS API Documentation
Request Syntax
response = client.enable_vgw_route_propagation(
GatewayId='string',
RouteTableId='string'
)
[REQUIRED]
The ID of the virtual private gateway that is attached to a VPC. The virtual private gateway must be attached to the same VPC that the routing tables are associated with.
[REQUIRED]
The ID of the route table. The routing table must be associated with the same VPC that the virtual private gateway is attached to.
None
Examples
This example enables the specified virtual private gateway to propagate static routes to the specified route table.
response = client.enable_vgw_route_propagation(
GatewayId='vgw-9a4cacf3',
RouteTableId='rtb-22574640',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Enables I/O operations for a volume that had I/O operations disabled because the data on the volume was potentially inconsistent.
See also: AWS API Documentation
Request Syntax
response = client.enable_volume_io(
DryRun=True|False,
VolumeId='string'
)
[REQUIRED]
The ID of the volume.
None
Examples
This example enables I/O on volume vol-1234567890abcdef0.
response = client.enable_volume_io(
VolumeId='vol-1234567890abcdef0',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Enables a VPC for ClassicLink. You can then link EC2-Classic instances to your ClassicLink-enabled VPC to allow communication over private IP addresses. You cannot enable your VPC for ClassicLink if any of your VPC route tables have existing routes for address ranges within the 10.0.0.0/8 IP address range, excluding local routes for VPCs in the 10.0.0.0/16 and 10.1.0.0/16 IP address ranges. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.enable_vpc_classic_link(
DryRun=True|False,
VpcId='string'
)
[REQUIRED]
The ID of the VPC.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Enables a VPC to support DNS hostname resolution for ClassicLink. If enabled, the DNS hostname of a linked EC2-Classic instance resolves to its private IP address when addressed from an instance in the VPC to which it's linked. Similarly, the DNS hostname of an instance in a VPC resolves to its private IP address when addressed from a linked EC2-Classic instance. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.enable_vpc_classic_link_dns_support(
VpcId='string'
)
{
'Return': True|False
}
Response Structure
Returns true if the request succeeds; otherwise, it returns an error.
Downloads the client certificate revocation list for the specified Client VPN endpoint.
See also: AWS API Documentation
Request Syntax
response = client.export_client_vpn_client_certificate_revocation_list(
ClientVpnEndpointId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the Client VPN endpoint.
dict
Response Syntax
{
'CertificateRevocationList': 'string',
'Status': {
'Code': 'pending'|'active',
'Message': 'string'
}
}
Response Structure
(dict) --
CertificateRevocationList (string) --
Information about the client certificate revocation list.
Status (dict) --
The current state of the client certificate revocation list.
Code (string) --
The state of the client certificate revocation list.
Message (string) --
A message about the status of the client certificate revocation list, if applicable.
Downloads the contents of the Client VPN endpoint configuration file for the specified Client VPN endpoint. The Client VPN endpoint configuration file includes the Client VPN endpoint and certificate information clients need to establish a connection with the Client VPN endpoint.
See also: AWS API Documentation
Request Syntax
response = client.export_client_vpn_client_configuration(
ClientVpnEndpointId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the Client VPN endpoint.
dict
Response Syntax
{
'ClientConfiguration': 'string'
}
Response Structure
(dict) --
ClientConfiguration (string) --
The contents of the Client VPN endpoint configuration file.
Exports routes from the specified transit gateway route table to the specified S3 bucket. By default, all routes are exported. Alternatively, you can filter by CIDR range.
See also: AWS API Documentation
Request Syntax
response = client.export_transit_gateway_routes(
TransitGatewayRouteTableId='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
S3Bucket='string',
DryRun=True|False
)
[REQUIRED]
The ID of the route table.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
[REQUIRED]
The name of the S3 bucket.
dict
Response Syntax
{
'S3Location': 'string'
}
Response Structure
(dict) --
S3Location (string) --
The URL of the exported file in Amazon S3. For example, s3://bucket_name /VPCTransitGateway/TransitGatewayRouteTables/file_name .
Generate a presigned url given a client, its method, and arguments
The presigned url
Gets the console output for the specified instance. For Linux instances, the instance console output displays the exact console output that would normally be displayed on a physical monitor attached to a computer. For Windows instances, the instance console output includes the last three system event log errors.
By default, the console output returns buffered information that was posted shortly after an instance transition state (start, stop, reboot, or terminate). This information is available for at least one hour after the most recent post. Only the most recent 64 KB of console output is available.
You can optionally retrieve the latest serial console output at any time during the instance lifecycle. This option is supported on instance types that use the Nitro hypervisor.
For more information, see Instance Console Output in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.get_console_output(
InstanceId='string',
DryRun=True|False,
Latest=True|False
)
[REQUIRED]
The ID of the instance.
When enabled, retrieves the latest console output for the instance.
Default: disabled (false )
dict
Response Syntax
{
'InstanceId': 'string',
'Output': 'string',
'Timestamp': datetime(2015, 1, 1)
}
Response Structure
(dict) --
InstanceId (string) --
The ID of the instance.
Output (string) --
The console output, base64-encoded. If you are using a command line tool, the tool decodes the output for you.
Timestamp (datetime) --
The time at which the output was last updated.
Retrieve a JPG-format screenshot of a running instance to help with troubleshooting.
The returned content is Base64-encoded.
See also: AWS API Documentation
Request Syntax
response = client.get_console_screenshot(
DryRun=True|False,
InstanceId='string',
WakeUp=True|False
)
[REQUIRED]
The ID of the instance.
dict
Response Syntax
{
'ImageData': 'string',
'InstanceId': 'string'
}
Response Structure
(dict) --
ImageData (string) --
The data that comprises the image.
InstanceId (string) --
The ID of the instance.
Describes the default customer master key (CMK) for EBS encryption by default for your account in this Region. You can change the default CMK for encryption by default using ModifyEbsDefaultKmsKeyId or ResetEbsDefaultKmsKeyId .
For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.get_ebs_default_kms_key_id(
DryRun=True|False
)
{
'KmsKeyId': 'string'
}
Response Structure
The Amazon Resource Name (ARN) of the default CMK for encryption by default.
Describes whether EBS encryption by default is enabled for your account in the current Region.
For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.get_ebs_encryption_by_default(
DryRun=True|False
)
{
'EbsEncryptionByDefault': True|False
}
Response Structure
Indicates whether encryption by default is enabled.
Preview a reservation purchase with configurations that match those of your Dedicated Host. You must have active Dedicated Hosts in your account before you purchase a reservation.
This is a preview of the PurchaseHostReservation action and does not result in the offering being purchased.
See also: AWS API Documentation
Request Syntax
response = client.get_host_reservation_purchase_preview(
HostIdSet=[
'string',
],
OfferingId='string'
)
[REQUIRED]
The IDs of the Dedicated Hosts with which the reservation is associated.
[REQUIRED]
The offering ID of the reservation.
dict
Response Syntax
{
'CurrencyCode': 'USD',
'Purchase': [
{
'CurrencyCode': 'USD',
'Duration': 123,
'HostIdSet': [
'string',
],
'HostReservationId': 'string',
'HourlyPrice': 'string',
'InstanceFamily': 'string',
'PaymentOption': 'AllUpfront'|'PartialUpfront'|'NoUpfront',
'UpfrontPrice': 'string'
},
],
'TotalHourlyPrice': 'string',
'TotalUpfrontPrice': 'string'
}
Response Structure
(dict) --
CurrencyCode (string) --
The currency in which the totalUpfrontPrice and totalHourlyPrice amounts are specified. At this time, the only supported currency is USD .
Purchase (list) --
The purchase information of the Dedicated Host reservation and the Dedicated Hosts associated with it.
(dict) --
Describes the result of the purchase.
CurrencyCode (string) --
The currency in which the UpfrontPrice and HourlyPrice amounts are specified. At this time, the only supported currency is USD .
Duration (integer) --
The duration of the reservation's term in seconds.
HostIdSet (list) --
The IDs of the Dedicated Hosts associated with the reservation.
HostReservationId (string) --
The ID of the reservation.
HourlyPrice (string) --
The hourly price of the reservation per hour.
InstanceFamily (string) --
The instance family on the Dedicated Host that the reservation can be associated with.
PaymentOption (string) --
The payment option for the reservation.
UpfrontPrice (string) --
The upfront price of the reservation.
TotalHourlyPrice (string) --
The potential total hourly price of the reservation per hour.
TotalUpfrontPrice (string) --
The potential total upfront price. This is billed immediately.
Retrieves the configuration data of the specified instance. You can use this data to create a launch template.
See also: AWS API Documentation
Request Syntax
response = client.get_launch_template_data(
DryRun=True|False,
InstanceId='string'
)
[REQUIRED]
The ID of the instance.
dict
Response Syntax
{
'LaunchTemplateData': {
'KernelId': 'string',
'EbsOptimized': True|False,
'IamInstanceProfile': {
'Arn': 'string',
'Name': 'string'
},
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'Encrypted': True|False,
'DeleteOnTermination': True|False,
'Iops': 123,
'KmsKeyId': 'string',
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1'
},
'NoDevice': 'string'
},
],
'NetworkInterfaces': [
{
'AssociatePublicIpAddress': True|False,
'DeleteOnTermination': True|False,
'Description': 'string',
'DeviceIndex': 123,
'Groups': [
'string',
],
'InterfaceType': 'string',
'Ipv6AddressCount': 123,
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'NetworkInterfaceId': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
'SecondaryPrivateIpAddressCount': 123,
'SubnetId': 'string'
},
],
'ImageId': 'string',
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'KeyName': 'string',
'Monitoring': {
'Enabled': True|False
},
'Placement': {
'AvailabilityZone': 'string',
'Affinity': 'string',
'GroupName': 'string',
'HostId': 'string',
'Tenancy': 'default'|'dedicated'|'host',
'SpreadDomain': 'string'
},
'RamDiskId': 'string',
'DisableApiTermination': True|False,
'InstanceInitiatedShutdownBehavior': 'stop'|'terminate',
'UserData': 'string',
'TagSpecifications': [
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'ElasticGpuSpecifications': [
{
'Type': 'string'
},
],
'ElasticInferenceAccelerators': [
{
'Type': 'string'
},
],
'SecurityGroupIds': [
'string',
],
'SecurityGroups': [
'string',
],
'InstanceMarketOptions': {
'MarketType': 'spot',
'SpotOptions': {
'MaxPrice': 'string',
'SpotInstanceType': 'one-time'|'persistent',
'BlockDurationMinutes': 123,
'ValidUntil': datetime(2015, 1, 1),
'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate'
}
},
'CreditSpecification': {
'CpuCredits': 'string'
},
'CpuOptions': {
'CoreCount': 123,
'ThreadsPerCore': 123
},
'CapacityReservationSpecification': {
'CapacityReservationPreference': 'open'|'none',
'CapacityReservationTarget': {
'CapacityReservationId': 'string'
}
},
'LicenseSpecifications': [
{
'LicenseConfigurationArn': 'string'
},
],
'HibernationOptions': {
'Configured': True|False
}
}
}
Response Structure
(dict) --
LaunchTemplateData (dict) --
The instance data.
KernelId (string) --
The ID of the kernel, if applicable.
EbsOptimized (boolean) --
Indicates whether the instance is optimized for Amazon EBS I/O.
IamInstanceProfile (dict) --
The IAM instance profile.
Arn (string) --
The Amazon Resource Name (ARN) of the instance profile.
Name (string) --
The name of the instance profile.
BlockDeviceMappings (list) --
The block device mappings.
(dict) --
Describes a block device mapping.
DeviceName (string) --
The device name.
VirtualName (string) --
The virtual device name (ephemeralN).
Ebs (dict) --
Information about the block device for an EBS volume.
Encrypted (boolean) --
Indicates whether the EBS volume is encrypted.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports.
KmsKeyId (string) --
The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption.
SnapshotId (string) --
The ID of the snapshot.
VolumeSize (integer) --
The size of the volume, in GiB.
VolumeType (string) --
The volume type.
NoDevice (string) --
Suppresses the specified device included in the block device mapping of the AMI.
NetworkInterfaces (list) --
The network interfaces.
(dict) --
Describes a network interface.
AssociatePublicIpAddress (boolean) --
Indicates whether to associate a public IPv4 address with eth0 for a new network interface.
DeleteOnTermination (boolean) --
Indicates whether the network interface is deleted when the instance is terminated.
Description (string) --
A description for the network interface.
DeviceIndex (integer) --
The device index for the network interface attachment.
Groups (list) --
The IDs of one or more security groups.
InterfaceType (string) --
The type of network interface.
Ipv6AddressCount (integer) --
The number of IPv6 addresses for the network interface.
Ipv6Addresses (list) --
The IPv6 addresses for the network interface.
(dict) --
Describes an IPv6 address.
Ipv6Address (string) --
The IPv6 address.
NetworkInterfaceId (string) --
The ID of the network interface.
PrivateIpAddress (string) --
The primary private IPv4 address of the network interface.
PrivateIpAddresses (list) --
One or more private IPv4 addresses.
(dict) --
Describes a secondary private IPv4 address for a network interface.
Primary (boolean) --
Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.
PrivateIpAddress (string) --
The private IPv4 addresses.
SecondaryPrivateIpAddressCount (integer) --
The number of secondary private IPv4 addresses for the network interface.
SubnetId (string) --
The ID of the subnet for the network interface.
ImageId (string) --
The ID of the AMI that was used to launch the instance.
InstanceType (string) --
The instance type.
KeyName (string) --
The name of the key pair.
Monitoring (dict) --
The monitoring for the instance.
Enabled (boolean) --
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
Placement (dict) --
The placement of the instance.
AvailabilityZone (string) --
The Availability Zone of the instance.
Affinity (string) --
The affinity setting for the instance on the Dedicated Host.
GroupName (string) --
The name of the placement group for the instance.
HostId (string) --
The ID of the Dedicated Host for the instance.
Tenancy (string) --
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware.
SpreadDomain (string) --
Reserved for future use.
RamDiskId (string) --
The ID of the RAM disk, if applicable.
DisableApiTermination (boolean) --
If set to true , indicates that the instance cannot be terminated using the Amazon EC2 console, command line tool, or API.
InstanceInitiatedShutdownBehavior (string) --
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
UserData (string) --
The user data for the instance.
TagSpecifications (list) --
The tags.
(dict) --
The tag specification for the launch template.
ResourceType (string) --
The type of resource.
Tags (list) --
The tags for the resource.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
ElasticGpuSpecifications (list) --
The elastic GPU specification.
(dict) --
Describes an elastic GPU.
Type (string) --
The elastic GPU type.
ElasticInferenceAccelerators (list) --
The elastic inference accelerator for the instance.
(dict) --
Describes an elastic inference accelerator.
Type (string) --
The type of elastic inference accelerator. The possible values are eia1.medium, eia1.large, and eia1.xlarge.
SecurityGroupIds (list) --
The security group IDs.
SecurityGroups (list) --
The security group names.
InstanceMarketOptions (dict) --
The market (purchasing) option for the instances.
MarketType (string) --
The market type.
SpotOptions (dict) --
The options for Spot Instances.
MaxPrice (string) --
The maximum hourly price you're willing to pay for the Spot Instances.
SpotInstanceType (string) --
The Spot Instance request type.
BlockDurationMinutes (integer) --
The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).
ValidUntil (datetime) --
The end date of the request. For a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached.
InstanceInterruptionBehavior (string) --
The behavior when a Spot Instance is interrupted.
CreditSpecification (dict) --
The credit option for CPU usage of the instance.
CpuCredits (string) --
The credit option for CPU usage of a T2 or T3 instance. Valid values are standard and unlimited .
CpuOptions (dict) --
The CPU options for the instance. For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide .
CoreCount (integer) --
The number of CPU cores for the instance.
ThreadsPerCore (integer) --
The number of threads per CPU core.
CapacityReservationSpecification (dict) --
Information about the Capacity Reservation targeting option.
CapacityReservationPreference (string) --
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
CapacityReservationTarget (dict) --
Information about the target Capacity Reservation.
CapacityReservationId (string) --
The ID of the Capacity Reservation.
LicenseSpecifications (list) --
The license configurations.
(dict) --
Describes a license configuration.
LicenseConfigurationArn (string) --
The Amazon Resource Name (ARN) of the license configuration.
HibernationOptions (dict) --
Indicates whether an instance is configured for hibernation. For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
Configured (boolean) --
If this parameter is set to true , the instance is enabled for hibernation; otherwise, it is not enabled for hibernation.
Create a paginator for an operation.
Retrieves the encrypted administrator password for a running Windows instance.
The Windows password is generated at boot by the EC2Config service or EC2Launch scripts (Windows Server 2016 and later). This usually only happens the first time an instance is launched. For more information, see EC2Config and EC2Launch in the Amazon Elastic Compute Cloud User Guide.
For the EC2Config service, the password is not generated for rebundled AMIs unless Ec2SetPassword is enabled before bundling.
The password is encrypted using the key pair that you specified when you launched the instance. You must provide the corresponding key pair file.
When you launch an instance, password generation and encryption may take a few minutes. If you try to retrieve the password before it's available, the output returns an empty string. We recommend that you wait up to 15 minutes after launching an instance before trying to retrieve the generated password.
See also: AWS API Documentation
Request Syntax
response = client.get_password_data(
InstanceId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the Windows instance.
dict
Response Syntax
{
'InstanceId': 'string',
'PasswordData': 'string',
'Timestamp': datetime(2015, 1, 1)
}
Response Structure
(dict) --
InstanceId (string) --
The ID of the Windows instance.
PasswordData (string) --
The password of the instance. Returns an empty string if the password is not available.
Timestamp (datetime) --
The time the data was last updated.
Returns a quote and exchange information for exchanging one or more specified Convertible Reserved Instances for a new Convertible Reserved Instance. If the exchange cannot be performed, the reason is returned in the response. Use AcceptReservedInstancesExchangeQuote to perform the exchange.
See also: AWS API Documentation
Request Syntax
response = client.get_reserved_instances_exchange_quote(
DryRun=True|False,
ReservedInstanceIds=[
'string',
],
TargetConfigurations=[
{
'InstanceCount': 123,
'OfferingId': 'string'
},
]
)
[REQUIRED]
The IDs of the Convertible Reserved Instances to exchange.
The configuration of the target Convertible Reserved Instance to exchange for your current Convertible Reserved Instances.
Details about the target configuration.
The number of instances the Covertible Reserved Instance offering can be applied to. This parameter is reserved and cannot be specified in a request
The Convertible Reserved Instance offering ID.
dict
Response Syntax
{
'CurrencyCode': 'string',
'IsValidExchange': True|False,
'OutputReservedInstancesWillExpireAt': datetime(2015, 1, 1),
'PaymentDue': 'string',
'ReservedInstanceValueRollup': {
'HourlyPrice': 'string',
'RemainingTotalValue': 'string',
'RemainingUpfrontValue': 'string'
},
'ReservedInstanceValueSet': [
{
'ReservationValue': {
'HourlyPrice': 'string',
'RemainingTotalValue': 'string',
'RemainingUpfrontValue': 'string'
},
'ReservedInstanceId': 'string'
},
],
'TargetConfigurationValueRollup': {
'HourlyPrice': 'string',
'RemainingTotalValue': 'string',
'RemainingUpfrontValue': 'string'
},
'TargetConfigurationValueSet': [
{
'ReservationValue': {
'HourlyPrice': 'string',
'RemainingTotalValue': 'string',
'RemainingUpfrontValue': 'string'
},
'TargetConfiguration': {
'InstanceCount': 123,
'OfferingId': 'string'
}
},
],
'ValidationFailureReason': 'string'
}
Response Structure
(dict) --
Contains the output of GetReservedInstancesExchangeQuote.
CurrencyCode (string) --
The currency of the transaction.
IsValidExchange (boolean) --
If true , the exchange is valid. If false , the exchange cannot be completed.
OutputReservedInstancesWillExpireAt (datetime) --
The new end date of the reservation term.
PaymentDue (string) --
The total true upfront charge for the exchange.
ReservedInstanceValueRollup (dict) --
The cost associated with the Reserved Instance.
HourlyPrice (string) --
The hourly rate of the reservation.
RemainingTotalValue (string) --
The balance of the total value (the sum of remainingUpfrontValue + hourlyPrice * number of hours remaining).
RemainingUpfrontValue (string) --
The remaining upfront cost of the reservation.
ReservedInstanceValueSet (list) --
The configuration of your Convertible Reserved Instances.
(dict) --
The total value of the Convertible Reserved Instance.
ReservationValue (dict) --
The total value of the Convertible Reserved Instance that you are exchanging.
HourlyPrice (string) --
The hourly rate of the reservation.
RemainingTotalValue (string) --
The balance of the total value (the sum of remainingUpfrontValue + hourlyPrice * number of hours remaining).
RemainingUpfrontValue (string) --
The remaining upfront cost of the reservation.
ReservedInstanceId (string) --
The ID of the Convertible Reserved Instance that you are exchanging.
TargetConfigurationValueRollup (dict) --
The cost associated with the Reserved Instance.
HourlyPrice (string) --
The hourly rate of the reservation.
RemainingTotalValue (string) --
The balance of the total value (the sum of remainingUpfrontValue + hourlyPrice * number of hours remaining).
RemainingUpfrontValue (string) --
The remaining upfront cost of the reservation.
TargetConfigurationValueSet (list) --
The values of the target Convertible Reserved Instances.
(dict) --
The total value of the new Convertible Reserved Instances.
ReservationValue (dict) --
The total value of the Convertible Reserved Instances that make up the exchange. This is the sum of the list value, remaining upfront price, and additional upfront cost of the exchange.
HourlyPrice (string) --
The hourly rate of the reservation.
RemainingTotalValue (string) --
The balance of the total value (the sum of remainingUpfrontValue + hourlyPrice * number of hours remaining).
RemainingUpfrontValue (string) --
The remaining upfront cost of the reservation.
TargetConfiguration (dict) --
The configuration of the Convertible Reserved Instances that make up the exchange.
InstanceCount (integer) --
The number of instances the Convertible Reserved Instance offering can be applied to. This parameter is reserved and cannot be specified in a request
OfferingId (string) --
The ID of the Convertible Reserved Instance offering.
ValidationFailureReason (string) --
Describes the reason why the exchange cannot be completed.
Lists the route tables to which the specified resource attachment propagates routes.
See also: AWS API Documentation
Request Syntax
response = client.get_transit_gateway_attachment_propagations(
TransitGatewayAttachmentId='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string',
DryRun=True|False
)
[REQUIRED]
The ID of the attachment.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'TransitGatewayAttachmentPropagations': [
{
'TransitGatewayRouteTableId': 'string',
'State': 'enabling'|'enabled'|'disabling'|'disabled'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
TransitGatewayAttachmentPropagations (list) --
Information about the propagation route tables.
(dict) --
Describes a propagation route table.
TransitGatewayRouteTableId (string) --
The ID of the propagation route table.
State (string) --
The state of the propagation route table.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Gets information about the associations for the specified transit gateway route table.
See also: AWS API Documentation
Request Syntax
response = client.get_transit_gateway_route_table_associations(
TransitGatewayRouteTableId='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string',
DryRun=True|False
)
[REQUIRED]
The ID of the transit gateway route table.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'Associations': [
{
'TransitGatewayAttachmentId': 'string',
'ResourceId': 'string',
'ResourceType': 'vpc'|'vpn'|'direct-connect-gateway',
'State': 'associating'|'associated'|'disassociating'|'disassociated'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Associations (list) --
Information about the associations.
(dict) --
Describes an association between a route table and a resource attachment.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
ResourceId (string) --
The ID of the resource.
ResourceType (string) --
The resource type.
State (string) --
The state of the association.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Gets information about the route table propagations for the specified transit gateway route table.
See also: AWS API Documentation
Request Syntax
response = client.get_transit_gateway_route_table_propagations(
TransitGatewayRouteTableId='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string',
DryRun=True|False
)
[REQUIRED]
The ID of the transit gateway route table.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'TransitGatewayRouteTablePropagations': [
{
'TransitGatewayAttachmentId': 'string',
'ResourceId': 'string',
'ResourceType': 'vpc'|'vpn'|'direct-connect-gateway',
'State': 'enabling'|'enabled'|'disabling'|'disabled'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
TransitGatewayRouteTablePropagations (list) --
Information about the route table propagations.
(dict) --
Describes a route table propagation.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
ResourceId (string) --
The ID of the resource.
ResourceType (string) --
The type of resource.
State (string) --
The state of the resource.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Returns an object that can wait for some condition.
Uploads a client certificate revocation list to the specified Client VPN endpoint. Uploading a client certificate revocation list overwrites the existing client certificate revocation list.
Uploading a client certificate revocation list resets existing client connections.
See also: AWS API Documentation
Request Syntax
response = client.import_client_vpn_client_certificate_revocation_list(
ClientVpnEndpointId='string',
CertificateRevocationList='string',
DryRun=True|False
)
[REQUIRED]
The ID of the Client VPN endpoint to which the client certificate revocation list applies.
[REQUIRED]
The client certificate revocation list file. For more information, see Generate a Client Certificate Revocation List in the AWS Client VPN Administrator Guide .
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Import single or multi-volume disk images or EBS snapshots into an Amazon Machine Image (AMI). For more information, see Importing a VM as an Image Using VM Import/Export in the VM Import/Export User Guide .
See also: AWS API Documentation
Request Syntax
response = client.import_image(
Architecture='string',
ClientData={
'Comment': 'string',
'UploadEnd': datetime(2015, 1, 1),
'UploadSize': 123.0,
'UploadStart': datetime(2015, 1, 1)
},
ClientToken='string',
Description='string',
DiskContainers=[
{
'Description': 'string',
'DeviceName': 'string',
'Format': 'string',
'SnapshotId': 'string',
'Url': 'string',
'UserBucket': {
'S3Bucket': 'string',
'S3Key': 'string'
}
},
],
DryRun=True|False,
Encrypted=True|False,
Hypervisor='string',
KmsKeyId='string',
LicenseType='string',
Platform='string',
RoleName='string'
)
The architecture of the virtual machine.
Valid values: i386 | x86_64 | arm64
The client-specific data.
A user-defined comment about the disk upload.
The time that the disk upload ends.
The size of the uploaded disk image, in GiB.
The time that the disk upload starts.
Information about the disk containers.
Describes the disk container object for an import image task.
The description of the disk image.
The block device mapping for the disk.
The format of the disk image being imported.
Valid values: VHD | VMDK | OVA
The ID of the EBS snapshot to be used for importing the snapshot.
The URL to the Amazon S3-based disk image being imported. The URL can either be a https URL (https://..) or an Amazon S3 URL (s3://..)
The S3 bucket for the disk image.
The name of the S3 bucket where the disk image is located.
The file name of the disk image.
The target hypervisor platform.
Valid values: xen
An identifier for the AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted AMI. This parameter is only required if you want to use a non-default CMK; if this parameter is not specified, the default CMK for EBS is used. If a KmsKeyId is specified, the Encrypted flag must also be set.
The CMK identifier may be provided in any of the following formats:
AWS parses KmsKeyId asynchronously, meaning that the action you call may appear to complete even though you provided an invalid identifier. This action will eventually report failure.
The specified CMK must exist in the Region that the AMI is being copied to.
The license type to be used for the Amazon Machine Image (AMI) after importing.
By default, we detect the source-system operating system (OS) and apply the appropriate license. Specify AWS to replace the source-system license with an AWS license, if appropriate. Specify BYOL to retain the source-system license, if appropriate.
To use BYOL , you must have existing licenses with rights to use these licenses in a third party cloud, such as AWS. For more information, see Prerequisites in the VM Import/Export User Guide.
The operating system of the virtual machine.
Valid values: Windows | Linux
dict
Response Syntax
{
'Architecture': 'string',
'Description': 'string',
'Encrypted': True|False,
'Hypervisor': 'string',
'ImageId': 'string',
'ImportTaskId': 'string',
'KmsKeyId': 'string',
'LicenseType': 'string',
'Platform': 'string',
'Progress': 'string',
'SnapshotDetails': [
{
'Description': 'string',
'DeviceName': 'string',
'DiskImageSize': 123.0,
'Format': 'string',
'Progress': 'string',
'SnapshotId': 'string',
'Status': 'string',
'StatusMessage': 'string',
'Url': 'string',
'UserBucket': {
'S3Bucket': 'string',
'S3Key': 'string'
}
},
],
'Status': 'string',
'StatusMessage': 'string'
}
Response Structure
(dict) --
Architecture (string) --
The architecture of the virtual machine.
Description (string) --
A description of the import task.
Encrypted (boolean) --
Indicates whether the AMI is encypted.
Hypervisor (string) --
The target hypervisor of the import task.
ImageId (string) --
The ID of the Amazon Machine Image (AMI) created by the import task.
ImportTaskId (string) --
The task ID of the import image task.
KmsKeyId (string) --
The identifier for the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to create the encrypted AMI.
LicenseType (string) --
The license type of the virtual machine.
Platform (string) --
The operating system of the virtual machine.
Progress (string) --
The progress of the task.
SnapshotDetails (list) --
Information about the snapshots.
(dict) --
Describes the snapshot created from the imported disk.
Description (string) --
A description for the snapshot.
DeviceName (string) --
The block device mapping for the snapshot.
DiskImageSize (float) --
The size of the disk in the snapshot, in GiB.
Format (string) --
The format of the disk image from which the snapshot is created.
Progress (string) --
The percentage of progress for the task.
SnapshotId (string) --
The snapshot ID of the disk being imported.
Status (string) --
A brief status of the snapshot creation.
StatusMessage (string) --
A detailed status message for the snapshot creation.
Url (string) --
The URL used to access the disk image.
UserBucket (dict) --
The S3 bucket for the disk image.
S3Bucket (string) --
The S3 bucket from which the disk image was created.
S3Key (string) --
The file name of the disk image.
Status (string) --
A brief status of the task.
StatusMessage (string) --
A detailed status message of the import task.
Creates an import instance task using metadata from the specified disk image. ImportInstance only supports single-volume VMs. To import multi-volume VMs, use ImportImage . For more information, see Importing a Virtual Machine Using the Amazon EC2 CLI .
For information about the import manifest referenced by this API action, see VM Import Manifest .
See also: AWS API Documentation
Request Syntax
response = client.import_instance(
Description='string',
DiskImages=[
{
'Description': 'string',
'Image': {
'Bytes': 123,
'Format': 'VMDK'|'RAW'|'VHD',
'ImportManifestUrl': 'string'
},
'Volume': {
'Size': 123
}
},
],
DryRun=True|False,
LaunchSpecification={
'AdditionalInfo': 'string',
'Architecture': 'i386'|'x86_64'|'arm64',
'GroupIds': [
'string',
],
'GroupNames': [
'string',
],
'InstanceInitiatedShutdownBehavior': 'stop'|'terminate',
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'Monitoring': True|False,
'Placement': {
'AvailabilityZone': 'string',
'Affinity': 'string',
'GroupName': 'string',
'PartitionNumber': 123,
'HostId': 'string',
'Tenancy': 'default'|'dedicated'|'host',
'SpreadDomain': 'string'
},
'PrivateIpAddress': 'string',
'SubnetId': 'string',
'UserData': {
'Data': 'string'
}
},
Platform='Windows'
)
The disk image.
Describes a disk image.
A description of the disk image.
Information about the disk image.
The size of the disk image, in GiB.
The disk image format.
A presigned URL for the import manifest stored in Amazon S3 and presented here as an Amazon S3 presigned URL. For information about creating a presigned URL for an Amazon S3 object, read the "Query String Request Authentication Alternative" section of the Authenticating REST Requests topic in the Amazon Simple Storage Service Developer Guide .
For information about the import manifest referenced by this API action, see VM Import Manifest .
Information about the volume.
The size of the volume, in GiB.
The launch specification.
Reserved.
The architecture of the instance.
The security group IDs.
The security group names.
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
The instance type. For more information about the instance types that you can import, see Instance Types in the VM Import/Export User Guide.
Indicates whether monitoring is enabled.
The placement information for the instance.
The Availability Zone of the instance.
If not specified, an Availability Zone will be automatically chosen for you based on the load balancing criteria for the Region.
The affinity setting for the instance on the Dedicated Host. This parameter is not supported for the ImportInstance command.
The name of the placement group the instance is in.
The number of the partition the instance is in. Valid only if the placement group strategy is set to partition .
The ID of the Dedicated Host on which the instance resides. This parameter is not supported for the ImportInstance command.
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for the ImportInstance command.
Reserved for future use.
[EC2-VPC] An available IP address from the IP address range of the subnet.
[EC2-VPC] The ID of the subnet in which to launch the instance.
The Base64-encoded user data to make available to the instance.
The user data. If you are using an AWS SDK or command line tool, Base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide Base64-encoded text.
[REQUIRED]
The instance operating system.
dict
Response Syntax
{
'ConversionTask': {
'ConversionTaskId': 'string',
'ExpirationTime': 'string',
'ImportInstance': {
'Description': 'string',
'InstanceId': 'string',
'Platform': 'Windows',
'Volumes': [
{
'AvailabilityZone': 'string',
'BytesConverted': 123,
'Description': 'string',
'Image': {
'Checksum': 'string',
'Format': 'VMDK'|'RAW'|'VHD',
'ImportManifestUrl': 'string',
'Size': 123
},
'Status': 'string',
'StatusMessage': 'string',
'Volume': {
'Id': 'string',
'Size': 123
}
},
]
},
'ImportVolume': {
'AvailabilityZone': 'string',
'BytesConverted': 123,
'Description': 'string',
'Image': {
'Checksum': 'string',
'Format': 'VMDK'|'RAW'|'VHD',
'ImportManifestUrl': 'string',
'Size': 123
},
'Volume': {
'Id': 'string',
'Size': 123
}
},
'State': 'active'|'cancelling'|'cancelled'|'completed',
'StatusMessage': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
ConversionTask (dict) --
Information about the conversion task.
ConversionTaskId (string) --
The ID of the conversion task.
ExpirationTime (string) --
The time when the task expires. If the upload isn't complete before the expiration time, we automatically cancel the task.
ImportInstance (dict) --
If the task is for importing an instance, this contains information about the import instance task.
Description (string) --
A description of the task.
InstanceId (string) --
The ID of the instance.
Platform (string) --
The instance operating system.
Volumes (list) --
The volumes.
(dict) --
Describes an import volume task.
AvailabilityZone (string) --
The Availability Zone where the resulting instance will reside.
BytesConverted (integer) --
The number of bytes converted so far.
Description (string) --
A description of the task.
Image (dict) --
The image.
Checksum (string) --
The checksum computed for the disk image.
Format (string) --
The disk image format.
ImportManifestUrl (string) --
A presigned URL for the import manifest stored in Amazon S3. For information about creating a presigned URL for an Amazon S3 object, read the "Query String Request Authentication Alternative" section of the Authenticating REST Requests topic in the Amazon Simple Storage Service Developer Guide .
For information about the import manifest referenced by this API action, see VM Import Manifest .
Size (integer) --
The size of the disk image, in GiB.
Status (string) --
The status of the import of this particular disk image.
StatusMessage (string) --
The status information or errors related to the disk image.
Volume (dict) --
The volume.
Id (string) --
The volume identifier.
Size (integer) --
The size of the volume, in GiB.
ImportVolume (dict) --
If the task is for importing a volume, this contains information about the import volume task.
AvailabilityZone (string) --
The Availability Zone where the resulting volume will reside.
BytesConverted (integer) --
The number of bytes converted so far.
Description (string) --
The description you provided when starting the import volume task.
Image (dict) --
The image.
Checksum (string) --
The checksum computed for the disk image.
Format (string) --
The disk image format.
ImportManifestUrl (string) --
A presigned URL for the import manifest stored in Amazon S3. For information about creating a presigned URL for an Amazon S3 object, read the "Query String Request Authentication Alternative" section of the Authenticating REST Requests topic in the Amazon Simple Storage Service Developer Guide .
For information about the import manifest referenced by this API action, see VM Import Manifest .
Size (integer) --
The size of the disk image, in GiB.
Volume (dict) --
The volume.
Id (string) --
The volume identifier.
Size (integer) --
The size of the volume, in GiB.
State (string) --
The state of the conversion task.
StatusMessage (string) --
The status message related to the conversion task.
Tags (list) --
Any tags assigned to the task.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Imports the public key from an RSA key pair that you created with a third-party tool. Compare this with CreateKeyPair , in which AWS creates the key pair and gives the keys to you (AWS keeps a copy of the public key). With ImportKeyPair, you create the key pair and give AWS just the public key. The private key is never transferred between you and AWS.
For more information about key pairs, see Key Pairs in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.import_key_pair(
DryRun=True|False,
KeyName='string',
PublicKeyMaterial=b'bytes'
)
[REQUIRED]
A unique name for the key pair.
[REQUIRED]
The public key. For API calls, the text must be base64-encoded. For command line tools, base64 encoding is performed for you.
dict
Response Syntax
{
'KeyFingerprint': 'string',
'KeyName': 'string'
}
Response Structure
(dict) --
KeyFingerprint (string) --
The MD5 public key fingerprint as specified in section 4 of RFC 4716.
KeyName (string) --
The key pair name you provided.
Imports a disk into an EBS snapshot.
See also: AWS API Documentation
Request Syntax
response = client.import_snapshot(
ClientData={
'Comment': 'string',
'UploadEnd': datetime(2015, 1, 1),
'UploadSize': 123.0,
'UploadStart': datetime(2015, 1, 1)
},
ClientToken='string',
Description='string',
DiskContainer={
'Description': 'string',
'Format': 'string',
'Url': 'string',
'UserBucket': {
'S3Bucket': 'string',
'S3Key': 'string'
}
},
DryRun=True|False,
Encrypted=True|False,
KmsKeyId='string',
RoleName='string'
)
The client-specific data.
A user-defined comment about the disk upload.
The time that the disk upload ends.
The size of the uploaded disk image, in GiB.
The time that the disk upload starts.
Information about the disk container.
The description of the disk image being imported.
The format of the disk image being imported.
Valid values: VHD | VMDK
The URL to the Amazon S3-based disk image being imported. It can either be a https URL (https://..) or an Amazon S3 URL (s3://..).
The S3 bucket for the disk image.
The name of the S3 bucket where the disk image is located.
The file name of the disk image.
An identifier for the AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted snapshot. This parameter is only required if you want to use a non-default CMK; if this parameter is not specified, the default CMK for EBS is used. If a KmsKeyId is specified, the Encrypted flag must also be set.
The CMK identifier may be provided in any of the following formats:
AWS parses KmsKeyId asynchronously, meaning that the action you call may appear to complete even though you provided an invalid identifier. This action will eventually report failure.
The specified CMK must exist in the Region that the snapshot is being copied to.
dict
Response Syntax
{
'Description': 'string',
'ImportTaskId': 'string',
'SnapshotTaskDetail': {
'Description': 'string',
'DiskImageSize': 123.0,
'Encrypted': True|False,
'Format': 'string',
'KmsKeyId': 'string',
'Progress': 'string',
'SnapshotId': 'string',
'Status': 'string',
'StatusMessage': 'string',
'Url': 'string',
'UserBucket': {
'S3Bucket': 'string',
'S3Key': 'string'
}
}
}
Response Structure
(dict) --
Description (string) --
A description of the import snapshot task.
ImportTaskId (string) --
The ID of the import snapshot task.
SnapshotTaskDetail (dict) --
Information about the import snapshot task.
Description (string) --
The description of the snapshot.
DiskImageSize (float) --
The size of the disk in the snapshot, in GiB.
Encrypted (boolean) --
Indicates whether the snapshot is encrypted.
Format (string) --
The format of the disk image from which the snapshot is created.
KmsKeyId (string) --
The identifier for the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to create the encrypted snapshot.
Progress (string) --
The percentage of completion for the import snapshot task.
SnapshotId (string) --
The snapshot ID of the disk being imported.
Status (string) --
A brief status for the import snapshot task.
StatusMessage (string) --
A detailed status message for the import snapshot task.
Url (string) --
The URL of the disk image from which the snapshot is created.
UserBucket (dict) --
The S3 bucket for the disk image.
S3Bucket (string) --
The S3 bucket from which the disk image was created.
S3Key (string) --
The file name of the disk image.
Creates an import volume task using metadata from the specified disk image.For more information, see Importing Disks to Amazon EBS .
For information about the import manifest referenced by this API action, see VM Import Manifest .
See also: AWS API Documentation
Request Syntax
response = client.import_volume(
AvailabilityZone='string',
Description='string',
DryRun=True|False,
Image={
'Bytes': 123,
'Format': 'VMDK'|'RAW'|'VHD',
'ImportManifestUrl': 'string'
},
Volume={
'Size': 123
}
)
[REQUIRED]
The Availability Zone for the resulting EBS volume.
[REQUIRED]
The disk image.
The size of the disk image, in GiB.
The disk image format.
A presigned URL for the import manifest stored in Amazon S3 and presented here as an Amazon S3 presigned URL. For information about creating a presigned URL for an Amazon S3 object, read the "Query String Request Authentication Alternative" section of the Authenticating REST Requests topic in the Amazon Simple Storage Service Developer Guide .
For information about the import manifest referenced by this API action, see VM Import Manifest .
[REQUIRED]
The volume size.
The size of the volume, in GiB.
dict
Response Syntax
{
'ConversionTask': {
'ConversionTaskId': 'string',
'ExpirationTime': 'string',
'ImportInstance': {
'Description': 'string',
'InstanceId': 'string',
'Platform': 'Windows',
'Volumes': [
{
'AvailabilityZone': 'string',
'BytesConverted': 123,
'Description': 'string',
'Image': {
'Checksum': 'string',
'Format': 'VMDK'|'RAW'|'VHD',
'ImportManifestUrl': 'string',
'Size': 123
},
'Status': 'string',
'StatusMessage': 'string',
'Volume': {
'Id': 'string',
'Size': 123
}
},
]
},
'ImportVolume': {
'AvailabilityZone': 'string',
'BytesConverted': 123,
'Description': 'string',
'Image': {
'Checksum': 'string',
'Format': 'VMDK'|'RAW'|'VHD',
'ImportManifestUrl': 'string',
'Size': 123
},
'Volume': {
'Id': 'string',
'Size': 123
}
},
'State': 'active'|'cancelling'|'cancelled'|'completed',
'StatusMessage': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
ConversionTask (dict) --
Information about the conversion task.
ConversionTaskId (string) --
The ID of the conversion task.
ExpirationTime (string) --
The time when the task expires. If the upload isn't complete before the expiration time, we automatically cancel the task.
ImportInstance (dict) --
If the task is for importing an instance, this contains information about the import instance task.
Description (string) --
A description of the task.
InstanceId (string) --
The ID of the instance.
Platform (string) --
The instance operating system.
Volumes (list) --
The volumes.
(dict) --
Describes an import volume task.
AvailabilityZone (string) --
The Availability Zone where the resulting instance will reside.
BytesConverted (integer) --
The number of bytes converted so far.
Description (string) --
A description of the task.
Image (dict) --
The image.
Checksum (string) --
The checksum computed for the disk image.
Format (string) --
The disk image format.
ImportManifestUrl (string) --
A presigned URL for the import manifest stored in Amazon S3. For information about creating a presigned URL for an Amazon S3 object, read the "Query String Request Authentication Alternative" section of the Authenticating REST Requests topic in the Amazon Simple Storage Service Developer Guide .
For information about the import manifest referenced by this API action, see VM Import Manifest .
Size (integer) --
The size of the disk image, in GiB.
Status (string) --
The status of the import of this particular disk image.
StatusMessage (string) --
The status information or errors related to the disk image.
Volume (dict) --
The volume.
Id (string) --
The volume identifier.
Size (integer) --
The size of the volume, in GiB.
ImportVolume (dict) --
If the task is for importing a volume, this contains information about the import volume task.
AvailabilityZone (string) --
The Availability Zone where the resulting volume will reside.
BytesConverted (integer) --
The number of bytes converted so far.
Description (string) --
The description you provided when starting the import volume task.
Image (dict) --
The image.
Checksum (string) --
The checksum computed for the disk image.
Format (string) --
The disk image format.
ImportManifestUrl (string) --
A presigned URL for the import manifest stored in Amazon S3. For information about creating a presigned URL for an Amazon S3 object, read the "Query String Request Authentication Alternative" section of the Authenticating REST Requests topic in the Amazon Simple Storage Service Developer Guide .
For information about the import manifest referenced by this API action, see VM Import Manifest .
Size (integer) --
The size of the disk image, in GiB.
Volume (dict) --
The volume.
Id (string) --
The volume identifier.
Size (integer) --
The size of the volume, in GiB.
State (string) --
The state of the conversion task.
StatusMessage (string) --
The status message related to the conversion task.
Tags (list) --
Any tags assigned to the task.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Modifies a Capacity Reservation's capacity and the conditions under which it is to be released. You cannot change a Capacity Reservation's instance type, EBS optimization, instance store settings, platform, Availability Zone, or instance eligibility. If you need to modify any of these attributes, we recommend that you cancel the Capacity Reservation, and then create a new one with the required attributes.
See also: AWS API Documentation
Request Syntax
response = client.modify_capacity_reservation(
CapacityReservationId='string',
InstanceCount=123,
EndDate=datetime(2015, 1, 1),
EndDateType='unlimited'|'limited',
DryRun=True|False
)
[REQUIRED]
The ID of the Capacity Reservation.
The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to expired when it reaches its end date and time.
The Capacity Reservation is cancelled within an hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55 on 5/31/2019.
You must provide an EndDate value if EndDateType is limited . Omit EndDate if EndDateType is unlimited .
Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following end types:
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Information about the Capacity Reservation.
Modifies the specified Client VPN endpoint. You can only modify an endpoint's server certificate information, client connection logging information, DNS server, and description. Modifying the DNS server resets existing client connections.
See also: AWS API Documentation
Request Syntax
response = client.modify_client_vpn_endpoint(
ClientVpnEndpointId='string',
ServerCertificateArn='string',
ConnectionLogOptions={
'Enabled': True|False,
'CloudwatchLogGroup': 'string',
'CloudwatchLogStream': 'string'
},
DnsServers={
'CustomDnsServers': [
'string',
],
'Enabled': True|False
},
Description='string',
DryRun=True|False
)
[REQUIRED]
The ID of the Client VPN endpoint to modify.
Information about the client connection logging options.
If you enable client connection logging, data about client connections is sent to a Cloudwatch Logs log stream. The following information is logged:
Indicates whether connection logging is enabled.
The name of the CloudWatch Logs log group.
The name of the CloudWatch Logs log stream to which the connection data is published.
Information about the DNS servers to be used by Client VPN connections. A Client VPN endpoint can have up to two DNS servers.
The IPv4 address range, in CIDR notation, of the DNS servers to be used. You can specify up to two DNS servers. Ensure that the DNS servers can be reached by the clients. The specified values overwrite the existing values.
Indicates whether DNS servers should be used. Specify False to delete the existing DNS servers.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Changes the default customer master key (CMK) for EBS encryption by default for your account in this Region.
AWS creates a unique AWS managed CMK in each Region for use with encryption by default. If you change the default CMK to a customer managed CMK, it is used instead of the AWS managed CMK. To reset the default CMK to the AWS managed CMK for EBS, use ResetEbsDefaultKmsKeyId .
If you delete or disable the customer managed CMK that you specified for use with encryption by default, your instances will fail to launch.
For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.modify_ebs_default_kms_key_id(
KmsKeyId='string',
DryRun=True|False
)
[REQUIRED]
The identifier of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use for Amazon EBS encryption. If this parameter is not specified, your AWS managed CMK for EBS is used. If KmsKeyId is specified, the encrypted state must be true .
You can specify the CMK using any of the following:
AWS authenticates the CMK asynchronously. Therefore, if you specify an ID, alias, or ARN that is not valid, the action can appear to complete, but eventually fails.
dict
Response Syntax
{
'KmsKeyId': 'string'
}
Response Structure
(dict) --
KmsKeyId (string) --
The Amazon Resource Name (ARN) of the default CMK for encryption by default.
Modifies the specified EC2 Fleet.
While the EC2 Fleet is being modified, it is in the modifying state.
See also: AWS API Documentation
Request Syntax
response = client.modify_fleet(
DryRun=True|False,
ExcessCapacityTerminationPolicy='no-termination'|'termination',
FleetId='string',
TargetCapacitySpecification={
'TotalTargetCapacity': 123,
'OnDemandTargetCapacity': 123,
'SpotTargetCapacity': 123,
'DefaultTargetCapacityType': 'spot'|'on-demand'
}
)
[REQUIRED]
The ID of the EC2 Fleet.
[REQUIRED]
The size of the EC2 Fleet.
The number of units to request, filled using DefaultTargetCapacityType .
The number of On-Demand units to request.
The number of Spot units to request.
The default TotalTargetCapacity , which is either Spot or On-Demand .
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Is true if the request succeeds, and an error otherwise.
Modifies the specified attribute of the specified Amazon FPGA Image (AFI).
See also: AWS API Documentation
Request Syntax
response = client.modify_fpga_image_attribute(
DryRun=True|False,
FpgaImageId='string',
Attribute='description'|'name'|'loadPermission'|'productCodes',
OperationType='add'|'remove',
UserIds=[
'string',
],
UserGroups=[
'string',
],
ProductCodes=[
'string',
],
LoadPermission={
'Add': [
{
'Group': 'all',
'UserId': 'string'
},
],
'Remove': [
{
'Group': 'all',
'UserId': 'string'
},
]
},
Description='string',
Name='string'
)
[REQUIRED]
The ID of the AFI.
The AWS account IDs. This parameter is valid only when modifying the loadPermission attribute.
The user groups. This parameter is valid only when modifying the loadPermission attribute.
The product codes. After you add a product code to an AFI, it can't be removed. This parameter is valid only when modifying the productCodes attribute.
The load permission for the AFI.
The load permissions to add.
Describes a load permission.
The name of the group.
The AWS account ID.
The load permissions to remove.
Describes a load permission.
The name of the group.
The AWS account ID.
dict
Response Syntax
{
'FpgaImageAttribute': {
'FpgaImageId': 'string',
'Name': 'string',
'Description': 'string',
'LoadPermissions': [
{
'UserId': 'string',
'Group': 'all'
},
],
'ProductCodes': [
{
'ProductCodeId': 'string',
'ProductCodeType': 'devpay'|'marketplace'
},
]
}
}
Response Structure
(dict) --
FpgaImageAttribute (dict) --
Information about the attribute.
FpgaImageId (string) --
The ID of the AFI.
Name (string) --
The name of the AFI.
Description (string) --
The description of the AFI.
LoadPermissions (list) --
The load permissions.
(dict) --
Describes a load permission.
UserId (string) --
The AWS account ID.
Group (string) --
The name of the group.
ProductCodes (list) --
The product codes.
(dict) --
Describes a product code.
ProductCodeId (string) --
The product code.
ProductCodeType (string) --
The type of product code.
Modify the auto-placement setting of a Dedicated Host. When auto-placement is enabled, any instances that you launch with a tenancy of host but without a specific host ID are placed onto any available Dedicated Host in your account that has auto-placement enabled. When auto-placement is disabled, you need to provide a host ID to have the instance launch onto a specific host. If no host ID is provided, the instance is launched onto a suitable host with auto-placement enabled.
See also: AWS API Documentation
Request Syntax
response = client.modify_hosts(
AutoPlacement='on'|'off',
HostIds=[
'string',
],
HostRecovery='on'|'off'
)
[REQUIRED]
The IDs of the Dedicated Hosts to modify.
dict
Response Syntax
{
'Successful': [
'string',
],
'Unsuccessful': [
{
'Error': {
'Code': 'string',
'Message': 'string'
},
'ResourceId': 'string'
},
]
}
Response Structure
(dict) --
Successful (list) --
The IDs of the Dedicated Hosts that were successfully modified.
Unsuccessful (list) --
The IDs of the Dedicated Hosts that could not be modified. Check whether the setting you requested can be used.
(dict) --
Information about items that were not successfully processed in a batch call.
Error (dict) --
Information about the error.
Code (string) --
The error code.
Message (string) --
The error message accompanying the error code.
ResourceId (string) --
The ID of the resource.
Modifies the ID format for the specified resource on a per-Region basis. You can specify that resources should receive longer IDs (17-character IDs) when they are created.
This request can only be used to modify longer ID settings for resource types that are within the opt-in period. Resources currently in their opt-in period include: bundle | conversion-task | customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association | export-task | flow-log | image | import-task | internet-gateway | network-acl | network-acl-association | network-interface | network-interface-attachment | prefix-list | route-table | route-table-association | security-group | subnet | subnet-cidr-block-association | vpc | vpc-cidr-block-association | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway .
This setting applies to the IAM user who makes the request; it does not apply to the entire AWS account. By default, an IAM user defaults to the same settings as the root user. If you're using this action as the root user, then these settings apply to the entire account, unless an IAM user explicitly overrides these settings for themselves. For more information, see Resource IDs in the Amazon Elastic Compute Cloud User Guide .
Resources created with longer IDs are visible to all IAM roles and users, regardless of these settings and provided that they have permission to use the relevant Describe command for the resource type.
See also: AWS API Documentation
Request Syntax
response = client.modify_id_format(
Resource='string',
UseLongIds=True|False
)
[REQUIRED]
The type of resource: bundle | conversion-task | customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association | export-task | flow-log | image | import-task | internet-gateway | network-acl | network-acl-association | network-interface | network-interface-attachment | prefix-list | route-table | route-table-association | security-group | subnet | subnet-cidr-block-association | vpc | vpc-cidr-block-association | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway .
Alternatively, use the all-current option to include all resource types that are currently within their opt-in period for longer IDs.
[REQUIRED]
Indicate whether the resource should use longer IDs (17-character IDs).
None
Modifies the ID format of a resource for a specified IAM user, IAM role, or the root user for an account; or all IAM users, IAM roles, and the root user for an account. You can specify that resources should receive longer IDs (17-character IDs) when they are created.
This request can only be used to modify longer ID settings for resource types that are within the opt-in period. Resources currently in their opt-in period include: bundle | conversion-task | customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association | export-task | flow-log | image | import-task | internet-gateway | network-acl | network-acl-association | network-interface | network-interface-attachment | prefix-list | route-table | route-table-association | security-group | subnet | subnet-cidr-block-association | vpc | vpc-cidr-block-association | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway .
For more information, see Resource IDs in the Amazon Elastic Compute Cloud User Guide .
This setting applies to the principal specified in the request; it does not apply to the principal that makes the request.
Resources created with longer IDs are visible to all IAM roles and users, regardless of these settings and provided that they have permission to use the relevant Describe command for the resource type.
See also: AWS API Documentation
Request Syntax
response = client.modify_identity_id_format(
PrincipalArn='string',
Resource='string',
UseLongIds=True|False
)
[REQUIRED]
The ARN of the principal, which can be an IAM user, IAM role, or the root user. Specify all to modify the ID format for all IAM users, IAM roles, and the root user of the account.
[REQUIRED]
The type of resource: bundle | conversion-task | customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association | export-task | flow-log | image | import-task | internet-gateway | network-acl | network-acl-association | network-interface | network-interface-attachment | prefix-list | route-table | route-table-association | security-group | subnet | subnet-cidr-block-association | vpc | vpc-cidr-block-association | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway .
Alternatively, use the all-current option to include all resource types that are currently within their opt-in period for longer IDs.
[REQUIRED]
Indicates whether the resource should use longer IDs (17-character IDs)
None
Modifies the specified attribute of the specified AMI. You can specify only one attribute at a time. You can use the Attribute parameter to specify the attribute or one of the following parameters: Description , LaunchPermission , or ProductCode .
AWS Marketplace product codes cannot be modified. Images with an AWS Marketplace product code cannot be made public.
To enable the SriovNetSupport enhanced networking attribute of an image, enable SriovNetSupport on an instance and create an AMI from the instance.
See also: AWS API Documentation
Request Syntax
response = client.modify_image_attribute(
Attribute='string',
Description={
'Value': 'string'
},
ImageId='string',
LaunchPermission={
'Add': [
{
'Group': 'all',
'UserId': 'string'
},
],
'Remove': [
{
'Group': 'all',
'UserId': 'string'
},
]
},
OperationType='add'|'remove',
ProductCodes=[
'string',
],
UserGroups=[
'string',
],
UserIds=[
'string',
],
Value='string',
DryRun=True|False
)
A new description for the AMI.
The attribute value. The value is case-sensitive.
[REQUIRED]
The ID of the AMI.
A new launch permission for the AMI.
The AWS account ID to add to the list of launch permissions for the AMI.
Describes a launch permission.
The name of the group.
The AWS account ID.
The AWS account ID to remove from the list of launch permissions for the AMI.
Describes a launch permission.
The name of the group.
The AWS account ID.
The DevPay product codes. After you add a product code to an AMI, it can't be removed.
The user groups. This parameter can be used only when the Attribute parameter is launchPermission .
The AWS account IDs. This parameter can be used only when the Attribute parameter is launchPermission .
None
Modifies the specified attribute of the specified instance. You can specify only one attribute at a time.
Note: Using this action to change the security groups associated with an elastic network interface (ENI) attached to an instance in a VPC can result in an error if the instance has more than one ENI. To change the security groups associated with an ENI attached to an instance that has multiple ENIs, we recommend that you use the ModifyNetworkInterfaceAttribute action.
To modify some attributes, the instance must be stopped. For more information, see Modifying Attributes of a Stopped Instance in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.modify_instance_attribute(
SourceDestCheck={
'Value': True|False
},
Attribute='instanceType'|'kernel'|'ramdisk'|'userData'|'disableApiTermination'|'instanceInitiatedShutdownBehavior'|'rootDeviceName'|'blockDeviceMapping'|'productCodes'|'sourceDestCheck'|'groupSet'|'ebsOptimized'|'sriovNetSupport'|'enaSupport',
BlockDeviceMappings=[
{
'DeviceName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'VolumeId': 'string'
},
'NoDevice': 'string',
'VirtualName': 'string'
},
],
DisableApiTermination={
'Value': True|False
},
DryRun=True|False,
EbsOptimized={
'Value': True|False
},
EnaSupport={
'Value': True|False
},
Groups=[
'string',
],
InstanceId='string',
InstanceInitiatedShutdownBehavior={
'Value': 'string'
},
InstanceType={
'Value': 'string'
},
Kernel={
'Value': 'string'
},
Ramdisk={
'Value': 'string'
},
SriovNetSupport={
'Value': 'string'
},
UserData={
'Value': b'bytes'
},
Value='string'
)
Specifies whether source/destination checking is enabled. A value of true means that checking is enabled, and false means that checking is disabled. This value must be false for a NAT instance to perform NAT.
The attribute value. The valid values are true or false .
Modifies the DeleteOnTermination attribute for volumes that are currently attached. The volume must be owned by the caller. If no value is specified for DeleteOnTermination , the default is true and the volume is deleted when the instance is terminated.
To add instance store volumes to an Amazon EBS-backed instance, you must add them when you launch the instance. For more information, see Updating the Block Device Mapping when Launching an Instance in the Amazon Elastic Compute Cloud User Guide .
Describes a block device mapping entry.
The device name (for example, /dev/sdh or xvdh ).
Parameters used to automatically set up EBS volumes when the instance is launched.
Indicates whether the volume is deleted on instance termination.
The ID of the EBS volume.
suppress the specified device included in the block device mapping.
The virtual device name.
If the value is true , you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. You cannot use this parameter for Spot Instances.
The attribute value. The valid values are true or false .
Specifies whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.
The attribute value. The valid values are true or false .
Set to true to enable enhanced networking with ENA for the instance.
This option is supported only for HVM instances. Specifying this option with a PV instance can make it unreachable.
The attribute value. The valid values are true or false .
[EC2-VPC] Changes the security groups of the instance. You must specify at least one security group, even if it's just the default security group for the VPC. You must specify the security group ID, not the security group name.
[REQUIRED]
The ID of the instance.
Specifies whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
The attribute value. The value is case-sensitive.
Changes the instance type to the specified value. For more information, see Instance Types . If the instance type is not valid, the error returned is InvalidInstanceAttributeValue .
The attribute value. The value is case-sensitive.
Changes the instance's kernel to the specified value. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB .
The attribute value. The value is case-sensitive.
Changes the instance's RAM disk to the specified value. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB .
The attribute value. The value is case-sensitive.
Set to simple to enable enhanced networking with the Intel 82599 Virtual Function interface for the instance.
There is no way to disable enhanced networking with the Intel 82599 Virtual Function interface at this time.
This option is supported only for HVM instances. Specifying this option with a PV instance can make it unreachable.
The attribute value. The value is case-sensitive.
Changes the instance's user data to the specified value. If you are using an AWS SDK or command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text.
None
Modifies the Capacity Reservation settings for a stopped instance. Use this action to configure an instance to target a specific Capacity Reservation, run in any open Capacity Reservation with matching attributes, or run On-Demand Instance capacity.
See also: AWS API Documentation
Request Syntax
response = client.modify_instance_capacity_reservation_attributes(
InstanceId='string',
CapacityReservationSpecification={
'CapacityReservationPreference': 'open'|'none',
'CapacityReservationTarget': {
'CapacityReservationId': 'string'
}
},
DryRun=True|False
)
[REQUIRED]
The ID of the instance to be modified.
[REQUIRED]
Information about the Capacity Reservation targeting option.
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
Information about the target Capacity Reservation.
The ID of the Capacity Reservation.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Modifies the credit option for CPU usage on a running or stopped T2 or T3 instance. The credit options are standard and unlimited .
For more information, see Burstable Performance Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.modify_instance_credit_specification(
DryRun=True|False,
ClientToken='string',
InstanceCreditSpecifications=[
{
'InstanceId': 'string',
'CpuCredits': 'string'
},
]
)
[REQUIRED]
Information about the credit option for CPU usage.
Describes the credit option for CPU usage of a T2 or T3 instance.
The ID of the instance.
The credit option for CPU usage of the instance. Valid values are standard and unlimited .
dict
Response Syntax
{
'SuccessfulInstanceCreditSpecifications': [
{
'InstanceId': 'string'
},
],
'UnsuccessfulInstanceCreditSpecifications': [
{
'InstanceId': 'string',
'Error': {
'Code': 'InvalidInstanceID.Malformed'|'InvalidInstanceID.NotFound'|'IncorrectInstanceState'|'InstanceCreditSpecification.NotSupported',
'Message': 'string'
}
},
]
}
Response Structure
(dict) --
SuccessfulInstanceCreditSpecifications (list) --
Information about the instances whose credit option for CPU usage was successfully modified.
(dict) --
Describes the T2 or T3 instance whose credit option for CPU usage was successfully modified.
InstanceId (string) --
The ID of the instance.
UnsuccessfulInstanceCreditSpecifications (list) --
Information about the instances whose credit option for CPU usage was not modified.
(dict) --
Describes the T2 or T3 instance whose credit option for CPU usage was not modified.
InstanceId (string) --
The ID of the instance.
Error (dict) --
The applicable error for the T2 or T3 instance whose credit option for CPU usage was not modified.
Code (string) --
The error code.
Message (string) --
The applicable error message.
Modifies the start time for a scheduled Amazon EC2 instance event.
See also: AWS API Documentation
Request Syntax
response = client.modify_instance_event_start_time(
DryRun=True|False,
InstanceId='string',
InstanceEventId='string',
NotBefore=datetime(2015, 1, 1)
)
[REQUIRED]
The ID of the instance with the scheduled event.
[REQUIRED]
The ID of the event whose date and time you are modifying.
[REQUIRED]
The new date and time when the event will take place.
dict
Response Syntax
{
'Event': {
'InstanceEventId': 'string',
'Code': 'instance-reboot'|'system-reboot'|'system-maintenance'|'instance-retirement'|'instance-stop',
'Description': 'string',
'NotAfter': datetime(2015, 1, 1),
'NotBefore': datetime(2015, 1, 1),
'NotBeforeDeadline': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
Event (dict) --
Describes a scheduled event for an instance.
InstanceEventId (string) --
The ID of the event.
Code (string) --
The event code.
Description (string) --
A description of the event.
After a scheduled event is completed, it can still be described for up to a week. If the event has been completed, this description starts with the following text: [Completed].
NotAfter (datetime) --
The latest scheduled end time for the event.
NotBefore (datetime) --
The earliest scheduled start time for the event.
NotBeforeDeadline (datetime) --
The deadline for starting the event.
Modifies the placement attributes for a specified instance. You can do the following:
At least one attribute for affinity, host ID, tenancy, or placement group name must be specified in the request. Affinity and tenancy can be modified in the same request.
To modify the host ID, tenancy, placement group, or partition for an instance, the instance must be in the stopped state.
See also: AWS API Documentation
Request Syntax
response = client.modify_instance_placement(
Affinity='default'|'host',
GroupName='string',
HostId='string',
InstanceId='string',
Tenancy='dedicated'|'host',
PartitionNumber=123
)
The name of the placement group in which to place the instance. For spread placement groups, the instance must have a tenancy of default . For cluster and partition placement groups, the instance must have a tenancy of default or dedicated .
To remove an instance from a placement group, specify an empty string ("").
[REQUIRED]
The ID of the instance that you are modifying.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Is true if the request succeeds, and an error otherwise.
Modifies a launch template. You can specify which version of the launch template to set as the default version. When launching an instance, the default version applies when a launch template version is not specified.
See also: AWS API Documentation
Request Syntax
response = client.modify_launch_template(
DryRun=True|False,
ClientToken='string',
LaunchTemplateId='string',
LaunchTemplateName='string',
DefaultVersion='string'
)
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency .
Constraint: Maximum 128 ASCII characters.
dict
Response Syntax
{
'LaunchTemplate': {
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'CreateTime': datetime(2015, 1, 1),
'CreatedBy': 'string',
'DefaultVersionNumber': 123,
'LatestVersionNumber': 123,
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
LaunchTemplate (dict) --
Information about the launch template.
LaunchTemplateId (string) --
The ID of the launch template.
LaunchTemplateName (string) --
The name of the launch template.
CreateTime (datetime) --
The time launch template was created.
CreatedBy (string) --
The principal that created the launch template.
DefaultVersionNumber (integer) --
The version number of the default version of the launch template.
LatestVersionNumber (integer) --
The version number of the latest version of the launch template.
Tags (list) --
The tags for the launch template.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Modifies the specified network interface attribute. You can specify only one attribute at a time. You can use this action to attach and detach security groups from an existing EC2 instance.
See also: AWS API Documentation
Request Syntax
response = client.modify_network_interface_attribute(
Attachment={
'AttachmentId': 'string',
'DeleteOnTermination': True|False
},
Description={
'Value': 'string'
},
DryRun=True|False,
Groups=[
'string',
],
NetworkInterfaceId='string',
SourceDestCheck={
'Value': True|False
}
)
Information about the interface attachment. If modifying the 'delete on termination' attribute, you must specify the ID of the interface attachment.
The ID of the network interface attachment.
Indicates whether the network interface is deleted when the instance is terminated.
A description for the network interface.
The attribute value. The value is case-sensitive.
Changes the security groups for the network interface. The new set of groups you specify replaces the current set. You must specify at least one group, even if it's just the default security group in the VPC. You must specify the ID of the security group, not the name.
[REQUIRED]
The ID of the network interface.
Indicates whether source/destination checking is enabled. A value of true means checking is enabled, and false means checking is disabled. This value must be false for a NAT instance to perform NAT. For more information, see NAT Instances in the Amazon Virtual Private Cloud User Guide .
The attribute value. The valid values are true or false .
None
Examples
This example modifies the attachment attribute of the specified network interface.
response = client.modify_network_interface_attribute(
Attachment={
'AttachmentId': 'eni-attach-43348162',
'DeleteOnTermination': False,
},
NetworkInterfaceId='eni-686ea200',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
This example modifies the description attribute of the specified network interface.
response = client.modify_network_interface_attribute(
Description={
'Value': 'My description',
},
NetworkInterfaceId='eni-686ea200',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
This example command modifies the groupSet attribute of the specified network interface.
response = client.modify_network_interface_attribute(
Groups=[
'sg-903004f8',
'sg-1a2b3c4d',
],
NetworkInterfaceId='eni-686ea200',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
This example command modifies the sourceDestCheck attribute of the specified network interface.
response = client.modify_network_interface_attribute(
NetworkInterfaceId='eni-686ea200',
SourceDestCheck={
'Value': False,
},
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Modifies the Availability Zone, instance count, instance type, or network platform (EC2-Classic or EC2-VPC) of your Reserved Instances. The Reserved Instances to be modified must be identical, except for Availability Zone, network platform, and instance type.
For more information, see Modifying Reserved Instances in the Amazon Elastic Compute Cloud User Guide.
See also: AWS API Documentation
Request Syntax
response = client.modify_reserved_instances(
ReservedInstancesIds=[
'string',
],
ClientToken='string',
TargetConfigurations=[
{
'AvailabilityZone': 'string',
'InstanceCount': 123,
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'Platform': 'string',
'Scope': 'Availability Zone'|'Region'
},
]
)
[REQUIRED]
The IDs of the Reserved Instances to modify.
[REQUIRED]
The configuration settings for the Reserved Instances to modify.
Describes the configuration settings for the modified Reserved Instances.
The Availability Zone for the modified Reserved Instances.
The number of modified Reserved Instances.
Note
This is a required field for a request.
The instance type for the modified Reserved Instances.
The network platform of the modified Reserved Instances, which is either EC2-Classic or EC2-VPC.
Whether the Reserved Instance is applied to instances in a Region or instances in a specific Availability Zone.
dict
Response Syntax
{
'ReservedInstancesModificationId': 'string'
}
Response Structure
(dict) --
Contains the output of ModifyReservedInstances.
ReservedInstancesModificationId (string) --
The ID for the modification.
Adds or removes permission settings for the specified snapshot. You may add or remove specified AWS account IDs from a snapshot's list of create volume permissions, but you cannot do both in a single operation. If you need to both add and remove account IDs for a snapshot, you must use multiple operations.
Encrypted snapshots and snapshots with AWS Marketplace product codes cannot be made public. Snapshots encrypted with your default CMK cannot be shared with other accounts.
For more information about modifying snapshot permissions, see Sharing Snapshots in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.modify_snapshot_attribute(
Attribute='productCodes'|'createVolumePermission',
CreateVolumePermission={
'Add': [
{
'Group': 'all',
'UserId': 'string'
},
],
'Remove': [
{
'Group': 'all',
'UserId': 'string'
},
]
},
GroupNames=[
'string',
],
OperationType='add'|'remove',
SnapshotId='string',
UserIds=[
'string',
],
DryRun=True|False
)
A JSON representation of the snapshot attribute modification.
Adds the specified AWS account ID or group to the list.
Describes the user or group to be added or removed from the list of create volume permissions for a volume.
The group to be added or removed. The possible value is all .
The AWS account ID to be added or removed.
Removes the specified AWS account ID or group from the list.
Describes the user or group to be added or removed from the list of create volume permissions for a volume.
The group to be added or removed. The possible value is all .
The AWS account ID to be added or removed.
The group to modify for the snapshot.
[REQUIRED]
The ID of the snapshot.
The account ID to modify for the snapshot.
None
Examples
This example modifies snapshot snap-1234567890abcdef0 to remove the create volume permission for a user with the account ID 123456789012. If the command succeeds, no output is returned.
response = client.modify_snapshot_attribute(
Attribute='createVolumePermission',
OperationType='remove',
SnapshotId='snap-1234567890abcdef0',
UserIds=[
'123456789012',
],
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
This example makes the snapshot snap-1234567890abcdef0 public.
response = client.modify_snapshot_attribute(
Attribute='createVolumePermission',
GroupNames=[
'all',
],
OperationType='add',
SnapshotId='snap-1234567890abcdef0',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Modifies the specified Spot Fleet request.
You can only modify a Spot Fleet request of type maintain .
While the Spot Fleet request is being modified, it is in the modifying state.
To scale up your Spot Fleet, increase its target capacity. The Spot Fleet launches the additional Spot Instances according to the allocation strategy for the Spot Fleet request. If the allocation strategy is lowestPrice , the Spot Fleet launches instances using the Spot pool with the lowest price. If the allocation strategy is diversified , the Spot Fleet distributes the instances across the Spot pools.
To scale down your Spot Fleet, decrease its target capacity. First, the Spot Fleet cancels any open requests that exceed the new target capacity. You can request that the Spot Fleet terminate Spot Instances until the size of the fleet no longer exceeds the new target capacity. If the allocation strategy is lowestPrice , the Spot Fleet terminates the instances with the highest price per unit. If the allocation strategy is diversified , the Spot Fleet terminates instances across the Spot pools. Alternatively, you can request that the Spot Fleet keep the fleet at its current size, but not replace any Spot Instances that are interrupted or that you terminate manually.
If you are finished with your Spot Fleet for now, but will use it again later, you can set the target capacity to 0.
See also: AWS API Documentation
Request Syntax
response = client.modify_spot_fleet_request(
ExcessCapacityTerminationPolicy='noTermination'|'default',
SpotFleetRequestId='string',
TargetCapacity=123,
OnDemandTargetCapacity=123
)
[REQUIRED]
The ID of the Spot Fleet request.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Contains the output of ModifySpotFleetRequest.
Return (boolean) --
Is true if the request succeeds, and an error otherwise.
Examples
This example increases the target capacity of the specified Spot fleet request.
response = client.modify_spot_fleet_request(
SpotFleetRequestId='sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE',
TargetCapacity=20,
)
print(response)
Expected Output:
{
'Return': True,
'ResponseMetadata': {
'...': '...',
},
}
This example decreases the target capacity of the specified Spot fleet request without terminating any Spot Instances as a result.
response = client.modify_spot_fleet_request(
ExcessCapacityTerminationPolicy='NoTermination ',
SpotFleetRequestId='sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE',
TargetCapacity=10,
)
print(response)
Expected Output:
{
'Return': True,
'ResponseMetadata': {
'...': '...',
},
}
Modifies a subnet attribute. You can only modify one attribute at a time.
See also: AWS API Documentation
Request Syntax
response = client.modify_subnet_attribute(
AssignIpv6AddressOnCreation={
'Value': True|False
},
MapPublicIpOnLaunch={
'Value': True|False
},
SubnetId='string'
)
Specify true to indicate that network interfaces created in the specified subnet should be assigned an IPv6 address. This includes a network interface that's created when launching an instance into the subnet (the instance therefore receives an IPv6 address).
If you enable the IPv6 addressing feature for your subnet, your network interface or instance only receives an IPv6 address if it's created using version 2016-11-15 or later of the Amazon EC2 API.
The attribute value. The valid values are true or false .
Specify true to indicate that ENIs attached to instances created in the specified subnet should be assigned a public IPv4 address.
The attribute value. The valid values are true or false .
[REQUIRED]
The ID of the subnet.
None
Examples
This example modifies the specified subnet so that all instances launched into this subnet are assigned a public IP address.
response = client.modify_subnet_attribute(
MapPublicIpOnLaunch={
'Value': True,
},
SubnetId='subnet-1a2b3c4d',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Allows or restricts mirroring network services.
By default, Amazon DNS network services are not eligible for Traffic Mirror. Use AddNetworkServices to add network services to a Traffic Mirror filter. When a network service is added to the Traffic Mirror filter, all traffic related to that network service will be mirrored. When you no longer want to mirror network services, use RemoveNetworkServices to remove the network services from the Traffic Mirror filter.
FFor information about filter rule properties, see Network Services in the Traffic Mirroring User Guide .
See also: AWS API Documentation
Request Syntax
response = client.modify_traffic_mirror_filter_network_services(
TrafficMirrorFilterId='string',
AddNetworkServices=[
'amazon-dns',
],
RemoveNetworkServices=[
'amazon-dns',
],
DryRun=True|False
)
[REQUIRED]
The ID of the Traffic Mirror filter.
The network service, for example Amazon DNS, that you want to mirror.
The network service, for example Amazon DNS, that you no longer want to mirror.
dict
Response Syntax
{
'TrafficMirrorFilter': {
'TrafficMirrorFilterId': 'string',
'IngressFilterRules': [
{
'TrafficMirrorFilterRuleId': 'string',
'TrafficMirrorFilterId': 'string',
'TrafficDirection': 'ingress'|'egress',
'RuleNumber': 123,
'RuleAction': 'accept'|'reject',
'Protocol': 123,
'DestinationPortRange': {
'FromPort': 123,
'ToPort': 123
},
'SourcePortRange': {
'FromPort': 123,
'ToPort': 123
},
'DestinationCidrBlock': 'string',
'SourceCidrBlock': 'string',
'Description': 'string'
},
],
'EgressFilterRules': [
{
'TrafficMirrorFilterRuleId': 'string',
'TrafficMirrorFilterId': 'string',
'TrafficDirection': 'ingress'|'egress',
'RuleNumber': 123,
'RuleAction': 'accept'|'reject',
'Protocol': 123,
'DestinationPortRange': {
'FromPort': 123,
'ToPort': 123
},
'SourcePortRange': {
'FromPort': 123,
'ToPort': 123
},
'DestinationCidrBlock': 'string',
'SourceCidrBlock': 'string',
'Description': 'string'
},
],
'NetworkServices': [
'amazon-dns',
],
'Description': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
TrafficMirrorFilter (dict) --
The Traffic Mirror filter that the network service is associated with.
TrafficMirrorFilterId (string) --
The ID of the Traffic Mirror filter.
IngressFilterRules (list) --
Information about the ingress rules that are associated with the Traffic Mirror filter.
(dict) --
Describes the Traffic Mirror rule.
TrafficMirrorFilterRuleId (string) --
The ID of the Traffic Mirror rule.
TrafficMirrorFilterId (string) --
The ID of the Traffic Mirror filter that the rule is associated with.
TrafficDirection (string) --
The traffic direction assigned to the Traffic Mirror rule.
RuleNumber (integer) --
The rule number of the Traffic Mirror rule.
RuleAction (string) --
The action assigned to the Traffic Mirror rule.
Protocol (integer) --
The protocol assigned to the Traffic Mirror rule.
DestinationPortRange (dict) --
The destination port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
SourcePortRange (dict) --
The source port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
DestinationCidrBlock (string) --
The destination CIDR block assigned to the Traffic Mirror rule.
SourceCidrBlock (string) --
The source CIDR block assigned to the Traffic Mirror rule.
Description (string) --
The description of the Traffic Mirror rule.
EgressFilterRules (list) --
Information about the egress rules that are associated with the Traffic Mirror filter.
(dict) --
Describes the Traffic Mirror rule.
TrafficMirrorFilterRuleId (string) --
The ID of the Traffic Mirror rule.
TrafficMirrorFilterId (string) --
The ID of the Traffic Mirror filter that the rule is associated with.
TrafficDirection (string) --
The traffic direction assigned to the Traffic Mirror rule.
RuleNumber (integer) --
The rule number of the Traffic Mirror rule.
RuleAction (string) --
The action assigned to the Traffic Mirror rule.
Protocol (integer) --
The protocol assigned to the Traffic Mirror rule.
DestinationPortRange (dict) --
The destination port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
SourcePortRange (dict) --
The source port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
DestinationCidrBlock (string) --
The destination CIDR block assigned to the Traffic Mirror rule.
SourceCidrBlock (string) --
The source CIDR block assigned to the Traffic Mirror rule.
Description (string) --
The description of the Traffic Mirror rule.
NetworkServices (list) --
The network service traffic that is associated with the Traffic Mirror filter.
Description (string) --
The description of the Traffic Mirror filter.
Tags (list) --
The tags assigned to the Traffic Mirror filter.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Modifies the specified Traffic Mirror rule.
DestinationCidrBlock and SourceCidrBlock must both be an IPv4 range or an IPv6 range.
See also: AWS API Documentation
Request Syntax
response = client.modify_traffic_mirror_filter_rule(
TrafficMirrorFilterRuleId='string',
TrafficDirection='ingress'|'egress',
RuleNumber=123,
RuleAction='accept'|'reject',
DestinationPortRange={
'FromPort': 123,
'ToPort': 123
},
SourcePortRange={
'FromPort': 123,
'ToPort': 123
},
Protocol=123,
DestinationCidrBlock='string',
SourceCidrBlock='string',
Description='string',
RemoveFields=[
'destination-port-range'|'source-port-range'|'protocol'|'description',
],
DryRun=True|False
)
[REQUIRED]
The ID of the Traffic Mirror rule.
The destination ports that are associated with the Traffic Mirror rule.
The first port in the Traffic Mirror port range. This applies to the TCP and UDP protocols.
The last port in the Traffic Mirror port range. This applies to the TCP and UDP protocols.
The port range to assign to the Traffic Mirror rule.
The first port in the Traffic Mirror port range. This applies to the TCP and UDP protocols.
The last port in the Traffic Mirror port range. This applies to the TCP and UDP protocols.
The properties that you want to remove from the Traffic Mirror filter rule.
When you remove a property from a Traffic Mirror filter rule, the property is set to the default.
dict
Response Syntax
{
'TrafficMirrorFilterRule': {
'TrafficMirrorFilterRuleId': 'string',
'TrafficMirrorFilterId': 'string',
'TrafficDirection': 'ingress'|'egress',
'RuleNumber': 123,
'RuleAction': 'accept'|'reject',
'Protocol': 123,
'DestinationPortRange': {
'FromPort': 123,
'ToPort': 123
},
'SourcePortRange': {
'FromPort': 123,
'ToPort': 123
},
'DestinationCidrBlock': 'string',
'SourceCidrBlock': 'string',
'Description': 'string'
}
}
Response Structure
(dict) --
TrafficMirrorFilterRule (dict) --
Modifies a Traffic Mirror rule.
TrafficMirrorFilterRuleId (string) --
The ID of the Traffic Mirror rule.
TrafficMirrorFilterId (string) --
The ID of the Traffic Mirror filter that the rule is associated with.
TrafficDirection (string) --
The traffic direction assigned to the Traffic Mirror rule.
RuleNumber (integer) --
The rule number of the Traffic Mirror rule.
RuleAction (string) --
The action assigned to the Traffic Mirror rule.
Protocol (integer) --
The protocol assigned to the Traffic Mirror rule.
DestinationPortRange (dict) --
The destination port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
SourcePortRange (dict) --
The source port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
DestinationCidrBlock (string) --
The destination CIDR block assigned to the Traffic Mirror rule.
SourceCidrBlock (string) --
The source CIDR block assigned to the Traffic Mirror rule.
Description (string) --
The description of the Traffic Mirror rule.
Modifies a Traffic Mirror session.
See also: AWS API Documentation
Request Syntax
response = client.modify_traffic_mirror_session(
TrafficMirrorSessionId='string',
TrafficMirrorTargetId='string',
TrafficMirrorFilterId='string',
PacketLength=123,
SessionNumber=123,
VirtualNetworkId=123,
Description='string',
RemoveFields=[
'packet-length'|'description'|'virtual-network-id',
],
DryRun=True|False
)
[REQUIRED]
The ID of the Traffic Mirror session.
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
Valid values are 1-32766.
The properties that you want to remove from the Traffic Mirror session.
When you remove a property from a Traffic Mirror session, the property is set to the default.
dict
Response Syntax
{
'TrafficMirrorSession': {
'TrafficMirrorSessionId': 'string',
'TrafficMirrorTargetId': 'string',
'TrafficMirrorFilterId': 'string',
'NetworkInterfaceId': 'string',
'OwnerId': 'string',
'PacketLength': 123,
'SessionNumber': 123,
'VirtualNetworkId': 123,
'Description': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
TrafficMirrorSession (dict) --
Information about the Traffic Mirror session.
TrafficMirrorSessionId (string) --
The ID for the Traffic Mirror session.
TrafficMirrorTargetId (string) --
The ID of the Traffic Mirror target.
TrafficMirrorFilterId (string) --
The ID of the Traffic Mirror filter.
NetworkInterfaceId (string) --
The ID of the Traffic Mirror session's network interface.
OwnerId (string) --
The ID of the account that owns the Traffic Mirror session.
PacketLength (integer) --
The number of bytes in each packet to mirror. These are the bytes after the VXLAN header. To mirror a subset, set this to the length (in bytes) to mirror. For example, if you set this value to 100, then the first 100 bytes that meet the filter criteria are copied to the target. Do not specify this parameter when you want to mirror the entire packet
SessionNumber (integer) --
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
Valid values are 1-32766.
VirtualNetworkId (integer) --
The virtual network ID associated with the Traffic Mirror session.
Description (string) --
The description of the Traffic Mirror session.
Tags (list) --
The tags assigned to the Traffic Mirror session.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Modifies the specified VPC attachment.
See also: AWS API Documentation
Request Syntax
response = client.modify_transit_gateway_vpc_attachment(
TransitGatewayAttachmentId='string',
AddSubnetIds=[
'string',
],
RemoveSubnetIds=[
'string',
],
Options={
'DnsSupport': 'enable'|'disable',
'Ipv6Support': 'enable'|'disable'
},
DryRun=True|False
)
[REQUIRED]
The ID of the attachment.
The IDs of one or more subnets to add. You can specify at most one subnet per Availability Zone.
The IDs of one or more subnets to remove.
The new VPC attachment options.
Enable or disable DNS support. The default is enable .
Enable or disable IPv6 support. The default is enable .
dict
Response Syntax
{
'TransitGatewayVpcAttachment': {
'TransitGatewayAttachmentId': 'string',
'TransitGatewayId': 'string',
'VpcId': 'string',
'VpcOwnerId': 'string',
'State': 'pendingAcceptance'|'rollingBack'|'pending'|'available'|'modifying'|'deleting'|'deleted'|'failed'|'rejected'|'rejecting'|'failing',
'SubnetIds': [
'string',
],
'CreationTime': datetime(2015, 1, 1),
'Options': {
'DnsSupport': 'enable'|'disable',
'Ipv6Support': 'enable'|'disable'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
TransitGatewayVpcAttachment (dict) --
Information about the modified attachment.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
TransitGatewayId (string) --
The ID of the transit gateway.
VpcId (string) --
The ID of the VPC.
VpcOwnerId (string) --
The ID of the AWS account that owns the VPC.
State (string) --
The state of the VPC attachment.
SubnetIds (list) --
The IDs of the subnets.
CreationTime (datetime) --
The creation time.
Options (dict) --
The VPC attachment options.
DnsSupport (string) --
Indicates whether DNS support is enabled.
Ipv6Support (string) --
Indicates whether IPv6 support is enabled.
Tags (list) --
The tags for the VPC attachment.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
You can modify several parameters of an existing EBS volume, including volume size, volume type, and IOPS capacity. If your EBS volume is attached to a current-generation EC2 instance type, you may be able to apply these changes without stopping the instance or detaching the volume from it. For more information about modifying an EBS volume running Linux, see Modifying the Size, IOPS, or Type of an EBS Volume on Linux . For more information about modifying an EBS volume running Windows, see Modifying the Size, IOPS, or Type of an EBS Volume on Windows .
When you complete a resize operation on your volume, you need to extend the volume's file-system size to take advantage of the new storage capacity. For information about extending a Linux file system, see Extending a Linux File System . For information about extending a Windows file system, see Extending a Windows File System .
You can use CloudWatch Events to check the status of a modification to an EBS volume. For information about CloudWatch Events, see the Amazon CloudWatch Events User Guide . You can also track the status of a modification using DescribeVolumesModifications . For information about tracking status changes using either method, see Monitoring Volume Modifications .
With previous-generation instance types, resizing an EBS volume may require detaching and reattaching the volume or stopping and restarting the instance. For more information, see Modifying the Size, IOPS, or Type of an EBS Volume on Linux and Modifying the Size, IOPS, or Type of an EBS Volume on Windows .
If you reach the maximum volume modification rate per volume limit, you will need to wait at least six hours before applying further modifications to the affected EBS volume.
See also: AWS API Documentation
Request Syntax
response = client.modify_volume(
DryRun=True|False,
VolumeId='string',
Size=123,
VolumeType='standard'|'io1'|'gp2'|'sc1'|'st1',
Iops=123
)
[REQUIRED]
The ID of the volume.
The target size of the volume, in GiB. The target volume size must be greater than or equal to than the existing size of the volume. For information about available EBS volume sizes, see Amazon EBS Volume Types .
Default: If no size is specified, the existing size is retained.
The target EBS volume type of the volume.
Default: If no type is specified, the existing type is retained.
The target IOPS rate of the volume.
This is only valid for Provisioned IOPS SSD (io1 ) volumes. For more information, see Provisioned IOPS SSD (io1) Volumes .
Default: If no IOPS value is specified, the existing value is retained.
dict
Response Syntax
{
'VolumeModification': {
'VolumeId': 'string',
'ModificationState': 'modifying'|'optimizing'|'completed'|'failed',
'StatusMessage': 'string',
'TargetSize': 123,
'TargetIops': 123,
'TargetVolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'OriginalSize': 123,
'OriginalIops': 123,
'OriginalVolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Progress': 123,
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
VolumeModification (dict) --
Information about the volume modification.
VolumeId (string) --
The ID of the volume.
ModificationState (string) --
The current modification state. The modification state is null for unmodified volumes.
StatusMessage (string) --
A status message about the modification progress or failure.
TargetSize (integer) --
The target size of the volume, in GiB.
TargetIops (integer) --
The target IOPS rate of the volume.
TargetVolumeType (string) --
The target EBS volume type of the volume.
OriginalSize (integer) --
The original size of the volume.
OriginalIops (integer) --
The original IOPS rate of the volume.
OriginalVolumeType (string) --
The original EBS volume type of the volume.
Progress (integer) --
The modification progress, from 0 to 100 percent complete.
StartTime (datetime) --
The modification start time.
EndTime (datetime) --
The modification completion or failure time.
Modifies a volume attribute.
By default, all I/O operations for the volume are suspended when the data on the volume is determined to be potentially inconsistent, to prevent undetectable, latent data corruption. The I/O access to the volume can be resumed by first enabling I/O access and then checking the data consistency on your volume.
You can change the default behavior to resume I/O operations. We recommend that you change this only for boot volumes or for volumes that are stateless or disposable.
See also: AWS API Documentation
Request Syntax
response = client.modify_volume_attribute(
AutoEnableIO={
'Value': True|False
},
VolumeId='string',
DryRun=True|False
)
Indicates whether the volume should be auto-enabled for I/O operations.
The attribute value. The valid values are true or false .
[REQUIRED]
The ID of the volume.
None
Examples
This example sets the autoEnableIo attribute of the volume with the ID vol-1234567890abcdef0 to true. If the command succeeds, no output is returned.
response = client.modify_volume_attribute(
AutoEnableIO={
'Value': True,
},
DryRun=True,
VolumeId='vol-1234567890abcdef0',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Modifies the specified attribute of the specified VPC.
See also: AWS API Documentation
Request Syntax
response = client.modify_vpc_attribute(
EnableDnsHostnames={
'Value': True|False
},
EnableDnsSupport={
'Value': True|False
},
VpcId='string'
)
Indicates whether the instances launched in the VPC get DNS hostnames. If enabled, instances in the VPC get DNS hostnames; otherwise, they do not.
You cannot modify the DNS resolution and DNS hostnames attributes in the same request. Use separate requests for each attribute. You can only enable DNS hostnames if you've enabled DNS support.
The attribute value. The valid values are true or false .
Indicates whether the DNS resolution is supported for the VPC. If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range "plus two" succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled.
You cannot modify the DNS resolution and DNS hostnames attributes in the same request. Use separate requests for each attribute.
The attribute value. The valid values are true or false .
[REQUIRED]
The ID of the VPC.
None
Examples
This example modifies the enableDnsSupport attribute. This attribute indicates whether DNS resolution is enabled for the VPC. If this attribute is true, the Amazon DNS server resolves DNS hostnames for instances in the VPC to their corresponding IP addresses; otherwise, it does not.
response = client.modify_vpc_attribute(
EnableDnsSupport={
'Value': False,
},
VpcId='vpc-a01106c2',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
This example modifies the enableDnsHostnames attribute. This attribute indicates whether instances launched in the VPC get DNS hostnames. If this attribute is true, instances in the VPC get DNS hostnames; otherwise, they do not.
response = client.modify_vpc_attribute(
EnableDnsHostnames={
'Value': False,
},
VpcId='vpc-a01106c2',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Modifies attributes of a specified VPC endpoint. The attributes that you can modify depend on the type of VPC endpoint (interface or gateway). For more information, see VPC Endpoints in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.modify_vpc_endpoint(
DryRun=True|False,
VpcEndpointId='string',
ResetPolicy=True|False,
PolicyDocument='string',
AddRouteTableIds=[
'string',
],
RemoveRouteTableIds=[
'string',
],
AddSubnetIds=[
'string',
],
RemoveSubnetIds=[
'string',
],
AddSecurityGroupIds=[
'string',
],
RemoveSecurityGroupIds=[
'string',
],
PrivateDnsEnabled=True|False
)
[REQUIRED]
The ID of the endpoint.
(Gateway endpoint) One or more route tables IDs to associate with the endpoint.
(Gateway endpoint) One or more route table IDs to disassociate from the endpoint.
(Interface endpoint) One or more subnet IDs in which to serve the endpoint.
(Interface endpoint) One or more subnets IDs in which to remove the endpoint.
(Interface endpoint) One or more security group IDs to associate with the network interface.
(Interface endpoint) One or more security group IDs to disassociate from the network interface.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Modifies a connection notification for VPC endpoint or VPC endpoint service. You can change the SNS topic for the notification, or the events for which to be notified.
See also: AWS API Documentation
Request Syntax
response = client.modify_vpc_endpoint_connection_notification(
DryRun=True|False,
ConnectionNotificationId='string',
ConnectionNotificationArn='string',
ConnectionEvents=[
'string',
]
)
[REQUIRED]
The ID of the notification.
One or more events for the endpoint. Valid values are Accept , Connect , Delete , and Reject .
dict
Response Syntax
{
'ReturnValue': True|False
}
Response Structure
(dict) --
ReturnValue (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Modifies the attributes of your VPC endpoint service configuration. You can change the Network Load Balancers for your service, and you can specify whether acceptance is required for requests to connect to your endpoint service through an interface VPC endpoint.
See also: AWS API Documentation
Request Syntax
response = client.modify_vpc_endpoint_service_configuration(
DryRun=True|False,
ServiceId='string',
AcceptanceRequired=True|False,
AddNetworkLoadBalancerArns=[
'string',
],
RemoveNetworkLoadBalancerArns=[
'string',
]
)
[REQUIRED]
The ID of the service.
The Amazon Resource Names (ARNs) of Network Load Balancers to add to your service configuration.
The Amazon Resource Names (ARNs) of Network Load Balancers to remove from your service configuration.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Modifies the permissions for your VPC endpoint service . You can add or remove permissions for service consumers (IAM users, IAM roles, and AWS accounts) to connect to your endpoint service.
If you grant permissions to all principals, the service is public. Any users who know the name of a public service can send a request to attach an endpoint. If the service does not require manual approval, attachments are automatically approved.
See also: AWS API Documentation
Request Syntax
response = client.modify_vpc_endpoint_service_permissions(
DryRun=True|False,
ServiceId='string',
AddAllowedPrincipals=[
'string',
],
RemoveAllowedPrincipals=[
'string',
]
)
[REQUIRED]
The ID of the service.
The Amazon Resource Names (ARN) of one or more principals. Permissions are granted to the principals in this list. To grant permissions to all principals, specify an asterisk (*).
The Amazon Resource Names (ARN) of one or more principals. Permissions are revoked for principals in this list.
dict
Response Syntax
{
'ReturnValue': True|False
}
Response Structure
(dict) --
ReturnValue (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Modifies the VPC peering connection options on one side of a VPC peering connection. You can do the following:
If the peered VPCs are in the same AWS account, you can enable DNS resolution for queries from the local VPC. This ensures that queries from the local VPC resolve to private IP addresses in the peer VPC. This option is not available if the peered VPCs are in different AWS accounts or different Regions. For peered VPCs in different AWS accounts, each AWS account owner must initiate a separate request to modify the peering connection options. For inter-region peering connections, you must use the Region for the requester VPC to modify the requester VPC peering options and the Region for the accepter VPC to modify the accepter VPC peering options. To verify which VPCs are the accepter and the requester for a VPC peering connection, use the DescribeVpcPeeringConnections command.
See also: AWS API Documentation
Request Syntax
response = client.modify_vpc_peering_connection_options(
AccepterPeeringConnectionOptions={
'AllowDnsResolutionFromRemoteVpc': True|False,
'AllowEgressFromLocalClassicLinkToRemoteVpc': True|False,
'AllowEgressFromLocalVpcToRemoteClassicLink': True|False
},
DryRun=True|False,
RequesterPeeringConnectionOptions={
'AllowDnsResolutionFromRemoteVpc': True|False,
'AllowEgressFromLocalClassicLinkToRemoteVpc': True|False,
'AllowEgressFromLocalVpcToRemoteClassicLink': True|False
},
VpcPeeringConnectionId='string'
)
The VPC peering connection options for the accepter VPC.
If true, enables a local VPC to resolve public DNS hostnames to private IP addresses when queried from instances in the peer VPC.
If true, enables outbound communication from an EC2-Classic instance that's linked to a local VPC using ClassicLink to instances in a peer VPC.
If true, enables outbound communication from instances in a local VPC to an EC2-Classic instance that's linked to a peer VPC using ClassicLink.
The VPC peering connection options for the requester VPC.
If true, enables a local VPC to resolve public DNS hostnames to private IP addresses when queried from instances in the peer VPC.
If true, enables outbound communication from an EC2-Classic instance that's linked to a local VPC using ClassicLink to instances in a peer VPC.
If true, enables outbound communication from instances in a local VPC to an EC2-Classic instance that's linked to a peer VPC using ClassicLink.
[REQUIRED]
The ID of the VPC peering connection.
dict
Response Syntax
{
'AccepterPeeringConnectionOptions': {
'AllowDnsResolutionFromRemoteVpc': True|False,
'AllowEgressFromLocalClassicLinkToRemoteVpc': True|False,
'AllowEgressFromLocalVpcToRemoteClassicLink': True|False
},
'RequesterPeeringConnectionOptions': {
'AllowDnsResolutionFromRemoteVpc': True|False,
'AllowEgressFromLocalClassicLinkToRemoteVpc': True|False,
'AllowEgressFromLocalVpcToRemoteClassicLink': True|False
}
}
Response Structure
(dict) --
AccepterPeeringConnectionOptions (dict) --
Information about the VPC peering connection options for the accepter VPC.
AllowDnsResolutionFromRemoteVpc (boolean) --
If true, the public DNS hostnames of instances in the specified VPC resolve to private IP addresses when queried from instances in the peer VPC.
AllowEgressFromLocalClassicLinkToRemoteVpc (boolean) --
If true, enables outbound communication from an EC2-Classic instance that's linked to a local VPC using ClassicLink to instances in a peer VPC.
AllowEgressFromLocalVpcToRemoteClassicLink (boolean) --
If true, enables outbound communication from instances in a local VPC to an EC2-Classic instance that's linked to a peer VPC using ClassicLink.
RequesterPeeringConnectionOptions (dict) --
Information about the VPC peering connection options for the requester VPC.
AllowDnsResolutionFromRemoteVpc (boolean) --
If true, the public DNS hostnames of instances in the specified VPC resolve to private IP addresses when queried from instances in the peer VPC.
AllowEgressFromLocalClassicLinkToRemoteVpc (boolean) --
If true, enables outbound communication from an EC2-Classic instance that's linked to a local VPC using ClassicLink to instances in a peer VPC.
AllowEgressFromLocalVpcToRemoteClassicLink (boolean) --
If true, enables outbound communication from instances in a local VPC to an EC2-Classic instance that's linked to a peer VPC using ClassicLink.
Modifies the instance tenancy attribute of the specified VPC. You can change the instance tenancy attribute of a VPC to default only. You cannot change the instance tenancy attribute to dedicated .
After you modify the tenancy of the VPC, any new instances that you launch into the VPC have a tenancy of default , unless you specify otherwise during launch. The tenancy of any existing instances in the VPC is not affected.
For more information, see Dedicated Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.modify_vpc_tenancy(
VpcId='string',
InstanceTenancy='default',
DryRun=True|False
)
[REQUIRED]
The ID of the VPC.
[REQUIRED]
The instance tenancy attribute for the VPC.
dict
Response Syntax
{
'ReturnValue': True|False
}
Response Structure
(dict) --
ReturnValue (boolean) --
Returns true if the request succeeds; otherwise, returns an error.
Modifies the target gateway of a AWS Site-to-Site VPN connection. The following migration options are available:
Before you perform the migration to the new gateway, you must configure the new gateway. Use CreateVpnGateway to create a virtual private gateway, or CreateTransitGateway to create a transit gateway.
This step is required when you migrate from a virtual private gateway with static routes to a transit gateway.
You must delete the static routes before you migrate to the new gateway.
Keep a copy of the static route before you delete it. You will need to add back these routes to the transit gateway after the VPN connection migration is complete.
After you migrate to the new gateway, you might need to modify your VPC route table. Use CreateRoute and DeleteRoute to make the changes described in VPN Gateway Target Modification Required VPC Route Table Updates in the AWS Site-to-Site VPN User Guide .
When the new gateway is a transit gateway, modify the transit gateway route table to allow traffic between the VPC and the AWS Site-to-Site VPN connection. Use CreateTransitGatewayRoute to add the routes.
If you deleted VPN static routes, you must add the static routes to the transit gateway route table.
After you perform this operation, the AWS VPN endpoint's IP addresses on the AWS side and the tunnel options remain intact. Your s2slong; connection will be temporarily unavailable for approximately 10 minutes while we provision the new endpoints
See also: AWS API Documentation
Request Syntax
response = client.modify_vpn_connection(
VpnConnectionId='string',
TransitGatewayId='string',
VpnGatewayId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the VPN connection.
dict
Response Syntax
{
'VpnConnection': {
'CustomerGatewayConfiguration': 'string',
'CustomerGatewayId': 'string',
'Category': 'string',
'State': 'pending'|'available'|'deleting'|'deleted',
'Type': 'ipsec.1',
'VpnConnectionId': 'string',
'VpnGatewayId': 'string',
'TransitGatewayId': 'string',
'Options': {
'StaticRoutesOnly': True|False
},
'Routes': [
{
'DestinationCidrBlock': 'string',
'Source': 'Static',
'State': 'pending'|'available'|'deleting'|'deleted'
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VgwTelemetry': [
{
'AcceptedRouteCount': 123,
'LastStatusChange': datetime(2015, 1, 1),
'OutsideIpAddress': 'string',
'Status': 'UP'|'DOWN',
'StatusMessage': 'string'
},
]
}
}
Response Structure
(dict) --
VpnConnection (dict) --
Describes a VPN connection.
CustomerGatewayConfiguration (string) --
The configuration information for the VPN connection's customer gateway (in the native XML format). This element is always present in the CreateVpnConnection response; however, it's present in the DescribeVpnConnections response only if the VPN connection is in the pending or available state.
CustomerGatewayId (string) --
The ID of the customer gateway at your end of the VPN connection.
Category (string) --
The category of the VPN connection. A value of VPN indicates an AWS VPN connection. A value of VPN-Classic indicates an AWS Classic VPN connection.
State (string) --
The current state of the VPN connection.
Type (string) --
The type of VPN connection.
VpnConnectionId (string) --
The ID of the VPN connection.
VpnGatewayId (string) --
The ID of the virtual private gateway at the AWS side of the VPN connection.
TransitGatewayId (string) --
The ID of the transit gateway associated with the VPN connection.
Options (dict) --
The VPN connection options.
StaticRoutesOnly (boolean) --
Indicates whether the VPN connection uses static routes only. Static routes must be used for devices that don't support BGP.
Routes (list) --
The static routes associated with the VPN connection.
(dict) --
Describes a static route for a VPN connection.
DestinationCidrBlock (string) --
The CIDR block associated with the local subnet of the customer data center.
Source (string) --
Indicates how the routes were provided.
State (string) --
The current state of the static route.
Tags (list) --
Any tags assigned to the VPN connection.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VgwTelemetry (list) --
Information about the VPN tunnel.
(dict) --
Describes telemetry for a VPN tunnel.
AcceptedRouteCount (integer) --
The number of accepted routes.
LastStatusChange (datetime) --
The date and time of the last change in status.
OutsideIpAddress (string) --
The Internet-routable IP address of the virtual private gateway's outside interface.
Status (string) --
The status of the VPN tunnel.
StatusMessage (string) --
If an error occurs, a description of the error.
Enables detailed monitoring for a running instance. Otherwise, basic monitoring is enabled. For more information, see Monitoring Your Instances and Volumes in the Amazon Elastic Compute Cloud User Guide .
To disable detailed monitoring, see .
See also: AWS API Documentation
Request Syntax
response = client.monitor_instances(
InstanceIds=[
'string',
],
DryRun=True|False
)
[REQUIRED]
The IDs of the instances.
dict
Response Syntax
{
'InstanceMonitorings': [
{
'InstanceId': 'string',
'Monitoring': {
'State': 'disabled'|'disabling'|'enabled'|'pending'
}
},
]
}
Response Structure
(dict) --
InstanceMonitorings (list) --
The monitoring information.
(dict) --
Describes the monitoring of an instance.
InstanceId (string) --
The ID of the instance.
Monitoring (dict) --
The monitoring for the instance.
State (string) --
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
Moves an Elastic IP address from the EC2-Classic platform to the EC2-VPC platform. The Elastic IP address must be allocated to your account for more than 24 hours, and it must not be associated with an instance. After the Elastic IP address is moved, it is no longer available for use in the EC2-Classic platform, unless you move it back using the RestoreAddressToClassic request. You cannot move an Elastic IP address that was originally allocated for use in the EC2-VPC platform to the EC2-Classic platform.
See also: AWS API Documentation
Request Syntax
response = client.move_address_to_vpc(
DryRun=True|False,
PublicIp='string'
)
[REQUIRED]
The Elastic IP address.
dict
Response Syntax
{
'AllocationId': 'string',
'Status': 'MoveInProgress'|'InVpc'|'InClassic'
}
Response Structure
(dict) --
AllocationId (string) --
The allocation ID for the Elastic IP address.
Status (string) --
The status of the move of the IP address.
Examples
This example moves the specified Elastic IP address to the EC2-VPC platform.
response = client.move_address_to_vpc(
PublicIp='54.123.4.56',
)
print(response)
Expected Output:
{
'Status': 'MoveInProgress',
'ResponseMetadata': {
'...': '...',
},
}
Provisions an address range for use with your AWS resources through bring your own IP addresses (BYOIP) and creates a corresponding address pool. After the address range is provisioned, it is ready to be advertised using AdvertiseByoipCidr .
AWS verifies that you own the address range and are authorized to advertise it. You must ensure that the address range is registered to you and that you created an RPKI ROA to authorize Amazon ASNs 16509 and 14618 to advertise the address range. For more information, see Bring Your Own IP Addresses (BYOIP) in the Amazon Elastic Compute Cloud User Guide .
Provisioning an address range is an asynchronous operation, so the call returns immediately, but the address range is not ready to use until its status changes from pending-provision to provisioned . To monitor the status of an address range, use DescribeByoipCidrs . To allocate an Elastic IP address from your address pool, use AllocateAddress with either the specific address from the address pool or the ID of the address pool.
See also: AWS API Documentation
Request Syntax
response = client.provision_byoip_cidr(
Cidr='string',
CidrAuthorizationContext={
'Message': 'string',
'Signature': 'string'
},
Description='string',
DryRun=True|False
)
[REQUIRED]
The public IPv4 address range, in CIDR notation. The most specific prefix that you can specify is /24. The address range cannot overlap with another address range that you've brought to this or another Region.
A signed document that proves that you are authorized to bring the specified IP address range to Amazon using BYOIP.
The plain-text authorization message for the prefix and account.
The signed authorization message for the prefix and account.
dict
Response Syntax
{
'ByoipCidr': {
'Cidr': 'string',
'Description': 'string',
'StatusMessage': 'string',
'State': 'advertised'|'deprovisioned'|'failed-deprovision'|'failed-provision'|'pending-deprovision'|'pending-provision'|'provisioned'
}
}
Response Structure
(dict) --
ByoipCidr (dict) --
Information about the address pool.
Cidr (string) --
The public IPv4 address range, in CIDR notation.
Description (string) --
The description of the address range.
StatusMessage (string) --
Upon success, contains the ID of the address pool. Otherwise, contains an error message.
State (string) --
The state of the address pool.
Purchase a reservation with configurations that match those of your Dedicated Host. You must have active Dedicated Hosts in your account before you purchase a reservation. This action results in the specified reservation being purchased and charged to your account.
See also: AWS API Documentation
Request Syntax
response = client.purchase_host_reservation(
ClientToken='string',
CurrencyCode='USD',
HostIdSet=[
'string',
],
LimitPrice='string',
OfferingId='string'
)
[REQUIRED]
The IDs of the Dedicated Hosts with which the reservation will be associated.
[REQUIRED]
The ID of the offering.
dict
Response Syntax
{
'ClientToken': 'string',
'CurrencyCode': 'USD',
'Purchase': [
{
'CurrencyCode': 'USD',
'Duration': 123,
'HostIdSet': [
'string',
],
'HostReservationId': 'string',
'HourlyPrice': 'string',
'InstanceFamily': 'string',
'PaymentOption': 'AllUpfront'|'PartialUpfront'|'NoUpfront',
'UpfrontPrice': 'string'
},
],
'TotalHourlyPrice': 'string',
'TotalUpfrontPrice': 'string'
}
Response Structure
(dict) --
ClientToken (string) --
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency .
CurrencyCode (string) --
The currency in which the totalUpfrontPrice and totalHourlyPrice amounts are specified. At this time, the only supported currency is USD .
Purchase (list) --
Describes the details of the purchase.
(dict) --
Describes the result of the purchase.
CurrencyCode (string) --
The currency in which the UpfrontPrice and HourlyPrice amounts are specified. At this time, the only supported currency is USD .
Duration (integer) --
The duration of the reservation's term in seconds.
HostIdSet (list) --
The IDs of the Dedicated Hosts associated with the reservation.
HostReservationId (string) --
The ID of the reservation.
HourlyPrice (string) --
The hourly price of the reservation per hour.
InstanceFamily (string) --
The instance family on the Dedicated Host that the reservation can be associated with.
PaymentOption (string) --
The payment option for the reservation.
UpfrontPrice (string) --
The upfront price of the reservation.
TotalHourlyPrice (string) --
The total hourly price of the reservation calculated per hour.
TotalUpfrontPrice (string) --
The total amount charged to your account when you purchase the reservation.
Purchases a Reserved Instance for use with your account. With Reserved Instances, you pay a lower hourly rate compared to On-Demand instance pricing.
Use DescribeReservedInstancesOfferings to get a list of Reserved Instance offerings that match your specifications. After you've purchased a Reserved Instance, you can check for your new Reserved Instance with DescribeReservedInstances .
For more information, see Reserved Instances and Reserved Instance Marketplace in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.purchase_reserved_instances_offering(
InstanceCount=123,
ReservedInstancesOfferingId='string',
DryRun=True|False,
LimitPrice={
'Amount': 123.0,
'CurrencyCode': 'USD'
}
)
[REQUIRED]
The number of Reserved Instances to purchase.
[REQUIRED]
The ID of the Reserved Instance offering to purchase.
Specified for Reserved Instance Marketplace offerings to limit the total order and ensure that the Reserved Instances are not purchased at unexpected prices.
Used for Reserved Instance Marketplace offerings. Specifies the limit price on the total order (instanceCount * price).
The currency in which the limitPrice amount is specified. At this time, the only supported currency is USD .
dict
Response Syntax
{
'ReservedInstancesId': 'string'
}
Response Structure
(dict) --
Contains the output of PurchaseReservedInstancesOffering.
ReservedInstancesId (string) --
The IDs of the purchased Reserved Instances.
Purchases the Scheduled Instances with the specified schedule.
Scheduled Instances enable you to purchase Amazon EC2 compute capacity by the hour for a one-year term. Before you can purchase a Scheduled Instance, you must call DescribeScheduledInstanceAvailability to check for available schedules and obtain a purchase token. After you purchase a Scheduled Instance, you must call RunScheduledInstances during each scheduled time period.
After you purchase a Scheduled Instance, you can't cancel, modify, or resell your purchase.
See also: AWS API Documentation
Request Syntax
response = client.purchase_scheduled_instances(
ClientToken='string',
DryRun=True|False,
PurchaseRequests=[
{
'InstanceCount': 123,
'PurchaseToken': 'string'
},
]
)
Unique, case-sensitive identifier that ensures the idempotency of the request. For more information, see Ensuring Idempotency .
This field is autopopulated if not provided.
[REQUIRED]
The purchase requests.
Describes a request to purchase Scheduled Instances.
The number of instances.
The purchase token.
dict
Response Syntax
{
'ScheduledInstanceSet': [
{
'AvailabilityZone': 'string',
'CreateDate': datetime(2015, 1, 1),
'HourlyPrice': 'string',
'InstanceCount': 123,
'InstanceType': 'string',
'NetworkPlatform': 'string',
'NextSlotStartTime': datetime(2015, 1, 1),
'Platform': 'string',
'PreviousSlotEndTime': datetime(2015, 1, 1),
'Recurrence': {
'Frequency': 'string',
'Interval': 123,
'OccurrenceDaySet': [
123,
],
'OccurrenceRelativeToEnd': True|False,
'OccurrenceUnit': 'string'
},
'ScheduledInstanceId': 'string',
'SlotDurationInHours': 123,
'TermEndDate': datetime(2015, 1, 1),
'TermStartDate': datetime(2015, 1, 1),
'TotalScheduledInstanceHours': 123
},
]
}
Response Structure
(dict) --
Contains the output of PurchaseScheduledInstances.
ScheduledInstanceSet (list) --
Information about the Scheduled Instances.
(dict) --
Describes a Scheduled Instance.
AvailabilityZone (string) --
The Availability Zone.
CreateDate (datetime) --
The date when the Scheduled Instance was purchased.
HourlyPrice (string) --
The hourly price for a single instance.
InstanceCount (integer) --
The number of instances.
InstanceType (string) --
The instance type.
NetworkPlatform (string) --
The network platform (EC2-Classic or EC2-VPC ).
NextSlotStartTime (datetime) --
The time for the next schedule to start.
Platform (string) --
The platform (Linux/UNIX or Windows ).
PreviousSlotEndTime (datetime) --
The time that the previous schedule ended or will end.
Recurrence (dict) --
The schedule recurrence.
Frequency (string) --
The frequency (Daily , Weekly , or Monthly ).
Interval (integer) --
The interval quantity. The interval unit depends on the value of frequency . For example, every 2 weeks or every 2 months.
OccurrenceDaySet (list) --
The days. For a monthly schedule, this is one or more days of the month (1-31). For a weekly schedule, this is one or more days of the week (1-7, where 1 is Sunday).
OccurrenceRelativeToEnd (boolean) --
Indicates whether the occurrence is relative to the end of the specified week or month.
OccurrenceUnit (string) --
The unit for occurrenceDaySet (DayOfWeek or DayOfMonth ).
ScheduledInstanceId (string) --
The Scheduled Instance ID.
SlotDurationInHours (integer) --
The number of hours in the schedule.
TermEndDate (datetime) --
The end date for the Scheduled Instance.
TermStartDate (datetime) --
The start date for the Scheduled Instance.
TotalScheduledInstanceHours (integer) --
The total number of hours for a single instance for the entire term.
Examples
This example purchases a Scheduled Instance.
response = client.purchase_scheduled_instances(
PurchaseRequests=[
{
'InstanceCount': 1,
'PurchaseToken': 'eyJ2IjoiMSIsInMiOjEsImMiOi...',
},
],
)
print(response)
Expected Output:
{
'ScheduledInstanceSet': [
{
'AvailabilityZone': 'us-west-2b',
'CreateDate': datetime(2016, 1, 25, 21, 43, 38, 0, 25, 0),
'HourlyPrice': '0.095',
'InstanceCount': 1,
'InstanceType': 'c4.large',
'NetworkPlatform': 'EC2-VPC',
'NextSlotStartTime': datetime(2016, 1, 31, 9, 0, 0, 6, 31, 0),
'Platform': 'Linux/UNIX',
'Recurrence': {
'Frequency': 'Weekly',
'Interval': 1,
'OccurrenceDaySet': [
1,
],
'OccurrenceRelativeToEnd': False,
'OccurrenceUnit': '',
},
'ScheduledInstanceId': 'sci-1234-1234-1234-1234-123456789012',
'SlotDurationInHours': 32,
'TermEndDate': datetime(2017, 1, 31, 9, 0, 0, 1, 31, 0),
'TermStartDate': datetime(2016, 1, 31, 9, 0, 0, 6, 31, 0),
'TotalScheduledInstanceHours': 1696,
},
],
'ResponseMetadata': {
'...': '...',
},
}
Requests a reboot of the specified instances. This operation is asynchronous; it only queues a request to reboot the specified instances. The operation succeeds if the instances are valid and belong to you. Requests to reboot terminated instances are ignored.
If an instance does not cleanly shut down within four minutes, Amazon EC2 performs a hard reboot.
For more information about troubleshooting, see Getting Console Output and Rebooting Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.reboot_instances(
InstanceIds=[
'string',
],
DryRun=True|False
)
[REQUIRED]
The instance IDs.
None
Registers an AMI. When you're creating an AMI, this is the final step you must complete before you can launch an instance from the AMI. For more information about creating AMIs, see Creating Your Own AMIs in the Amazon Elastic Compute Cloud User Guide .
Note
For Amazon EBS-backed instances, CreateImage creates and registers the AMI in a single request, so you don't have to register the AMI yourself.
You can also use RegisterImage to create an Amazon EBS-backed Linux AMI from a snapshot of a root device volume. You specify the snapshot using the block device mapping. For more information, see Launching a Linux Instance from a Backup in the Amazon Elastic Compute Cloud User Guide .
You can't register an image where a secondary (non-root) snapshot has AWS Marketplace product codes.
Some Linux distributions, such as Red Hat Enterprise Linux (RHEL) and SUSE Linux Enterprise Server (SLES), use the EC2 billing product code associated with an AMI to verify the subscription status for package updates. Creating an AMI from an EBS snapshot does not maintain this billing code, and instances launched from such an AMI are not able to connect to package update infrastructure. If you purchase a Reserved Instance offering for one of these Linux distributions and launch instances using an AMI that does not contain the required billing code, your Reserved Instance is not applied to these instances.
To create an AMI for operating systems that require a billing code, see CreateImage .
If needed, you can deregister an AMI at any time. Any modifications you make to an AMI backed by an instance store volume invalidates its registration. If you make changes to an image, deregister the previous image and register the new image.
See also: AWS API Documentation
Request Syntax
response = client.register_image(
ImageLocation='string',
Architecture='i386'|'x86_64'|'arm64',
BlockDeviceMappings=[
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'Iops': 123,
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Encrypted': True|False,
'KmsKeyId': 'string'
},
'NoDevice': 'string'
},
],
Description='string',
DryRun=True|False,
EnaSupport=True|False,
KernelId='string',
Name='string',
BillingProducts=[
'string',
],
RamdiskId='string',
RootDeviceName='string',
SriovNetSupport='string',
VirtualizationType='string'
)
The architecture of the AMI.
Default: For Amazon EBS-backed AMIs, i386 . For instance store-backed AMIs, the architecture specified in the manifest file.
The block device mapping entries.
Describes a block device mapping.
The device name (for example, /dev/sdh or xvdh ).
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Parameters used to automatically set up EBS volumes when the instance is launched.
Indicates whether the EBS volume is deleted on instance termination.
The number of I/O operations per second (IOPS) that the volume supports. For io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
The ID of the snapshot.
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Constraints: 1-16384 for General Purpose SSD (gp2 ), 4-16384 for Provisioned IOPS SSD (io1 ), 500-16384 for Throughput Optimized HDD (st1 ), 500-16384 for Cold HDD (sc1 ), and 1-1024 for Magnetic (standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
The volume type. If you set the type to io1 , you must also set the Iops property.
Default: standard
Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
In no case can you remove encryption from an encrypted volume.
Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is encrypted.
This parameter is only supported on BlockDeviceMapping objects called by RunInstances , RequestSpotFleet , and RequestSpotInstances .
Suppresses the specified device included in the block device mapping of the AMI.
Set to true to enable enhanced networking with ENA for the AMI and any instances that you launch from the AMI.
This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable.
[REQUIRED]
A name for your AMI.
Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)
The billing product codes. Your account must be authorized to specify billing product codes. Otherwise, you can use the AWS Marketplace to bill for the use of an AMI.
Set to simple to enable enhanced networking with the Intel 82599 Virtual Function interface for the AMI and any instances that you launch from the AMI.
There is no way to disable sriovNetSupport at this time.
This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable.
The type of virtualization (hvm | paravirtual ).
Default: paravirtual
dict
Response Syntax
{
'ImageId': 'string'
}
Response Structure
(dict) --
Contains the output of RegisterImage.
ImageId (string) --
The ID of the newly registered AMI.
Rejects a request to attach a VPC to a transit gateway.
The VPC attachment must be in the pendingAcceptance state. Use DescribeTransitGatewayVpcAttachments to view your pending VPC attachment requests. Use AcceptTransitGatewayVpcAttachment to accept a VPC attachment request.
See also: AWS API Documentation
Request Syntax
response = client.reject_transit_gateway_vpc_attachment(
TransitGatewayAttachmentId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the attachment.
dict
Response Syntax
{
'TransitGatewayVpcAttachment': {
'TransitGatewayAttachmentId': 'string',
'TransitGatewayId': 'string',
'VpcId': 'string',
'VpcOwnerId': 'string',
'State': 'pendingAcceptance'|'rollingBack'|'pending'|'available'|'modifying'|'deleting'|'deleted'|'failed'|'rejected'|'rejecting'|'failing',
'SubnetIds': [
'string',
],
'CreationTime': datetime(2015, 1, 1),
'Options': {
'DnsSupport': 'enable'|'disable',
'Ipv6Support': 'enable'|'disable'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
TransitGatewayVpcAttachment (dict) --
Information about the attachment.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
TransitGatewayId (string) --
The ID of the transit gateway.
VpcId (string) --
The ID of the VPC.
VpcOwnerId (string) --
The ID of the AWS account that owns the VPC.
State (string) --
The state of the VPC attachment.
SubnetIds (list) --
The IDs of the subnets.
CreationTime (datetime) --
The creation time.
Options (dict) --
The VPC attachment options.
DnsSupport (string) --
Indicates whether DNS support is enabled.
Ipv6Support (string) --
Indicates whether IPv6 support is enabled.
Tags (list) --
The tags for the VPC attachment.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Rejects one or more VPC endpoint connection requests to your VPC endpoint service.
See also: AWS API Documentation
Request Syntax
response = client.reject_vpc_endpoint_connections(
DryRun=True|False,
ServiceId='string',
VpcEndpointIds=[
'string',
]
)
[REQUIRED]
The ID of the service.
[REQUIRED]
The IDs of one or more VPC endpoints.
dict
Response Syntax
{
'Unsuccessful': [
{
'Error': {
'Code': 'string',
'Message': 'string'
},
'ResourceId': 'string'
},
]
}
Response Structure
(dict) --
Unsuccessful (list) --
Information about the endpoints that were not rejected, if applicable.
(dict) --
Information about items that were not successfully processed in a batch call.
Error (dict) --
Information about the error.
Code (string) --
The error code.
Message (string) --
The error message accompanying the error code.
ResourceId (string) --
The ID of the resource.
Rejects a VPC peering connection request. The VPC peering connection must be in the pending-acceptance state. Use the DescribeVpcPeeringConnections request to view your outstanding VPC peering connection requests. To delete an active VPC peering connection, or to delete a VPC peering connection request that you initiated, use DeleteVpcPeeringConnection .
See also: AWS API Documentation
Request Syntax
response = client.reject_vpc_peering_connection(
DryRun=True|False,
VpcPeeringConnectionId='string'
)
[REQUIRED]
The ID of the VPC peering connection.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Releases the specified Elastic IP address.
[EC2-Classic, default VPC] Releasing an Elastic IP address automatically disassociates it from any instance that it's associated with. To disassociate an Elastic IP address without releasing it, use DisassociateAddress .
[Nondefault VPC] You must use DisassociateAddress to disassociate the Elastic IP address before you can release it. Otherwise, Amazon EC2 returns an error (InvalidIPAddress.InUse ).
After releasing an Elastic IP address, it is released to the IP address pool. Be sure to update your DNS records and any servers or devices that communicate with the address. If you attempt to release an Elastic IP address that you already released, you'll get an AuthFailure error if the address is already allocated to another AWS account.
[EC2-VPC] After you release an Elastic IP address for use in a VPC, you might be able to recover it. For more information, see AllocateAddress .
See also: AWS API Documentation
Request Syntax
response = client.release_address(
AllocationId='string',
PublicIp='string',
DryRun=True|False
)
None
Examples
This example releases an Elastic IP address for use with instances in a VPC.
response = client.release_address(
AllocationId='eipalloc-64d5890a',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
This example releases an Elastic IP address for use with instances in EC2-Classic.
response = client.release_address(
PublicIp='198.51.100.0',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
When you no longer want to use an On-Demand Dedicated Host it can be released. On-Demand billing is stopped and the host goes into released state. The host ID of Dedicated Hosts that have been released can no longer be specified in another request, for example, to modify the host. You must stop or terminate all instances on a host before it can be released.
When Dedicated Hosts are released, it may take some time for them to stop counting toward your limit and you may receive capacity errors when trying to allocate new Dedicated Hosts. Wait a few minutes and then try again.
Released hosts still appear in a DescribeHosts response.
See also: AWS API Documentation
Request Syntax
response = client.release_hosts(
HostIds=[
'string',
]
)
[REQUIRED]
The IDs of the Dedicated Hosts to release.
{
'Successful': [
'string',
],
'Unsuccessful': [
{
'Error': {
'Code': 'string',
'Message': 'string'
},
'ResourceId': 'string'
},
]
}
Response Structure
The IDs of the Dedicated Hosts that were successfully released.
The IDs of the Dedicated Hosts that could not be released, including an error message.
Information about items that were not successfully processed in a batch call.
Information about the error.
The error code.
The error message accompanying the error code.
The ID of the resource.
Replaces an IAM instance profile for the specified running instance. You can use this action to change the IAM instance profile that's associated with an instance without having to disassociate the existing IAM instance profile first.
Use DescribeIamInstanceProfileAssociations to get the association ID.
See also: AWS API Documentation
Request Syntax
response = client.replace_iam_instance_profile_association(
IamInstanceProfile={
'Arn': 'string',
'Name': 'string'
},
AssociationId='string'
)
[REQUIRED]
The IAM instance profile.
The Amazon Resource Name (ARN) of the instance profile.
The name of the instance profile.
[REQUIRED]
The ID of the existing IAM instance profile association.
dict
Response Syntax
{
'IamInstanceProfileAssociation': {
'AssociationId': 'string',
'InstanceId': 'string',
'IamInstanceProfile': {
'Arn': 'string',
'Id': 'string'
},
'State': 'associating'|'associated'|'disassociating'|'disassociated',
'Timestamp': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
IamInstanceProfileAssociation (dict) --
Information about the IAM instance profile association.
AssociationId (string) --
The ID of the association.
InstanceId (string) --
The ID of the instance.
IamInstanceProfile (dict) --
The IAM instance profile.
Arn (string) --
The Amazon Resource Name (ARN) of the instance profile.
Id (string) --
The ID of the instance profile.
State (string) --
The state of the association.
Timestamp (datetime) --
The time the IAM instance profile was associated with the instance.
Changes which network ACL a subnet is associated with. By default when you create a subnet, it's automatically associated with the default network ACL. For more information, see Network ACLs in the Amazon Virtual Private Cloud User Guide .
This is an idempotent operation.
See also: AWS API Documentation
Request Syntax
response = client.replace_network_acl_association(
AssociationId='string',
DryRun=True|False,
NetworkAclId='string'
)
[REQUIRED]
The ID of the current association between the original network ACL and the subnet.
[REQUIRED]
The ID of the new network ACL to associate with the subnet.
dict
Response Syntax
{
'NewAssociationId': 'string'
}
Response Structure
(dict) --
NewAssociationId (string) --
The ID of the new association.
Examples
This example associates the specified network ACL with the subnet for the specified network ACL association.
response = client.replace_network_acl_association(
AssociationId='aclassoc-e5b95c8c',
NetworkAclId='acl-5fb85d36',
)
print(response)
Expected Output:
{
'NewAssociationId': 'aclassoc-3999875b',
'ResponseMetadata': {
'...': '...',
},
}
Replaces an entry (rule) in a network ACL. For more information, see Network ACLs in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.replace_network_acl_entry(
CidrBlock='string',
DryRun=True|False,
Egress=True|False,
IcmpTypeCode={
'Code': 123,
'Type': 123
},
Ipv6CidrBlock='string',
NetworkAclId='string',
PortRange={
'From': 123,
'To': 123
},
Protocol='string',
RuleAction='allow'|'deny',
RuleNumber=123
)
[REQUIRED]
Indicates whether to replace the egress rule.
Default: If no value is specified, we replace the ingress rule.
ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol 1 (ICMP) or protocol 58 (ICMPv6) with an IPv6 CIDR block.
The ICMP code. A value of -1 means all codes for the specified ICMP type.
The ICMP type. A value of -1 means all types.
[REQUIRED]
The ID of the ACL.
TCP or UDP protocols: The range of ports the rule applies to. Required if specifying protocol 6 (TCP) or 17 (UDP).
The first port in the range.
The last port in the range.
[REQUIRED]
The protocol number. A value of "-1" means all protocols. If you specify "-1" or a protocol number other than "6" (TCP), "17" (UDP), or "1" (ICMP), traffic on all ports is allowed, regardless of any ports or ICMP types or codes that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR block, traffic for all ICMP types and codes allowed, regardless of any that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv6 CIDR block, you must specify an ICMP type and code.
[REQUIRED]
Indicates whether to allow or deny the traffic that matches the rule.
[REQUIRED]
The rule number of the entry to replace.
None
Examples
This example replaces an entry for the specified network ACL. The new rule 100 allows ingress traffic from 203.0.113.12/24 on UDP port 53 (DNS) into any associated subnet.
response = client.replace_network_acl_entry(
CidrBlock='203.0.113.12/24',
Egress=False,
NetworkAclId='acl-5fb85d36',
PortRange={
'From': 53,
'To': 53,
},
Protocol='udp',
RuleAction='allow',
RuleNumber=100,
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Replaces an existing route within a route table in a VPC. You must provide only one of the following: internet gateway or virtual private gateway, NAT instance, NAT gateway, VPC peering connection, network interface, or egress-only internet gateway.
For more information, see Route Tables in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.replace_route(
DestinationCidrBlock='string',
DestinationIpv6CidrBlock='string',
DryRun=True|False,
EgressOnlyInternetGatewayId='string',
GatewayId='string',
InstanceId='string',
NatGatewayId='string',
TransitGatewayId='string',
NetworkInterfaceId='string',
RouteTableId='string',
VpcPeeringConnectionId='string'
)
[REQUIRED]
The ID of the route table.
None
Examples
This example replaces the specified route in the specified table table. The new route matches the specified CIDR and sends the traffic to the specified virtual private gateway.
response = client.replace_route(
DestinationCidrBlock='10.0.0.0/16',
GatewayId='vgw-9a4cacf3',
RouteTableId='rtb-22574640',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Changes the route table associated with a given subnet in a VPC. After the operation completes, the subnet uses the routes in the new route table it's associated with. For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide .
You can also use ReplaceRouteTableAssociation to change which table is the main route table in the VPC. You just specify the main route table's association ID and the route table to be the new main route table.
See also: AWS API Documentation
Request Syntax
response = client.replace_route_table_association(
AssociationId='string',
DryRun=True|False,
RouteTableId='string'
)
[REQUIRED]
The association ID.
[REQUIRED]
The ID of the new route table to associate with the subnet.
dict
Response Syntax
{
'NewAssociationId': 'string'
}
Response Structure
(dict) --
NewAssociationId (string) --
The ID of the new association.
Examples
This example associates the specified route table with the subnet for the specified route table association.
response = client.replace_route_table_association(
AssociationId='rtbassoc-781d0d1a',
RouteTableId='rtb-22574640',
)
print(response)
Expected Output:
{
'NewAssociationId': 'rtbassoc-3a1f0f58',
'ResponseMetadata': {
'...': '...',
},
}
Replaces the specified route in the specified transit gateway route table.
See also: AWS API Documentation
Request Syntax
response = client.replace_transit_gateway_route(
DestinationCidrBlock='string',
TransitGatewayRouteTableId='string',
TransitGatewayAttachmentId='string',
Blackhole=True|False,
DryRun=True|False
)
[REQUIRED]
The CIDR range used for the destination match. Routing decisions are based on the most specific match.
[REQUIRED]
The ID of the route table.
dict
Response Syntax
{
'Route': {
'DestinationCidrBlock': 'string',
'TransitGatewayAttachments': [
{
'ResourceId': 'string',
'TransitGatewayAttachmentId': 'string',
'ResourceType': 'vpc'|'vpn'|'direct-connect-gateway'
},
],
'Type': 'static'|'propagated',
'State': 'pending'|'active'|'blackhole'|'deleting'|'deleted'
}
}
Response Structure
(dict) --
Route (dict) --
Information about the modified route.
DestinationCidrBlock (string) --
The CIDR block used for destination matches.
TransitGatewayAttachments (list) --
The attachments.
(dict) --
Describes a route attachment.
ResourceId (string) --
The ID of the resource.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
ResourceType (string) --
The resource type.
Type (string) --
The route type.
State (string) --
The state of the route.
Submits feedback about the status of an instance. The instance must be in the running state. If your experience with the instance differs from the instance status returned by DescribeInstanceStatus , use ReportInstanceStatus to report your experience with the instance. Amazon EC2 collects this information to improve the accuracy of status checks.
Use of this action does not change the value returned by DescribeInstanceStatus .
See also: AWS API Documentation
Request Syntax
response = client.report_instance_status(
Description='string',
DryRun=True|False,
EndTime=datetime(2015, 1, 1),
Instances=[
'string',
],
ReasonCodes=[
'instance-stuck-in-state'|'unresponsive'|'not-accepting-credentials'|'password-not-available'|'performance-network'|'performance-instance-store'|'performance-ebs-volume'|'performance-other'|'other',
],
StartTime=datetime(2015, 1, 1),
Status='ok'|'impaired'
)
[REQUIRED]
The instances.
[REQUIRED]
The reason codes that describe the health state of your instance.
[REQUIRED]
The status of all instances listed.
None
Creates a Spot Fleet request.
The Spot Fleet request specifies the total target capacity and the On-Demand target capacity. Amazon EC2 calculates the difference between the total capacity and On-Demand capacity, and launches the difference as Spot capacity.
You can submit a single request that includes multiple launch specifications that vary by instance type, AMI, Availability Zone, or subnet.
By default, the Spot Fleet requests Spot Instances in the Spot pool where the price per unit is the lowest. Each launch specification can include its own instance weighting that reflects the value of the instance type to your application workload.
Alternatively, you can specify that the Spot Fleet distribute the target capacity across the Spot pools included in its launch specifications. By ensuring that the Spot Instances in your Spot Fleet are in different Spot pools, you can improve the availability of your fleet.
You can specify tags for the Spot Instances. You cannot tag other resource types in a Spot Fleet request because only the instance resource type is supported.
For more information, see Spot Fleet Requests in the Amazon EC2 User Guide for Linux Instances .
See also: AWS API Documentation
Request Syntax
response = client.request_spot_fleet(
DryRun=True|False,
SpotFleetRequestConfig={
'AllocationStrategy': 'lowestPrice'|'diversified',
'OnDemandAllocationStrategy': 'lowestPrice'|'prioritized',
'ClientToken': 'string',
'ExcessCapacityTerminationPolicy': 'noTermination'|'default',
'FulfilledCapacity': 123.0,
'OnDemandFulfilledCapacity': 123.0,
'IamFleetRole': 'string',
'LaunchSpecifications': [
{
'SecurityGroups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'AddressingType': 'string',
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'Iops': 123,
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Encrypted': True|False,
'KmsKeyId': 'string'
},
'NoDevice': 'string'
},
],
'EbsOptimized': True|False,
'IamInstanceProfile': {
'Arn': 'string',
'Name': 'string'
},
'ImageId': 'string',
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'KernelId': 'string',
'KeyName': 'string',
'Monitoring': {
'Enabled': True|False
},
'NetworkInterfaces': [
{
'AssociatePublicIpAddress': True|False,
'DeleteOnTermination': True|False,
'Description': 'string',
'DeviceIndex': 123,
'Groups': [
'string',
],
'Ipv6AddressCount': 123,
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'NetworkInterfaceId': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
'SecondaryPrivateIpAddressCount': 123,
'SubnetId': 'string',
'InterfaceType': 'string'
},
],
'Placement': {
'AvailabilityZone': 'string',
'GroupName': 'string',
'Tenancy': 'default'|'dedicated'|'host'
},
'RamdiskId': 'string',
'SpotPrice': 'string',
'SubnetId': 'string',
'UserData': 'string',
'WeightedCapacity': 123.0,
'TagSpecifications': [
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
]
},
],
'LaunchTemplateConfigs': [
{
'LaunchTemplateSpecification': {
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'Version': 'string'
},
'Overrides': [
{
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'SpotPrice': 'string',
'SubnetId': 'string',
'AvailabilityZone': 'string',
'WeightedCapacity': 123.0,
'Priority': 123.0
},
]
},
],
'SpotPrice': 'string',
'TargetCapacity': 123,
'OnDemandTargetCapacity': 123,
'OnDemandMaxTotalPrice': 'string',
'SpotMaxTotalPrice': 'string',
'TerminateInstancesWithExpiration': True|False,
'Type': 'request'|'maintain'|'instant',
'ValidFrom': datetime(2015, 1, 1),
'ValidUntil': datetime(2015, 1, 1),
'ReplaceUnhealthyInstances': True|False,
'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate',
'LoadBalancersConfig': {
'ClassicLoadBalancersConfig': {
'ClassicLoadBalancers': [
{
'Name': 'string'
},
]
},
'TargetGroupsConfig': {
'TargetGroups': [
{
'Arn': 'string'
},
]
}
},
'InstancePoolsToUseCount': 123
}
)
[REQUIRED]
The configuration for the Spot Fleet request.
Indicates how to allocate the target capacity across the Spot pools specified by the Spot Fleet request. The default is lowestPrice .
The order of the launch template overrides to use in fulfilling On-Demand capacity. If you specify lowestPrice , Spot Fleet uses price to determine the order, launching the lowest price first. If you specify prioritized , Spot Fleet uses the priority that you assign to each Spot Fleet launch template override, launching the highest priority first. If you do not specify a value, Spot Fleet defaults to lowestPrice .
A unique, case-sensitive identifier that you provide to ensure the idempotency of your listings. This helps to avoid duplicate listings. For more information, see Ensuring Idempotency .
Indicates whether running Spot Instances should be terminated if you decrease the target capacity of the Spot Fleet request below the current size of the Spot Fleet.
The number of units fulfilled by this request compared to the set target capacity. You cannot set this value.
The number of On-Demand units fulfilled by this request compared to the set target On-Demand capacity.
The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) role that grants the Spot Fleet the permission to request, launch, terminate, and tag instances on your behalf. For more information, see Spot Fleet Prerequisites in the Amazon EC2 User Guide for Linux Instances . Spot Fleet can terminate Spot Instances on your behalf when you cancel its Spot Fleet request using CancelSpotFleetRequests or when the Spot Fleet request expires, if you set TerminateInstancesWithExpiration .
The launch specifications for the Spot Fleet request. If you specify LaunchSpecifications , you can't specify LaunchTemplateConfigs . If you include On-Demand capacity in your request, you must use LaunchTemplateConfigs .
Describes the launch specification for one or more Spot Instances. If you include On-Demand capacity in your fleet request, you can't use SpotFleetLaunchSpecification ; you must use LaunchTemplateConfig .
One or more security groups. When requesting instances in a VPC, you must specify the IDs of the security groups. When requesting instances in EC2-Classic, you can specify the names or the IDs of the security groups.
Describes a security group.
The name of the security group.
The ID of the security group.
Deprecated.
One or more block devices that are mapped to the Spot instances. You can't specify both a snapshot ID and an encryption value. This is because only blank volumes can be encrypted on creation. If a snapshot is the basis for a volume, it is not blank and its encryption status is used for the volume encryption status.
Describes a block device mapping.
The device name (for example, /dev/sdh or xvdh ).
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Parameters used to automatically set up EBS volumes when the instance is launched.
Indicates whether the EBS volume is deleted on instance termination.
The number of I/O operations per second (IOPS) that the volume supports. For io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
The ID of the snapshot.
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Constraints: 1-16384 for General Purpose SSD (gp2 ), 4-16384 for Provisioned IOPS SSD (io1 ), 500-16384 for Throughput Optimized HDD (st1 ), 500-16384 for Cold HDD (sc1 ), and 1-1024 for Magnetic (standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
The volume type. If you set the type to io1 , you must also set the Iops property.
Default: standard
Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
In no case can you remove encryption from an encrypted volume.
Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is encrypted.
This parameter is only supported on BlockDeviceMapping objects called by RunInstances , RequestSpotFleet , and RequestSpotInstances .
Suppresses the specified device included in the block device mapping of the AMI.
Indicates whether the instances are optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.
Default: false
The IAM instance profile.
The Amazon Resource Name (ARN) of the instance profile.
The name of the instance profile.
The ID of the AMI.
The instance type.
The ID of the kernel.
The name of the key pair.
Enable or disable monitoring for the instances.
Enables monitoring for the instance.
Default: false
One or more network interfaces. If you specify a network interface, you must specify subnet IDs and security group IDs using the network interface.
Describes a network interface.
Indicates whether to assign a public IPv4 address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is true .
If set to true , the interface is deleted when the instance is terminated. You can specify true only if creating a new network interface when launching an instance.
The description of the network interface. Applies only if creating a network interface when launching an instance.
The position of the network interface in the attachment order. A primary network interface has a device index of 0.
If you specify a network interface when launching an instance, you must specify the device index.
The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.
A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.
One or more IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.
Describes an IPv6 address.
The IPv6 address.
The ID of the network interface.
The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance. You cannot specify this option if you're launching more than one instance in a RunInstances request.
One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you're launching more than one instance in a RunInstances request.
Describes a secondary private IPv4 address for a network interface.
Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.
The private IPv4 addresses.
The number of secondary private IPv4 addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you're launching more than one instance in a RunInstances request.
The ID of the subnet associated with the network string. Applies only if creating a network interface when launching an instance.
The type of network interface. To create an Elastic Fabric Adapter (EFA), specify efa . For more information, see Elastic Fabric Adapter in the Amazon Elastic Compute Cloud User Guide .
If you are not creating an EFA, specify interface or omit this parameter.
Valid values: interface | efa
The placement information.
The Availability Zone.
[Spot Fleet only] To specify multiple Availability Zones, separate them using commas; for example, "us-west-2a, us-west-2b".
The name of the placement group.
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for Spot Instances.
The ID of the RAM disk. Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, refer to the AWS Resource Center and search for the kernel ID.
The maximum price per unit hour that you are willing to pay for a Spot Instance. If this value is not specified, the default is the Spot price specified for the fleet. To determine the Spot price per unit hour, divide the Spot price by the value of WeightedCapacity .
The ID of the subnet in which to launch the instances. To specify multiple subnets, separate them using commas; for example, "subnet-a61dafcf, subnet-65ea5f08".
The Base64-encoded user data that instances use when starting up.
The number of units provided by the specified instance type. These are the same units that you chose to set the target capacity in terms of instances, or a performance characteristic such as vCPUs, memory, or I/O.
If the target capacity divided by this value is not a whole number, Amazon EC2 rounds the number of instances to the next whole number. If this value is not specified, the default is 1.
The tags to apply during creation.
The tags for a Spot Fleet resource.
The type of resource. Currently, the only resource type that is supported is instance .
The tags.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
The launch template and overrides. If you specify LaunchTemplateConfigs , you can't specify LaunchSpecifications . If you include On-Demand capacity in your request, you must use LaunchTemplateConfigs .
Describes a launch template and overrides.
The launch template.
The ID of the launch template. You must specify either a template ID or a template name.
The name of the launch template. You must specify either a template name or a template ID.
The version number of the launch template. You must specify a version number.
Any parameters that you specify override the same parameters in the launch template.
Describes overrides for a launch template.
The instance type.
The maximum price per unit hour that you are willing to pay for a Spot Instance.
The ID of the subnet in which to launch the instances.
The Availability Zone in which to launch the instances.
The number of units provided by the specified instance type.
The priority for the launch template override. If OnDemandAllocationStrategy is set to prioritized , Spot Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity. The highest priority is launched first. Valid values are whole numbers starting at 0 . The lower the number, the higher the priority. If no number is set, the launch template override has the lowest priority.
The maximum price per unit hour that you are willing to pay for a Spot Instance. The default is the On-Demand price.
The number of units to request for the Spot Fleet. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is maintain , you can specify a target capacity of 0 and add capacity later.
The number of On-Demand units to request. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is maintain , you can specify a target capacity of 0 and add capacity later.
The maximum amount per hour for On-Demand Instances that you're willing to pay. You can use the onDemandMaxTotalPrice parameter, the spotMaxTotalPrice parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you're willing to pay. When the maximum amount you're willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.
The maximum amount per hour for Spot Instances that you're willing to pay. You can use the spotdMaxTotalPrice parameter, the onDemandMaxTotalPrice parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you're willing to pay. When the maximum amount you're willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.
Indicates whether running Spot Instances are terminated when the Spot Fleet request expires.
The type of request. Indicates whether the Spot Fleet only requests the target capacity or also attempts to maintain it. When this value is request , the Spot Fleet only places the required requests. It does not attempt to replenish Spot Instances if capacity is diminished, nor does it submit requests in alternative Spot pools if capacity is not available. When this value is maintain , the Spot Fleet maintains the target capacity. The Spot Fleet places the required requests to meet capacity and automatically replenishes any interrupted instances. Default: maintain . instant is listed but is not used by Spot Fleet.
The start date and time of the request, in UTC format (YYYY -MM -DD T*HH* :MM :SS Z). By default, Amazon EC2 starts fulfilling the request immediately.
The end date and time of the request, in UTC format (YYYY -MM -DD T*HH* :MM :SS Z). After the end date and time, no new Spot Instance requests are placed or able to fulfill the request. If no value is specified, the Spot Fleet request remains until you cancel it.
Indicates whether Spot Fleet should replace unhealthy instances.
The behavior when a Spot Instance is interrupted. The default is terminate .
One or more Classic Load Balancers and target groups to attach to the Spot Fleet request. Spot Fleet registers the running Spot Instances with the specified Classic Load Balancers and target groups.
With Network Load Balancers, Spot Fleet cannot register instances that have the following instance types: C1, CC1, CC2, CG1, CG2, CR1, CS1, G1, G2, HI1, HS1, M1, M2, M3, and T1.
The Classic Load Balancers.
One or more Classic Load Balancers.
Describes a Classic Load Balancer.
The name of the load balancer.
The target groups.
One or more target groups.
Describes a load balancer target group.
The Amazon Resource Name (ARN) of the target group.
The number of Spot pools across which to allocate your target Spot capacity. Valid only when Spot AllocationStrategy is set to lowest-price . Spot Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify.
dict
Response Syntax
{
'SpotFleetRequestId': 'string'
}
Response Structure
(dict) --
Contains the output of RequestSpotFleet.
SpotFleetRequestId (string) --
The ID of the Spot Fleet request.
Examples
This example creates a Spot fleet request with two launch specifications that differ only by subnet. The Spot fleet launches the instances in the specified subnet with the lowest price. If the instances are launched in a default VPC, they receive a public IP address by default. If the instances are launched in a nondefault VPC, they do not receive a public IP address by default. Note that you can't specify different subnets from the same Availability Zone in a Spot fleet request.
response = client.request_spot_fleet(
SpotFleetRequestConfig={
'IamFleetRole': 'arn:aws:iam::123456789012:role/my-spot-fleet-role',
'LaunchSpecifications': [
{
'IamInstanceProfile': {
'Arn': 'arn:aws:iam::123456789012:instance-profile/my-iam-role',
},
'ImageId': 'ami-1a2b3c4d',
'InstanceType': 'm3.medium',
'KeyName': 'my-key-pair',
'SecurityGroups': [
{
'GroupId': 'sg-1a2b3c4d',
},
],
'SubnetId': 'subnet-1a2b3c4d, subnet-3c4d5e6f',
},
],
'SpotPrice': '0.04',
'TargetCapacity': 2,
},
)
print(response)
Expected Output:
{
'SpotFleetRequestId': 'sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE',
'ResponseMetadata': {
'...': '...',
},
}
This example creates a Spot fleet request with two launch specifications that differ only by Availability Zone. The Spot fleet launches the instances in the specified Availability Zone with the lowest price. If your account supports EC2-VPC only, Amazon EC2 launches the Spot instances in the default subnet of the Availability Zone. If your account supports EC2-Classic, Amazon EC2 launches the instances in EC2-Classic in the Availability Zone.
response = client.request_spot_fleet(
SpotFleetRequestConfig={
'IamFleetRole': 'arn:aws:iam::123456789012:role/my-spot-fleet-role',
'LaunchSpecifications': [
{
'IamInstanceProfile': {
'Arn': 'arn:aws:iam::123456789012:instance-profile/my-iam-role',
},
'ImageId': 'ami-1a2b3c4d',
'InstanceType': 'm3.medium',
'KeyName': 'my-key-pair',
'Placement': {
'AvailabilityZone': 'us-west-2a, us-west-2b',
},
'SecurityGroups': [
{
'GroupId': 'sg-1a2b3c4d',
},
],
},
],
'SpotPrice': '0.04',
'TargetCapacity': 2,
},
)
print(response)
Expected Output:
{
'SpotFleetRequestId': 'sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE',
'ResponseMetadata': {
'...': '...',
},
}
This example assigns public addresses to instances launched in a nondefault VPC. Note that when you specify a network interface, you must include the subnet ID and security group ID using the network interface.
response = client.request_spot_fleet(
SpotFleetRequestConfig={
'IamFleetRole': 'arn:aws:iam::123456789012:role/my-spot-fleet-role',
'LaunchSpecifications': [
{
'IamInstanceProfile': {
'Arn': 'arn:aws:iam::880185128111:instance-profile/my-iam-role',
},
'ImageId': 'ami-1a2b3c4d',
'InstanceType': 'm3.medium',
'KeyName': 'my-key-pair',
'NetworkInterfaces': [
{
'AssociatePublicIpAddress': True,
'DeviceIndex': 0,
'Groups': [
'sg-1a2b3c4d',
],
'SubnetId': 'subnet-1a2b3c4d',
},
],
},
],
'SpotPrice': '0.04',
'TargetCapacity': 2,
},
)
print(response)
Expected Output:
{
'SpotFleetRequestId': 'sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE',
'ResponseMetadata': {
'...': '...',
},
}
This example creates a Spot fleet request that launches 30 instances using the diversified allocation strategy. The launch specifications differ by instance type. The Spot fleet distributes the instances across the launch specifications such that there are 10 instances of each type.
response = client.request_spot_fleet(
SpotFleetRequestConfig={
'AllocationStrategy': 'diversified',
'IamFleetRole': 'arn:aws:iam::123456789012:role/my-spot-fleet-role',
'LaunchSpecifications': [
{
'ImageId': 'ami-1a2b3c4d',
'InstanceType': 'c4.2xlarge',
'SubnetId': 'subnet-1a2b3c4d',
},
{
'ImageId': 'ami-1a2b3c4d',
'InstanceType': 'm3.2xlarge',
'SubnetId': 'subnet-1a2b3c4d',
},
{
'ImageId': 'ami-1a2b3c4d',
'InstanceType': 'r3.2xlarge',
'SubnetId': 'subnet-1a2b3c4d',
},
],
'SpotPrice': '0.70',
'TargetCapacity': 30,
},
)
print(response)
Expected Output:
{
'SpotFleetRequestId': 'sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE',
'ResponseMetadata': {
'...': '...',
},
}
Creates a Spot Instance request.
For more information, see Spot Instance Requests in the Amazon EC2 User Guide for Linux Instances .
See also: AWS API Documentation
Request Syntax
response = client.request_spot_instances(
AvailabilityZoneGroup='string',
BlockDurationMinutes=123,
ClientToken='string',
DryRun=True|False,
InstanceCount=123,
LaunchGroup='string',
LaunchSpecification={
'SecurityGroupIds': [
'string',
],
'SecurityGroups': [
'string',
],
'AddressingType': 'string',
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'Iops': 123,
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Encrypted': True|False,
'KmsKeyId': 'string'
},
'NoDevice': 'string'
},
],
'EbsOptimized': True|False,
'IamInstanceProfile': {
'Arn': 'string',
'Name': 'string'
},
'ImageId': 'string',
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'KernelId': 'string',
'KeyName': 'string',
'Monitoring': {
'Enabled': True|False
},
'NetworkInterfaces': [
{
'AssociatePublicIpAddress': True|False,
'DeleteOnTermination': True|False,
'Description': 'string',
'DeviceIndex': 123,
'Groups': [
'string',
],
'Ipv6AddressCount': 123,
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'NetworkInterfaceId': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
'SecondaryPrivateIpAddressCount': 123,
'SubnetId': 'string',
'InterfaceType': 'string'
},
],
'Placement': {
'AvailabilityZone': 'string',
'GroupName': 'string',
'Tenancy': 'default'|'dedicated'|'host'
},
'RamdiskId': 'string',
'SubnetId': 'string',
'UserData': 'string'
},
SpotPrice='string',
Type='one-time'|'persistent',
ValidFrom=datetime(2015, 1, 1),
ValidUntil=datetime(2015, 1, 1),
InstanceInterruptionBehavior='hibernate'|'stop'|'terminate'
)
The user-specified name for a logical grouping of requests.
When you specify an Availability Zone group in a Spot Instance request, all Spot Instances in the request are launched in the same Availability Zone. Instance proximity is maintained with this parameter, but the choice of Availability Zone is not. The group applies only to requests for Spot Instances of the same instance type. Any additional Spot Instance requests that are specified with the same Availability Zone group name are launched in that same Availability Zone, as long as at least one instance from the group is still active.
If there is no active instance running in the Availability Zone group that you specify for a new Spot Instance request (all instances are terminated, the request is expired, or the maximum price you specified falls below current Spot price), then Amazon EC2 launches the instance in any Availability Zone where the constraint can be met. Consequently, the subsequent set of Spot Instances could be placed in a different zone from the original request, even if you specified the same Availability Zone group.
Default: Instances are launched in any available Availability Zone.
The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).
The duration period starts as soon as your Spot Instance receives its instance ID. At the end of the duration period, Amazon EC2 marks the Spot Instance for termination and provides a Spot Instance termination notice, which gives the instance a two-minute warning before it terminates.
You can't specify an Availability Zone group or a launch group if you specify a duration.
The maximum number of Spot Instances to launch.
Default: 1
The instance launch group. Launch groups are Spot Instances that launch together and terminate together.
Default: Instances are launched and terminated individually
The launch specification.
One or more security group IDs.
One or more security groups. When requesting instances in a VPC, you must specify the IDs of the security groups. When requesting instances in EC2-Classic, you can specify the names or the IDs of the security groups.
Deprecated.
One or more block device mapping entries. You can't specify both a snapshot ID and an encryption value. This is because only blank volumes can be encrypted on creation. If a snapshot is the basis for a volume, it is not blank and its encryption status is used for the volume encryption status.
Describes a block device mapping.
The device name (for example, /dev/sdh or xvdh ).
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Parameters used to automatically set up EBS volumes when the instance is launched.
Indicates whether the EBS volume is deleted on instance termination.
The number of I/O operations per second (IOPS) that the volume supports. For io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
The ID of the snapshot.
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Constraints: 1-16384 for General Purpose SSD (gp2 ), 4-16384 for Provisioned IOPS SSD (io1 ), 500-16384 for Throughput Optimized HDD (st1 ), 500-16384 for Cold HDD (sc1 ), and 1-1024 for Magnetic (standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
The volume type. If you set the type to io1 , you must also set the Iops property.
Default: standard
Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
In no case can you remove encryption from an encrypted volume.
Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is encrypted.
This parameter is only supported on BlockDeviceMapping objects called by RunInstances , RequestSpotFleet , and RequestSpotInstances .
Suppresses the specified device included in the block device mapping of the AMI.
Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.
Default: false
The IAM instance profile.
The Amazon Resource Name (ARN) of the instance profile.
The name of the instance profile.
The ID of the AMI.
The instance type.
The ID of the kernel.
The name of the key pair.
Indicates whether basic or detailed monitoring is enabled for the instance.
Default: Disabled
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
One or more network interfaces. If you specify a network interface, you must specify subnet IDs and security group IDs using the network interface.
Describes a network interface.
Indicates whether to assign a public IPv4 address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is true .
If set to true , the interface is deleted when the instance is terminated. You can specify true only if creating a new network interface when launching an instance.
The description of the network interface. Applies only if creating a network interface when launching an instance.
The position of the network interface in the attachment order. A primary network interface has a device index of 0.
If you specify a network interface when launching an instance, you must specify the device index.
The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.
A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.
One or more IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.
Describes an IPv6 address.
The IPv6 address.
The ID of the network interface.
The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance. You cannot specify this option if you're launching more than one instance in a RunInstances request.
One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you're launching more than one instance in a RunInstances request.
Describes a secondary private IPv4 address for a network interface.
Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.
The private IPv4 addresses.
The number of secondary private IPv4 addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you're launching more than one instance in a RunInstances request.
The ID of the subnet associated with the network string. Applies only if creating a network interface when launching an instance.
The type of network interface. To create an Elastic Fabric Adapter (EFA), specify efa . For more information, see Elastic Fabric Adapter in the Amazon Elastic Compute Cloud User Guide .
If you are not creating an EFA, specify interface or omit this parameter.
Valid values: interface | efa
The placement information for the instance.
The Availability Zone.
[Spot Fleet only] To specify multiple Availability Zones, separate them using commas; for example, "us-west-2a, us-west-2b".
The name of the placement group.
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for Spot Instances.
The ID of the RAM disk.
The ID of the subnet in which to launch the instance.
The Base64-encoded user data for the instance. User data is limited to 16 KB.
The Spot Instance request type.
Default: one-time
dict
Response Syntax
{
'SpotInstanceRequests': [
{
'ActualBlockHourlyPrice': 'string',
'AvailabilityZoneGroup': 'string',
'BlockDurationMinutes': 123,
'CreateTime': datetime(2015, 1, 1),
'Fault': {
'Code': 'string',
'Message': 'string'
},
'InstanceId': 'string',
'LaunchGroup': 'string',
'LaunchSpecification': {
'UserData': 'string',
'SecurityGroups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'AddressingType': 'string',
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'Iops': 123,
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Encrypted': True|False,
'KmsKeyId': 'string'
},
'NoDevice': 'string'
},
],
'EbsOptimized': True|False,
'IamInstanceProfile': {
'Arn': 'string',
'Name': 'string'
},
'ImageId': 'string',
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'KernelId': 'string',
'KeyName': 'string',
'NetworkInterfaces': [
{
'AssociatePublicIpAddress': True|False,
'DeleteOnTermination': True|False,
'Description': 'string',
'DeviceIndex': 123,
'Groups': [
'string',
],
'Ipv6AddressCount': 123,
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'NetworkInterfaceId': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
'SecondaryPrivateIpAddressCount': 123,
'SubnetId': 'string',
'InterfaceType': 'string'
},
],
'Placement': {
'AvailabilityZone': 'string',
'GroupName': 'string',
'Tenancy': 'default'|'dedicated'|'host'
},
'RamdiskId': 'string',
'SubnetId': 'string',
'Monitoring': {
'Enabled': True|False
}
},
'LaunchedAvailabilityZone': 'string',
'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
'SpotInstanceRequestId': 'string',
'SpotPrice': 'string',
'State': 'open'|'active'|'closed'|'cancelled'|'failed',
'Status': {
'Code': 'string',
'Message': 'string',
'UpdateTime': datetime(2015, 1, 1)
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'Type': 'one-time'|'persistent',
'ValidFrom': datetime(2015, 1, 1),
'ValidUntil': datetime(2015, 1, 1),
'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate'
},
]
}
Response Structure
(dict) --
Contains the output of RequestSpotInstances.
SpotInstanceRequests (list) --
One or more Spot Instance requests.
(dict) --
Describes a Spot Instance request.
ActualBlockHourlyPrice (string) --
If you specified a duration and your Spot Instance request was fulfilled, this is the fixed hourly price in effect for the Spot Instance while it runs.
AvailabilityZoneGroup (string) --
The Availability Zone group. If you specify the same Availability Zone group for all Spot Instance requests, all Spot Instances are launched in the same Availability Zone.
BlockDurationMinutes (integer) --
The duration for the Spot Instance, in minutes.
CreateTime (datetime) --
The date and time when the Spot Instance request was created, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).
Fault (dict) --
The fault codes for the Spot Instance request, if any.
Code (string) --
The reason code for the Spot Instance state change.
Message (string) --
The message for the Spot Instance state change.
InstanceId (string) --
The instance ID, if an instance has been launched to fulfill the Spot Instance request.
LaunchGroup (string) --
The instance launch group. Launch groups are Spot Instances that launch together and terminate together.
LaunchSpecification (dict) --
Additional information for launching instances.
UserData (string) --
The Base64-encoded user data for the instance.
SecurityGroups (list) --
One or more security groups. When requesting instances in a VPC, you must specify the IDs of the security groups. When requesting instances in EC2-Classic, you can specify the names or the IDs of the security groups.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
AddressingType (string) --
Deprecated.
BlockDeviceMappings (list) --
One or more block device mapping entries.
(dict) --
Describes a block device mapping.
DeviceName (string) --
The device name (for example, /dev/sdh or xvdh ).
VirtualName (string) --
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Ebs (dict) --
Parameters used to automatically set up EBS volumes when the instance is launched.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports. For io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
SnapshotId (string) --
The ID of the snapshot.
VolumeSize (integer) --
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Constraints: 1-16384 for General Purpose SSD (gp2 ), 4-16384 for Provisioned IOPS SSD (io1 ), 500-16384 for Throughput Optimized HDD (st1 ), 500-16384 for Cold HDD (sc1 ), and 1-1024 for Magnetic (standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
VolumeType (string) --
The volume type. If you set the type to io1 , you must also set the Iops property.
Default: standard
Encrypted (boolean) --
Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
In no case can you remove encryption from an encrypted volume.
Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
KmsKeyId (string) --
Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is encrypted.
This parameter is only supported on BlockDeviceMapping objects called by RunInstances , RequestSpotFleet , and RequestSpotInstances .
NoDevice (string) --
Suppresses the specified device included in the block device mapping of the AMI.
EbsOptimized (boolean) --
Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.
Default: false
IamInstanceProfile (dict) --
The IAM instance profile.
Arn (string) --
The Amazon Resource Name (ARN) of the instance profile.
Name (string) --
The name of the instance profile.
ImageId (string) --
The ID of the AMI.
InstanceType (string) --
The instance type.
KernelId (string) --
The ID of the kernel.
KeyName (string) --
The name of the key pair.
NetworkInterfaces (list) --
One or more network interfaces. If you specify a network interface, you must specify subnet IDs and security group IDs using the network interface.
(dict) --
Describes a network interface.
AssociatePublicIpAddress (boolean) --
Indicates whether to assign a public IPv4 address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is true .
DeleteOnTermination (boolean) --
If set to true , the interface is deleted when the instance is terminated. You can specify true only if creating a new network interface when launching an instance.
Description (string) --
The description of the network interface. Applies only if creating a network interface when launching an instance.
DeviceIndex (integer) --
The position of the network interface in the attachment order. A primary network interface has a device index of 0.
If you specify a network interface when launching an instance, you must specify the device index.
Groups (list) --
The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.
Ipv6AddressCount (integer) --
A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.
Ipv6Addresses (list) --
One or more IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.
(dict) --
Describes an IPv6 address.
Ipv6Address (string) --
The IPv6 address.
NetworkInterfaceId (string) --
The ID of the network interface.
PrivateIpAddress (string) --
The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance. You cannot specify this option if you're launching more than one instance in a RunInstances request.
PrivateIpAddresses (list) --
One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you're launching more than one instance in a RunInstances request.
(dict) --
Describes a secondary private IPv4 address for a network interface.
Primary (boolean) --
Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.
PrivateIpAddress (string) --
The private IPv4 addresses.
SecondaryPrivateIpAddressCount (integer) --
The number of secondary private IPv4 addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you're launching more than one instance in a RunInstances request.
SubnetId (string) --
The ID of the subnet associated with the network string. Applies only if creating a network interface when launching an instance.
InterfaceType (string) --
The type of network interface. To create an Elastic Fabric Adapter (EFA), specify efa . For more information, see Elastic Fabric Adapter in the Amazon Elastic Compute Cloud User Guide .
If you are not creating an EFA, specify interface or omit this parameter.
Valid values: interface | efa
Placement (dict) --
The placement information for the instance.
AvailabilityZone (string) --
The Availability Zone.
[Spot Fleet only] To specify multiple Availability Zones, separate them using commas; for example, "us-west-2a, us-west-2b".
GroupName (string) --
The name of the placement group.
Tenancy (string) --
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for Spot Instances.
RamdiskId (string) --
The ID of the RAM disk.
SubnetId (string) --
The ID of the subnet in which to launch the instance.
Monitoring (dict) --
Describes the monitoring of an instance.
Enabled (boolean) --
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
LaunchedAvailabilityZone (string) --
The Availability Zone in which the request is launched.
ProductDescription (string) --
The product description associated with the Spot Instance.
SpotInstanceRequestId (string) --
The ID of the Spot Instance request.
SpotPrice (string) --
The maximum price per hour that you are willing to pay for a Spot Instance.
State (string) --
The state of the Spot Instance request. Spot status information helps track your Spot Instance requests. For more information, see Spot Status in the Amazon EC2 User Guide for Linux Instances .
Status (dict) --
The status code and status message describing the Spot Instance request.
Code (string) --
The status code. For a list of status codes, see Spot Status Codes in the Amazon EC2 User Guide for Linux Instances .
Message (string) --
The description for the status code.
UpdateTime (datetime) --
The date and time of the most recent status update, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).
Tags (list) --
Any tags assigned to the resource.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Type (string) --
The Spot Instance request type.
ValidFrom (datetime) --
The start date of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). The request becomes active at this date and time.
ValidUntil (datetime) --
The end date of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). If this is a one-time request, it remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date is reached. The default end date is 7 days from the current date.
InstanceInterruptionBehavior (string) --
The behavior when a Spot Instance is interrupted.
Examples
This example creates a one-time Spot Instance request for five instances in the specified Availability Zone. If your account supports EC2-VPC only, Amazon EC2 launches the instances in the default subnet of the specified Availability Zone. If your account supports EC2-Classic, Amazon EC2 launches the instances in EC2-Classic in the specified Availability Zone.
response = client.request_spot_instances(
InstanceCount=5,
LaunchSpecification={
'IamInstanceProfile': {
'Arn': 'arn:aws:iam::123456789012:instance-profile/my-iam-role',
},
'ImageId': 'ami-1a2b3c4d',
'InstanceType': 'm3.medium',
'KeyName': 'my-key-pair',
'Placement': {
'AvailabilityZone': 'us-west-2a',
},
'SecurityGroupIds': [
'sg-1a2b3c4d',
],
},
SpotPrice='0.03',
Type='one-time',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
This example command creates a one-time Spot Instance request for five instances in the specified subnet. Amazon EC2 launches the instances in the specified subnet. If the VPC is a nondefault VPC, the instances do not receive a public IP address by default.
response = client.request_spot_instances(
InstanceCount=5,
LaunchSpecification={
'IamInstanceProfile': {
'Arn': 'arn:aws:iam::123456789012:instance-profile/my-iam-role',
},
'ImageId': 'ami-1a2b3c4d',
'InstanceType': 'm3.medium',
'SecurityGroupIds': [
'sg-1a2b3c4d',
],
'SubnetId': 'subnet-1a2b3c4d',
},
SpotPrice='0.050',
Type='one-time',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Resets the default customer master key (CMK) for EBS encryption for your account in this Region to the AWS managed CMK for EBS.
After resetting the default CMK to the AWS managed CMK, you can continue to encrypt by a customer managed CMK by specifying it when you create the volume. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.reset_ebs_default_kms_key_id(
DryRun=True|False
)
{
'KmsKeyId': 'string'
}
Response Structure
The Amazon Resource Name (ARN) of the default CMK for EBS encryption by default.
Resets the specified attribute of the specified Amazon FPGA Image (AFI) to its default value. You can only reset the load permission attribute.
See also: AWS API Documentation
Request Syntax
response = client.reset_fpga_image_attribute(
DryRun=True|False,
FpgaImageId='string',
Attribute='loadPermission'
)
[REQUIRED]
The ID of the AFI.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Is true if the request succeeds, and an error otherwise.
Resets an attribute of an AMI to its default value.
Note
The productCodes attribute can't be reset.
See also: AWS API Documentation
Request Syntax
response = client.reset_image_attribute(
Attribute='launchPermission',
ImageId='string',
DryRun=True|False
)
[REQUIRED]
The attribute to reset (currently you can only reset the launch permission attribute).
[REQUIRED]
The ID of the AMI.
None
Resets an attribute of an instance to its default value. To reset the kernel or ramdisk , the instance must be in a stopped state. To reset the sourceDestCheck , the instance can be either running or stopped.
The sourceDestCheck attribute controls whether source/destination checking is enabled. The default value is true , which means checking is enabled. This value must be false for a NAT instance to perform NAT. For more information, see NAT Instances in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.reset_instance_attribute(
Attribute='instanceType'|'kernel'|'ramdisk'|'userData'|'disableApiTermination'|'instanceInitiatedShutdownBehavior'|'rootDeviceName'|'blockDeviceMapping'|'productCodes'|'sourceDestCheck'|'groupSet'|'ebsOptimized'|'sriovNetSupport'|'enaSupport',
DryRun=True|False,
InstanceId='string'
)
[REQUIRED]
The attribute to reset.
Warning
You can only reset the following attributes: kernel | ramdisk | sourceDestCheck . To change an instance attribute, use ModifyInstanceAttribute .
[REQUIRED]
The ID of the instance.
None
Resets a network interface attribute. You can specify only one attribute at a time.
See also: AWS API Documentation
Request Syntax
response = client.reset_network_interface_attribute(
DryRun=True|False,
NetworkInterfaceId='string',
SourceDestCheck='string'
)
[REQUIRED]
The ID of the network interface.
None
Resets permission settings for the specified snapshot.
For more information about modifying snapshot permissions, see Sharing Snapshots in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.reset_snapshot_attribute(
Attribute='productCodes'|'createVolumePermission',
SnapshotId='string',
DryRun=True|False
)
[REQUIRED]
The attribute to reset. Currently, only the attribute for permission to create volumes can be reset.
[REQUIRED]
The ID of the snapshot.
None
Examples
This example resets the create volume permissions for snapshot snap-1234567890abcdef0. If the command succeeds, no output is returned.
response = client.reset_snapshot_attribute(
Attribute='createVolumePermission',
SnapshotId='snap-1234567890abcdef0',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Restores an Elastic IP address that was previously moved to the EC2-VPC platform back to the EC2-Classic platform. You cannot move an Elastic IP address that was originally allocated for use in EC2-VPC. The Elastic IP address must not be associated with an instance or network interface.
See also: AWS API Documentation
Request Syntax
response = client.restore_address_to_classic(
DryRun=True|False,
PublicIp='string'
)
[REQUIRED]
The Elastic IP address.
dict
Response Syntax
{
'PublicIp': 'string',
'Status': 'MoveInProgress'|'InVpc'|'InClassic'
}
Response Structure
(dict) --
PublicIp (string) --
The Elastic IP address.
Status (string) --
The move status for the IP address.
Examples
This example restores the specified Elastic IP address to the EC2-Classic platform.
response = client.restore_address_to_classic(
PublicIp='198.51.100.0',
)
print(response)
Expected Output:
{
'PublicIp': '198.51.100.0',
'Status': 'MoveInProgress',
'ResponseMetadata': {
'...': '...',
},
}
Removes an ingress authorization rule from a Client VPN endpoint.
See also: AWS API Documentation
Request Syntax
response = client.revoke_client_vpn_ingress(
ClientVpnEndpointId='string',
TargetNetworkCidr='string',
AccessGroupId='string',
RevokeAllGroups=True|False,
DryRun=True|False
)
[REQUIRED]
The ID of the Client VPN endpoint with which the authorization rule is associated.
[REQUIRED]
The IPv4 address range, in CIDR notation, of the network for which access is being removed.
dict
Response Syntax
{
'Status': {
'Code': 'authorizing'|'active'|'failed'|'revoking',
'Message': 'string'
}
}
Response Structure
(dict) --
Status (dict) --
The current state of the authorization rule.
Code (string) --
The state of the authorization rule.
Message (string) --
A message about the status of the authorization rule, if applicable.
[VPC only] Removes the specified egress rules from a security group for EC2-VPC. This action doesn't apply to security groups for use in EC2-Classic. To remove a rule, the values that you specify (for example, ports) must match the existing rule's values exactly.
Each rule consists of the protocol and the IPv4 or IPv6 CIDR range or source security group. For the TCP and UDP protocols, you must also specify the destination port or range of ports. For the ICMP protocol, you must also specify the ICMP type and code. If the security group rule has a description, you do not have to specify the description to revoke the rule.
Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay might occur.
See also: AWS API Documentation
Request Syntax
response = client.revoke_security_group_egress(
DryRun=True|False,
GroupId='string',
IpPermissions=[
{
'FromPort': 123,
'IpProtocol': 'string',
'IpRanges': [
{
'CidrIp': 'string',
'Description': 'string'
},
],
'Ipv6Ranges': [
{
'CidrIpv6': 'string',
'Description': 'string'
},
],
'PrefixListIds': [
{
'Description': 'string',
'PrefixListId': 'string'
},
],
'ToPort': 123,
'UserIdGroupPairs': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'PeeringStatus': 'string',
'UserId': 'string',
'VpcId': 'string',
'VpcPeeringConnectionId': 'string'
},
]
},
],
CidrIp='string',
FromPort=123,
IpProtocol='string',
ToPort=123,
SourceSecurityGroupName='string',
SourceSecurityGroupOwnerId='string'
)
[REQUIRED]
The ID of the security group.
The sets of IP permissions. You can't specify a destination security group and a CIDR IP address range in the same set of permissions.
Describes a set of permissions for a security group rule.
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The IP protocol name (tcp , udp , icmp , icmpv6 ) or number (see Protocol Numbers ).
[VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp , udp , icmp , or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp , udp , and icmp , you must specify a port range. For icmpv6 , the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
The IPv4 ranges.
Describes an IPv4 range.
The IPv4 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv4 address, use the /32 prefix length.
A description for the security group rule that references this IPv4 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The IPv6 ranges.
[EC2-VPC only] Describes an IPv6 range.
The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv6 address, use the /128 prefix length.
A description for the security group rule that references this IPv6 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The prefix list IDs for an AWS service. With outbound rules, this is the AWS service to access through a VPC endpoint from instances associated with the security group.
Describes a prefix list ID.
A description for the security group rule that references this prefix list ID.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the prefix.
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The security group and AWS account ID pairs.
Describes a security group and AWS account ID pair.
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the security group.
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
The status of a VPC peering connection, if applicable.
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
The ID of the VPC for the referenced security group, if applicable.
The ID of the VPC peering connection, if applicable.
None
Removes the specified ingress rules from a security group. To remove a rule, the values that you specify (for example, ports) must match the existing rule's values exactly.
Note
[EC2-Classic only] If the values you specify do not match the existing rule's values, no error is returned. Use DescribeSecurityGroups to verify that the rule has been removed.
Each rule consists of the protocol and the CIDR range or source security group. For the TCP and UDP protocols, you must also specify the destination port or range of ports. For the ICMP protocol, you must also specify the ICMP type and code. If the security group rule has a description, you do not have to specify the description to revoke the rule.
Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay might occur.
See also: AWS API Documentation
Request Syntax
response = client.revoke_security_group_ingress(
CidrIp='string',
FromPort=123,
GroupId='string',
GroupName='string',
IpPermissions=[
{
'FromPort': 123,
'IpProtocol': 'string',
'IpRanges': [
{
'CidrIp': 'string',
'Description': 'string'
},
],
'Ipv6Ranges': [
{
'CidrIpv6': 'string',
'Description': 'string'
},
],
'PrefixListIds': [
{
'Description': 'string',
'PrefixListId': 'string'
},
],
'ToPort': 123,
'UserIdGroupPairs': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'PeeringStatus': 'string',
'UserId': 'string',
'VpcId': 'string',
'VpcPeeringConnectionId': 'string'
},
]
},
],
IpProtocol='string',
SourceSecurityGroupName='string',
SourceSecurityGroupOwnerId='string',
ToPort=123,
DryRun=True|False
)
The sets of IP permissions. You can't specify a source security group and a CIDR IP address range in the same set of permissions.
Describes a set of permissions for a security group rule.
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The IP protocol name (tcp , udp , icmp , icmpv6 ) or number (see Protocol Numbers ).
[VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp , udp , icmp , or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp , udp , and icmp , you must specify a port range. For icmpv6 , the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
The IPv4 ranges.
Describes an IPv4 range.
The IPv4 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv4 address, use the /32 prefix length.
A description for the security group rule that references this IPv4 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The IPv6 ranges.
[EC2-VPC only] Describes an IPv6 range.
The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv6 address, use the /128 prefix length.
A description for the security group rule that references this IPv6 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The prefix list IDs for an AWS service. With outbound rules, this is the AWS service to access through a VPC endpoint from instances associated with the security group.
Describes a prefix list ID.
A description for the security group rule that references this prefix list ID.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the prefix.
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The security group and AWS account ID pairs.
Describes a security group and AWS account ID pair.
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the security group.
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
The status of a VPC peering connection, if applicable.
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
The ID of the VPC for the referenced security group, if applicable.
The ID of the VPC peering connection, if applicable.
None
Launches the specified number of instances using an AMI for which you have permissions.
You can specify a number of options, or leave the default options. The following rules apply:
You can create a launch template , which is a resource that contains the parameters to launch an instance. When you launch an instance using RunInstances , you can specify the launch template instead of specifying the launch parameters.
To ensure faster instance launches, break up large requests into smaller batches. For example, create five separate launch requests for 100 instances each instead of one launch request for 500 instances.
An instance is ready for you to use when it's in the running state. You can check the state of your instance using DescribeInstances . You can tag instances and EBS volumes during launch, after launch, or both. For more information, see CreateTags and Tagging Your Amazon EC2 Resources .
Linux instances have access to the public key of the key pair at boot. You can use this key to provide secure access to the instance. Amazon EC2 public images use this feature to provide secure access without passwords. For more information, see Key Pairs in the Amazon Elastic Compute Cloud User Guide .
For troubleshooting, see What To Do If An Instance Immediately Terminates , and Troubleshooting Connecting to Your Instance in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.run_instances(
BlockDeviceMappings=[
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'Iops': 123,
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Encrypted': True|False,
'KmsKeyId': 'string'
},
'NoDevice': 'string'
},
],
ImageId='string',
InstanceType='t1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
Ipv6AddressCount=123,
Ipv6Addresses=[
{
'Ipv6Address': 'string'
},
],
KernelId='string',
KeyName='string',
MaxCount=123,
MinCount=123,
Monitoring={
'Enabled': True|False
},
Placement={
'AvailabilityZone': 'string',
'Affinity': 'string',
'GroupName': 'string',
'PartitionNumber': 123,
'HostId': 'string',
'Tenancy': 'default'|'dedicated'|'host',
'SpreadDomain': 'string'
},
RamdiskId='string',
SecurityGroupIds=[
'string',
],
SecurityGroups=[
'string',
],
SubnetId='string',
UserData='string',
AdditionalInfo='string',
ClientToken='string',
DisableApiTermination=True|False,
DryRun=True|False,
EbsOptimized=True|False,
IamInstanceProfile={
'Arn': 'string',
'Name': 'string'
},
InstanceInitiatedShutdownBehavior='stop'|'terminate',
NetworkInterfaces=[
{
'AssociatePublicIpAddress': True|False,
'DeleteOnTermination': True|False,
'Description': 'string',
'DeviceIndex': 123,
'Groups': [
'string',
],
'Ipv6AddressCount': 123,
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'NetworkInterfaceId': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
'SecondaryPrivateIpAddressCount': 123,
'SubnetId': 'string',
'InterfaceType': 'string'
},
],
PrivateIpAddress='string',
ElasticGpuSpecification=[
{
'Type': 'string'
},
],
ElasticInferenceAccelerators=[
{
'Type': 'string'
},
],
TagSpecifications=[
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
LaunchTemplate={
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'Version': 'string'
},
InstanceMarketOptions={
'MarketType': 'spot',
'SpotOptions': {
'MaxPrice': 'string',
'SpotInstanceType': 'one-time'|'persistent',
'BlockDurationMinutes': 123,
'ValidUntil': datetime(2015, 1, 1),
'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate'
}
},
CreditSpecification={
'CpuCredits': 'string'
},
CpuOptions={
'CoreCount': 123,
'ThreadsPerCore': 123
},
CapacityReservationSpecification={
'CapacityReservationPreference': 'open'|'none',
'CapacityReservationTarget': {
'CapacityReservationId': 'string'
}
},
HibernationOptions={
'Configured': True|False
},
LicenseSpecifications=[
{
'LicenseConfigurationArn': 'string'
},
]
)
The block device mapping entries.
Describes a block device mapping.
The device name (for example, /dev/sdh or xvdh ).
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Parameters used to automatically set up EBS volumes when the instance is launched.
Indicates whether the EBS volume is deleted on instance termination.
The number of I/O operations per second (IOPS) that the volume supports. For io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
The ID of the snapshot.
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Constraints: 1-16384 for General Purpose SSD (gp2 ), 4-16384 for Provisioned IOPS SSD (io1 ), 500-16384 for Throughput Optimized HDD (st1 ), 500-16384 for Cold HDD (sc1 ), and 1-1024 for Magnetic (standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
The volume type. If you set the type to io1 , you must also set the Iops property.
Default: standard
Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
In no case can you remove encryption from an encrypted volume.
Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is encrypted.
This parameter is only supported on BlockDeviceMapping objects called by RunInstances , RequestSpotFleet , and RequestSpotInstances .
Suppresses the specified device included in the block device mapping of the AMI.
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide .
Default: m1.small
[EC2-VPC] The number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.
You cannot specify this option and the network interfaces option in the same request.
[EC2-VPC] The IPv6 addresses from the range of the subnet to associate with the primary network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.
You cannot specify this option and the network interfaces option in the same request.
Describes an IPv6 address.
The IPv6 address.
The ID of the kernel.
Warning
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB in the Amazon Elastic Compute Cloud User Guide .
The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair .
Warning
If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.
[REQUIRED]
The maximum number of instances to launch. If you specify more instances than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches the largest possible number of instances above MinCount .
Constraints: Between 1 and the maximum number you're allowed for the specified instance type. For more information about the default limits, and how to request an increase, see How many instances can I run in Amazon EC2 in the Amazon EC2 FAQ.
[REQUIRED]
The minimum number of instances to launch. If you specify a minimum that is more instances than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches no instances.
Constraints: Between 1 and the maximum number you're allowed for the specified instance type. For more information about the default limits, and how to request an increase, see How many instances can I run in Amazon EC2 in the Amazon EC2 General FAQ.
Specifies whether detailed monitoring is enabled for the instance.
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
The placement for the instance.
The Availability Zone of the instance.
If not specified, an Availability Zone will be automatically chosen for you based on the load balancing criteria for the Region.
The affinity setting for the instance on the Dedicated Host. This parameter is not supported for the ImportInstance command.
The name of the placement group the instance is in.
The number of the partition the instance is in. Valid only if the placement group strategy is set to partition .
The ID of the Dedicated Host on which the instance resides. This parameter is not supported for the ImportInstance command.
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for the ImportInstance command.
Reserved for future use.
The ID of the RAM disk to select. Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, go to the AWS Resource Center and search for the kernel ID.
Warning
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB in the Amazon Elastic Compute Cloud User Guide .
The IDs of the security groups. You can create a security group using CreateSecurityGroup .
If you specify a network interface, you must specify any security groups as part of the network interface.
[EC2-Classic, default VPC] The names of the security groups. For a nondefault VPC, you must use security group IDs instead.
If you specify a network interface, you must specify any security groups as part of the network interface.
Default: Amazon EC2 uses the default security group.
[EC2-VPC] The ID of the subnet to launch the instance into.
If you specify a network interface, you must specify any subnets as part of the network interface.
The user data to make available to the instance. For more information, see Running Commands on Your Linux Instance at Launch (Linux) and Adding User Data (Windows). If you are using a command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text. User data is limited to 16 KB.
This value will be base64 encoded automatically. Do not base64 encode this value prior to performing the operation.
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency .
Constraints: Maximum 64 ASCII characters
If you set this parameter to true , you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. To change this attribute after launch, use ModifyInstanceAttribute . Alternatively, if you set InstanceInitiatedShutdownBehavior to terminate , you can terminate the instance by running the shutdown command from the instance.
Default: false
Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.
Default: false
The IAM instance profile.
The Amazon Resource Name (ARN) of the instance profile.
The name of the instance profile.
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
Default: stop
The network interfaces to associate with the instance. If you specify a network interface, you must specify any security groups and subnets as part of the network interface.
Describes a network interface.
Indicates whether to assign a public IPv4 address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is true .
If set to true , the interface is deleted when the instance is terminated. You can specify true only if creating a new network interface when launching an instance.
The description of the network interface. Applies only if creating a network interface when launching an instance.
The position of the network interface in the attachment order. A primary network interface has a device index of 0.
If you specify a network interface when launching an instance, you must specify the device index.
The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.
A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.
One or more IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.
Describes an IPv6 address.
The IPv6 address.
The ID of the network interface.
The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance. You cannot specify this option if you're launching more than one instance in a RunInstances request.
One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you're launching more than one instance in a RunInstances request.
Describes a secondary private IPv4 address for a network interface.
Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.
The private IPv4 addresses.
The number of secondary private IPv4 addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you're launching more than one instance in a RunInstances request.
The ID of the subnet associated with the network string. Applies only if creating a network interface when launching an instance.
The type of network interface. To create an Elastic Fabric Adapter (EFA), specify efa . For more information, see Elastic Fabric Adapter in the Amazon Elastic Compute Cloud User Guide .
If you are not creating an EFA, specify interface or omit this parameter.
Valid values: interface | efa
[EC2-VPC] The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.
Only one private IP address can be designated as primary. You can't specify this option if you've specified the option to designate a private IP address as the primary IP address in a network interface specification. You cannot specify this option if you're launching more than one instance in the request.
You cannot specify this option and the network interfaces option in the same request.
An elastic GPU to associate with the instance. An Elastic GPU is a GPU resource that you can attach to your Windows instance to accelerate the graphics performance of your applications. For more information, see Amazon EC2 Elastic GPUs in the Amazon Elastic Compute Cloud User Guide .
A specification for an Elastic Graphics accelerator.
The type of Elastic Graphics accelerator.
An elastic inference accelerator to associate with the instance. Elastic inference accelerators are a resource you can attach to your Amazon EC2 instances to accelerate your Deep Learning (DL) inference workloads.
Describes an elastic inference accelerator.
The type of elastic inference accelerator. The possible values are eia1.small , eia1.medium , and eia1.large .
The tags to apply to the resources during launch. You can only tag instances and volumes on launch. The specified tags are applied to all instances or volumes that are created during launch. To tag a resource after it has been created, see CreateTags .
The tags to apply to a resource when the resource is being created.
The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
The launch template to use to launch the instances. Any parameters that you specify in RunInstances override the same parameters in the launch template. You can specify either the name or ID of a launch template, but not both.
The ID of the launch template.
The name of the launch template.
The version number of the launch template.
Default: The default version for the launch template.
The market (purchasing) option for the instances.
For RunInstances , persistent Spot Instance requests are only supported when InstanceInterruptionBehavior is set to either hibernate or stop .
The market type.
The options for Spot Instances.
The maximum hourly price you're willing to pay for the Spot Instances. The default is the On-Demand price.
The Spot Instance request type. For RunInstances , persistent Spot Instance requests are only supported when InstanceInterruptionBehavior is set to either hibernate or stop .
The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).
The end date of the request. For a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached. The default end date is 7 days from the current date.
The behavior when a Spot Instance is interrupted. The default is terminate .
The credit option for CPU usage of the T2 or T3 instance. Valid values are standard and unlimited . To change this attribute after launch, use ModifyInstanceCreditSpecification . For more information, see Burstable Performance Instances in the Amazon Elastic Compute Cloud User Guide .
Default: standard (T2 instances) or unlimited (T3 instances)
The credit option for CPU usage of a T2 or T3 instance. Valid values are standard and unlimited .
The CPU options for the instance. For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide .
The number of CPU cores for the instance.
The number of threads per CPU core. To disable Intel Hyper-Threading Technology for the instance, specify a value of 1 . Otherwise, specify the default value of 2 .
Information about the Capacity Reservation targeting option. If you do not specify this parameter, the instance's Capacity Reservation preference defaults to open , which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
Information about the target Capacity Reservation.
The ID of the Capacity Reservation.
Indicates whether an instance is enabled for hibernation. For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
If you set this parameter to true , your instance is enabled for hibernation.
Default: false
The license configurations.
Describes a license configuration.
The Amazon Resource Name (ARN) of the license configuration.
dict
Response Syntax
{
'Groups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'Instances': [
{
'AmiLaunchIndex': 123,
'ImageId': 'string',
'InstanceId': 'string',
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'KernelId': 'string',
'KeyName': 'string',
'LaunchTime': datetime(2015, 1, 1),
'Monitoring': {
'State': 'disabled'|'disabling'|'enabled'|'pending'
},
'Placement': {
'AvailabilityZone': 'string',
'Affinity': 'string',
'GroupName': 'string',
'PartitionNumber': 123,
'HostId': 'string',
'Tenancy': 'default'|'dedicated'|'host',
'SpreadDomain': 'string'
},
'Platform': 'Windows',
'PrivateDnsName': 'string',
'PrivateIpAddress': 'string',
'ProductCodes': [
{
'ProductCodeId': 'string',
'ProductCodeType': 'devpay'|'marketplace'
},
],
'PublicDnsName': 'string',
'PublicIpAddress': 'string',
'RamdiskId': 'string',
'State': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'StateTransitionReason': 'string',
'SubnetId': 'string',
'VpcId': 'string',
'Architecture': 'i386'|'x86_64'|'arm64',
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'Ebs': {
'AttachTime': datetime(2015, 1, 1),
'DeleteOnTermination': True|False,
'Status': 'attaching'|'attached'|'detaching'|'detached',
'VolumeId': 'string'
}
},
],
'ClientToken': 'string',
'EbsOptimized': True|False,
'EnaSupport': True|False,
'Hypervisor': 'ovm'|'xen',
'IamInstanceProfile': {
'Arn': 'string',
'Id': 'string'
},
'InstanceLifecycle': 'spot'|'scheduled',
'ElasticGpuAssociations': [
{
'ElasticGpuId': 'string',
'ElasticGpuAssociationId': 'string',
'ElasticGpuAssociationState': 'string',
'ElasticGpuAssociationTime': 'string'
},
],
'ElasticInferenceAcceleratorAssociations': [
{
'ElasticInferenceAcceleratorArn': 'string',
'ElasticInferenceAcceleratorAssociationId': 'string',
'ElasticInferenceAcceleratorAssociationState': 'string',
'ElasticInferenceAcceleratorAssociationTime': datetime(2015, 1, 1)
},
],
'NetworkInterfaces': [
{
'Association': {
'IpOwnerId': 'string',
'PublicDnsName': 'string',
'PublicIp': 'string'
},
'Attachment': {
'AttachTime': datetime(2015, 1, 1),
'AttachmentId': 'string',
'DeleteOnTermination': True|False,
'DeviceIndex': 123,
'Status': 'attaching'|'attached'|'detaching'|'detached'
},
'Description': 'string',
'Groups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'MacAddress': 'string',
'NetworkInterfaceId': 'string',
'OwnerId': 'string',
'PrivateDnsName': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Association': {
'IpOwnerId': 'string',
'PublicDnsName': 'string',
'PublicIp': 'string'
},
'Primary': True|False,
'PrivateDnsName': 'string',
'PrivateIpAddress': 'string'
},
],
'SourceDestCheck': True|False,
'Status': 'available'|'associated'|'attaching'|'in-use'|'detaching',
'SubnetId': 'string',
'VpcId': 'string',
'InterfaceType': 'string'
},
],
'RootDeviceName': 'string',
'RootDeviceType': 'ebs'|'instance-store',
'SecurityGroups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'SourceDestCheck': True|False,
'SpotInstanceRequestId': 'string',
'SriovNetSupport': 'string',
'StateReason': {
'Code': 'string',
'Message': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VirtualizationType': 'hvm'|'paravirtual',
'CpuOptions': {
'CoreCount': 123,
'ThreadsPerCore': 123
},
'CapacityReservationId': 'string',
'CapacityReservationSpecification': {
'CapacityReservationPreference': 'open'|'none',
'CapacityReservationTarget': {
'CapacityReservationId': 'string'
}
},
'HibernationOptions': {
'Configured': True|False
},
'Licenses': [
{
'LicenseConfigurationArn': 'string'
},
]
},
],
'OwnerId': 'string',
'RequesterId': 'string',
'ReservationId': 'string'
}
Response Structure
(dict) --
Describes a reservation.
Groups (list) --
[EC2-Classic only] The security groups.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
Instances (list) --
The instances.
(dict) --
Describes an instance.
AmiLaunchIndex (integer) --
The AMI launch index, which can be used to find this instance in the launch group.
ImageId (string) --
The ID of the AMI used to launch the instance.
InstanceId (string) --
The ID of the instance.
InstanceType (string) --
The instance type.
KernelId (string) --
The kernel associated with this instance, if applicable.
KeyName (string) --
The name of the key pair, if this instance was launched with an associated key pair.
LaunchTime (datetime) --
The time the instance was launched.
Monitoring (dict) --
The monitoring for the instance.
State (string) --
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
Placement (dict) --
The location where the instance launched, if applicable.
AvailabilityZone (string) --
The Availability Zone of the instance.
If not specified, an Availability Zone will be automatically chosen for you based on the load balancing criteria for the Region.
Affinity (string) --
The affinity setting for the instance on the Dedicated Host. This parameter is not supported for the ImportInstance command.
GroupName (string) --
The name of the placement group the instance is in.
PartitionNumber (integer) --
The number of the partition the instance is in. Valid only if the placement group strategy is set to partition .
HostId (string) --
The ID of the Dedicated Host on which the instance resides. This parameter is not supported for the ImportInstance command.
Tenancy (string) --
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for the ImportInstance command.
SpreadDomain (string) --
Reserved for future use.
Platform (string) --
The value is Windows for Windows instances; otherwise blank.
PrivateDnsName (string) --
(IPv4 only) The private DNS hostname name assigned to the instance. This DNS hostname can only be used inside the Amazon EC2 network. This name is not available until the instance enters the running state.
[EC2-VPC] The Amazon-provided DNS server resolves Amazon-provided private DNS hostnames if you've enabled DNS resolution and DNS hostnames in your VPC. If you are not using the Amazon-provided DNS server in your VPC, your custom domain name servers must resolve the hostname as appropriate.
PrivateIpAddress (string) --
The private IPv4 address assigned to the instance.
ProductCodes (list) --
The product codes attached to this instance, if applicable.
(dict) --
Describes a product code.
ProductCodeId (string) --
The product code.
ProductCodeType (string) --
The type of product code.
PublicDnsName (string) --
(IPv4 only) The public DNS name assigned to the instance. This name is not available until the instance enters the running state. For EC2-VPC, this name is only available if you've enabled DNS hostnames for your VPC.
PublicIpAddress (string) --
The public IPv4 address assigned to the instance, if applicable.
RamdiskId (string) --
The RAM disk associated with this instance, if applicable.
State (dict) --
The current state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
StateTransitionReason (string) --
The reason for the most recent state transition. This might be an empty string.
SubnetId (string) --
[EC2-VPC] The ID of the subnet in which the instance is running.
VpcId (string) --
[EC2-VPC] The ID of the VPC in which the instance is running.
Architecture (string) --
The architecture of the image.
BlockDeviceMappings (list) --
Any block device mapping entries for the instance.
(dict) --
Describes a block device mapping.
DeviceName (string) --
The device name (for example, /dev/sdh or xvdh ).
Ebs (dict) --
Parameters used to automatically set up EBS volumes when the instance is launched.
AttachTime (datetime) --
The time stamp when the attachment initiated.
DeleteOnTermination (boolean) --
Indicates whether the volume is deleted on instance termination.
Status (string) --
The attachment state.
VolumeId (string) --
The ID of the EBS volume.
ClientToken (string) --
The idempotency token you provided when you launched the instance, if applicable.
EbsOptimized (boolean) --
Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.
EnaSupport (boolean) --
Specifies whether enhanced networking with ENA is enabled.
Hypervisor (string) --
The hypervisor type of the instance.
IamInstanceProfile (dict) --
The IAM instance profile associated with the instance, if applicable.
Arn (string) --
The Amazon Resource Name (ARN) of the instance profile.
Id (string) --
The ID of the instance profile.
InstanceLifecycle (string) --
Indicates whether this is a Spot Instance or a Scheduled Instance.
ElasticGpuAssociations (list) --
The Elastic GPU associated with the instance.
(dict) --
Describes the association between an instance and an Elastic Graphics accelerator.
ElasticGpuId (string) --
The ID of the Elastic Graphics accelerator.
ElasticGpuAssociationId (string) --
The ID of the association.
ElasticGpuAssociationState (string) --
The state of the association between the instance and the Elastic Graphics accelerator.
ElasticGpuAssociationTime (string) --
The time the Elastic Graphics accelerator was associated with the instance.
ElasticInferenceAcceleratorAssociations (list) --
The elastic inference accelerator associated with the instance.
(dict) --
Describes the association between an instance and an elastic inference accelerator.
ElasticInferenceAcceleratorArn (string) --
The Amazon Resource Name (ARN) of the elastic inference accelerator.
ElasticInferenceAcceleratorAssociationId (string) --
The ID of the association.
ElasticInferenceAcceleratorAssociationState (string) --
The state of the elastic inference accelerator.
ElasticInferenceAcceleratorAssociationTime (datetime) --
The time at which the elastic inference accelerator is associated with an instance.
NetworkInterfaces (list) --
[EC2-VPC] The network interfaces for the instance.
(dict) --
Describes a network interface.
Association (dict) --
The association information for an Elastic IPv4 associated with the network interface.
IpOwnerId (string) --
The ID of the owner of the Elastic IP address.
PublicDnsName (string) --
The public DNS name.
PublicIp (string) --
The public IP address or Elastic IP address bound to the network interface.
Attachment (dict) --
The network interface attachment.
AttachTime (datetime) --
The time stamp when the attachment initiated.
AttachmentId (string) --
The ID of the network interface attachment.
DeleteOnTermination (boolean) --
Indicates whether the network interface is deleted when the instance is terminated.
DeviceIndex (integer) --
The index of the device on the instance for the network interface attachment.
Status (string) --
The attachment state.
Description (string) --
The description.
Groups (list) --
One or more security groups.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
Ipv6Addresses (list) --
One or more IPv6 addresses associated with the network interface.
(dict) --
Describes an IPv6 address.
Ipv6Address (string) --
The IPv6 address.
MacAddress (string) --
The MAC address.
NetworkInterfaceId (string) --
The ID of the network interface.
OwnerId (string) --
The ID of the AWS account that created the network interface.
PrivateDnsName (string) --
The private DNS name.
PrivateIpAddress (string) --
The IPv4 address of the network interface within the subnet.
PrivateIpAddresses (list) --
One or more private IPv4 addresses associated with the network interface.
(dict) --
Describes a private IPv4 address.
Association (dict) --
The association information for an Elastic IP address for the network interface.
IpOwnerId (string) --
The ID of the owner of the Elastic IP address.
PublicDnsName (string) --
The public DNS name.
PublicIp (string) --
The public IP address or Elastic IP address bound to the network interface.
Primary (boolean) --
Indicates whether this IPv4 address is the primary private IP address of the network interface.
PrivateDnsName (string) --
The private IPv4 DNS name.
PrivateIpAddress (string) --
The private IPv4 address of the network interface.
SourceDestCheck (boolean) --
Indicates whether to validate network traffic to or from this network interface.
Status (string) --
The status of the network interface.
SubnetId (string) --
The ID of the subnet.
VpcId (string) --
The ID of the VPC.
InterfaceType (string) --
Describes the type of network interface.
Valid values: interface | efa
RootDeviceName (string) --
The device name of the root device volume (for example, /dev/sda1 ).
RootDeviceType (string) --
The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
SecurityGroups (list) --
The security groups for the instance.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
SourceDestCheck (boolean) --
Specifies whether to enable an instance launched in a VPC to perform NAT. This controls whether source/destination checking is enabled on the instance. A value of true means that checking is enabled, and false means that checking is disabled. The value must be false for the instance to perform NAT. For more information, see NAT Instances in the Amazon Virtual Private Cloud User Guide .
SpotInstanceRequestId (string) --
If the request is a Spot Instance request, the ID of the request.
SriovNetSupport (string) --
Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
StateReason (dict) --
The reason for the most recent state transition.
Code (string) --
The reason code for the state change.
Message (string) --
The message for the state change.
Tags (list) --
Any tags assigned to the instance.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VirtualizationType (string) --
The virtualization type of the instance.
CpuOptions (dict) --
The CPU options for the instance.
CoreCount (integer) --
The number of CPU cores for the instance.
ThreadsPerCore (integer) --
The number of threads per CPU core.
CapacityReservationId (string) --
The ID of the Capacity Reservation.
CapacityReservationSpecification (dict) --
Information about the Capacity Reservation targeting option.
CapacityReservationPreference (string) --
Describes the instance's Capacity Reservation preferences. Possible preferences include:
CapacityReservationTarget (dict) --
Information about the targeted Capacity Reservation.
CapacityReservationId (string) --
The ID of the Capacity Reservation.
HibernationOptions (dict) --
Indicates whether the instance is enabled for hibernation.
Configured (boolean) --
If this parameter is set to true , your instance is enabled for hibernation; otherwise, it is not enabled for hibernation.
Licenses (list) --
The license configurations.
(dict) --
Describes a license configuration.
LicenseConfigurationArn (string) --
The Amazon Resource Name (ARN) of the license configuration.
OwnerId (string) --
The ID of the AWS account that owns the reservation.
RequesterId (string) --
The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling).
ReservationId (string) --
The ID of the reservation.
Launches the specified Scheduled Instances.
Before you can launch a Scheduled Instance, you must purchase it and obtain an identifier using PurchaseScheduledInstances .
You must launch a Scheduled Instance during its scheduled time period. You can't stop or reboot a Scheduled Instance, but you can terminate it as needed. If you terminate a Scheduled Instance before the current scheduled time period ends, you can launch it again after a few minutes. For more information, see Scheduled Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.run_scheduled_instances(
ClientToken='string',
DryRun=True|False,
InstanceCount=123,
LaunchSpecification={
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'Encrypted': True|False,
'Iops': 123,
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'string'
},
'NoDevice': 'string',
'VirtualName': 'string'
},
],
'EbsOptimized': True|False,
'IamInstanceProfile': {
'Arn': 'string',
'Name': 'string'
},
'ImageId': 'string',
'InstanceType': 'string',
'KernelId': 'string',
'KeyName': 'string',
'Monitoring': {
'Enabled': True|False
},
'NetworkInterfaces': [
{
'AssociatePublicIpAddress': True|False,
'DeleteOnTermination': True|False,
'Description': 'string',
'DeviceIndex': 123,
'Groups': [
'string',
],
'Ipv6AddressCount': 123,
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'NetworkInterfaceId': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddressConfigs': [
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
'SecondaryPrivateIpAddressCount': 123,
'SubnetId': 'string'
},
],
'Placement': {
'AvailabilityZone': 'string',
'GroupName': 'string'
},
'RamdiskId': 'string',
'SecurityGroupIds': [
'string',
],
'SubnetId': 'string',
'UserData': 'string'
},
ScheduledInstanceId='string'
)
Unique, case-sensitive identifier that ensures the idempotency of the request. For more information, see Ensuring Idempotency .
This field is autopopulated if not provided.
The number of instances.
Default: 1
[REQUIRED]
The launch specification. You must match the instance type, Availability Zone, network, and platform of the schedule that you purchased.
The block device mapping entries.
Describes a block device mapping for a Scheduled Instance.
The device name (for example, /dev/sdh or xvdh ).
Parameters used to set up EBS volumes automatically when the instance is launched.
Indicates whether the volume is deleted on instance termination.
Indicates whether the volume is encrypted. You can attached encrypted volumes only to instances that support them.
The number of I/O operations per second (IOPS) that the volume supports. For io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information about gp2 baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraint: Range is 100-20000 IOPS for io1 volumes and 100-10000 IOPS for gp2 volumes.
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
The ID of the snapshot.
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
The volume type. gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, Throughput Optimized HDD for st1 , Cold HDD for sc1 , or standard for Magnetic.
Default: standard
Suppresses the specified device included in the block device mapping of the AMI.
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with two available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Indicates whether the instances are optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.
Default: false
The IAM instance profile.
The Amazon Resource Name (ARN).
The name.
The ID of the Amazon Machine Image (AMI).
The instance type.
The ID of the kernel.
The name of the key pair.
Enable or disable monitoring for the instances.
Indicates whether monitoring is enabled.
The network interfaces.
Describes a network interface for a Scheduled Instance.
Indicates whether to assign a public IPv4 address to instances launched in a VPC. The public IPv4 address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is true .
Indicates whether to delete the interface when the instance is terminated.
The description.
The index of the device for the network interface attachment.
The IDs of the security groups.
The number of IPv6 addresses to assign to the network interface. The IPv6 addresses are automatically selected from the subnet range.
The specific IPv6 addresses from the subnet range.
Describes an IPv6 address.
The IPv6 address.
The ID of the network interface.
The IPv4 address of the network interface within the subnet.
The private IPv4 addresses.
Describes a private IPv4 address for a Scheduled Instance.
Indicates whether this is a primary IPv4 address. Otherwise, this is a secondary IPv4 address.
The IPv4 address.
The number of secondary private IPv4 addresses.
The ID of the subnet.
The placement information.
The Availability Zone.
The name of the placement group.
The ID of the RAM disk.
The IDs of the security groups.
The ID of the subnet in which to launch the instances.
The base64-encoded MIME user data.
[REQUIRED]
The Scheduled Instance ID.
dict
Response Syntax
{
'InstanceIdSet': [
'string',
]
}
Response Structure
(dict) --
Contains the output of RunScheduledInstances.
InstanceIdSet (list) --
The IDs of the newly launched instances.
Examples
This example launches the specified Scheduled Instance in a VPC.
response = client.run_scheduled_instances(
InstanceCount=1,
LaunchSpecification={
'IamInstanceProfile': {
'Name': 'my-iam-role',
},
'ImageId': 'ami-12345678',
'InstanceType': 'c4.large',
'KeyName': 'my-key-pair',
'NetworkInterfaces': [
{
'AssociatePublicIpAddress': True,
'DeviceIndex': 0,
'Groups': [
'sg-12345678',
],
'SubnetId': 'subnet-12345678',
},
],
},
ScheduledInstanceId='sci-1234-1234-1234-1234-123456789012',
)
print(response)
Expected Output:
{
'InstanceIdSet': [
'i-1234567890abcdef0',
],
'ResponseMetadata': {
'...': '...',
},
}
This example launches the specified Scheduled Instance in EC2-Classic.
response = client.run_scheduled_instances(
InstanceCount=1,
LaunchSpecification={
'IamInstanceProfile': {
'Name': 'my-iam-role',
},
'ImageId': 'ami-12345678',
'InstanceType': 'c4.large',
'KeyName': 'my-key-pair',
'Placement': {
'AvailabilityZone': 'us-west-2b',
},
'SecurityGroupIds': [
'sg-12345678',
],
},
ScheduledInstanceId='sci-1234-1234-1234-1234-123456789012',
)
print(response)
Expected Output:
{
'InstanceIdSet': [
'i-1234567890abcdef0',
],
'ResponseMetadata': {
'...': '...',
},
}
Searches for routes in the specified transit gateway route table.
See also: AWS API Documentation
Request Syntax
response = client.search_transit_gateway_routes(
TransitGatewayRouteTableId='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
DryRun=True|False
)
[REQUIRED]
The ID of the transit gateway route table.
[REQUIRED]
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'Routes': [
{
'DestinationCidrBlock': 'string',
'TransitGatewayAttachments': [
{
'ResourceId': 'string',
'TransitGatewayAttachmentId': 'string',
'ResourceType': 'vpc'|'vpn'|'direct-connect-gateway'
},
],
'Type': 'static'|'propagated',
'State': 'pending'|'active'|'blackhole'|'deleting'|'deleted'
},
],
'AdditionalRoutesAvailable': True|False
}
Response Structure
(dict) --
Routes (list) --
Information about the routes.
(dict) --
Describes a route for a transit gateway route table.
DestinationCidrBlock (string) --
The CIDR block used for destination matches.
TransitGatewayAttachments (list) --
The attachments.
(dict) --
Describes a route attachment.
ResourceId (string) --
The ID of the resource.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
ResourceType (string) --
The resource type.
Type (string) --
The route type.
State (string) --
The state of the route.
AdditionalRoutesAvailable (boolean) --
Indicates whether there are additional routes available.
Starts an Amazon EBS-backed instance that you've previously stopped.
Instances that use Amazon EBS volumes as their root devices can be quickly stopped and started. When an instance is stopped, the compute resources are released and you are not billed for instance usage. However, your root partition Amazon EBS volume remains and continues to persist your data, and you are charged for Amazon EBS volume usage. You can restart your instance at any time. Every time you start your Windows instance, Amazon EC2 charges you for a full instance hour. If you stop and restart your Windows instance, a new instance hour begins and Amazon EC2 charges you for another full instance hour even if you are still within the same 60-minute period when it was stopped. Every time you start your Linux instance, Amazon EC2 charges a one-minute minimum for instance usage, and thereafter charges per second for instance usage.
Before stopping an instance, make sure it is in a state from which it can be restarted. Stopping an instance does not preserve data stored in RAM.
Performing this operation on an instance that uses an instance store as its root device returns an error.
For more information, see Stopping Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.start_instances(
InstanceIds=[
'string',
],
AdditionalInfo='string',
DryRun=True|False
)
[REQUIRED]
The IDs of the instances.
dict
Response Syntax
{
'StartingInstances': [
{
'CurrentState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceId': 'string',
'PreviousState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
}
},
]
}
Response Structure
(dict) --
StartingInstances (list) --
Information about the started instances.
(dict) --
Describes an instance state change.
CurrentState (dict) --
The current state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
InstanceId (string) --
The ID of the instance.
PreviousState (dict) --
The previous state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
Stops an Amazon EBS-backed instance.
You can use the Stop action to hibernate an instance if the instance is enabled for hibernation and it meets the hibernation prerequisites . For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
We don't charge usage for a stopped instance, or data transfer fees; however, your root partition Amazon EBS volume remains and continues to persist your data, and you are charged for Amazon EBS volume usage. Every time you start your Windows instance, Amazon EC2 charges you for a full instance hour. If you stop and restart your Windows instance, a new instance hour begins and Amazon EC2 charges you for another full instance hour even if you are still within the same 60-minute period when it was stopped. Every time you start your Linux instance, Amazon EC2 charges a one-minute minimum for instance usage, and thereafter charges per second for instance usage.
You can't start, stop, or hibernate Spot Instances, and you can't stop or hibernate instance store-backed instances. For information about using hibernation for Spot Instances, see Hibernating Interrupted Spot Instances in the Amazon Elastic Compute Cloud User Guide .
When you stop or hibernate an instance, we shut it down. You can restart your instance at any time. Before stopping or hibernating an instance, make sure it is in a state from which it can be restarted. Stopping an instance does not preserve data stored in RAM, but hibernating an instance does preserve data stored in RAM. If an instance cannot hibernate successfully, a normal shutdown occurs.
Stopping and hibernating an instance is different to rebooting or terminating it. For example, when you stop or hibernate an instance, the root device and any other devices attached to the instance persist. When you terminate an instance, the root device and any other devices attached during the instance launch are automatically deleted. For more information about the differences between rebooting, stopping, hibernating, and terminating instances, see Instance Lifecycle in the Amazon Elastic Compute Cloud User Guide .
When you stop an instance, we attempt to shut it down forcibly after a short while. If your instance appears stuck in the stopping state after a period of time, there may be an issue with the underlying host computer. For more information, see Troubleshooting Stopping Your Instance in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.stop_instances(
InstanceIds=[
'string',
],
Hibernate=True|False,
DryRun=True|False,
Force=True|False
)
[REQUIRED]
The IDs of the instances.
Hibernates the instance if the instance was enabled for hibernation at launch. If the instance cannot hibernate successfully, a normal shutdown occurs. For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
Default: false
Forces the instances to stop. The instances do not have an opportunity to flush file system caches or file system metadata. If you use this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances.
Default: false
dict
Response Syntax
{
'StoppingInstances': [
{
'CurrentState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceId': 'string',
'PreviousState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
}
},
]
}
Response Structure
(dict) --
StoppingInstances (list) --
Information about the stopped instances.
(dict) --
Describes an instance state change.
CurrentState (dict) --
The current state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
InstanceId (string) --
The ID of the instance.
PreviousState (dict) --
The previous state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
Terminates active Client VPN endpoint connections. This action can be used to terminate a specific client connection, or up to five connections established by a specific user.
See also: AWS API Documentation
Request Syntax
response = client.terminate_client_vpn_connections(
ClientVpnEndpointId='string',
ConnectionId='string',
Username='string',
DryRun=True|False
)
[REQUIRED]
The ID of the Client VPN endpoint to which the client is connected.
dict
Response Syntax
{
'ClientVpnEndpointId': 'string',
'Username': 'string',
'ConnectionStatuses': [
{
'ConnectionId': 'string',
'PreviousStatus': {
'Code': 'active'|'failed-to-terminate'|'terminating'|'terminated',
'Message': 'string'
},
'CurrentStatus': {
'Code': 'active'|'failed-to-terminate'|'terminating'|'terminated',
'Message': 'string'
}
},
]
}
Response Structure
(dict) --
ClientVpnEndpointId (string) --
The ID of the Client VPN endpoint.
Username (string) --
The user who established the terminated client connections.
ConnectionStatuses (list) --
The current state of the client connections.
(dict) --
Information about a terminated Client VPN endpoint client connection.
ConnectionId (string) --
The ID of the client connection.
PreviousStatus (dict) --
The state of the client connection.
Code (string) --
The state of the client connection.
Message (string) --
A message about the status of the client connection, if applicable.
CurrentStatus (dict) --
A message about the status of the client connection, if applicable.
Code (string) --
The state of the client connection.
Message (string) --
A message about the status of the client connection, if applicable.
Shuts down the specified instances. This operation is idempotent; if you terminate an instance more than once, each call succeeds.
If you specify multiple instances and the request fails (for example, because of a single incorrect instance ID), none of the instances are terminated.
Terminated instances remain visible after termination (for approximately one hour).
By default, Amazon EC2 deletes all EBS volumes that were attached when the instance launched. Volumes attached after instance launch continue running.
You can stop, start, and terminate EBS-backed instances. You can only terminate instance store-backed instances. What happens to an instance differs if you stop it or terminate it. For example, when you stop an instance, the root device and any other devices attached to the instance persist. When you terminate an instance, any attached EBS volumes with the DeleteOnTermination block device mapping parameter set to true are automatically deleted. For more information about the differences between stopping and terminating instances, see Instance Lifecycle in the Amazon Elastic Compute Cloud User Guide .
For more information about troubleshooting, see Troubleshooting Terminating Your Instance in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.terminate_instances(
InstanceIds=[
'string',
],
DryRun=True|False
)
[REQUIRED]
The IDs of the instances.
Constraints: Up to 1000 instance IDs. We recommend breaking up this request into smaller batches.
dict
Response Syntax
{
'TerminatingInstances': [
{
'CurrentState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceId': 'string',
'PreviousState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
}
},
]
}
Response Structure
(dict) --
TerminatingInstances (list) --
Information about the terminated instances.
(dict) --
Describes an instance state change.
CurrentState (dict) --
The current state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
InstanceId (string) --
The ID of the instance.
PreviousState (dict) --
The previous state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
Unassigns one or more IPv6 addresses from a network interface.
See also: AWS API Documentation
Request Syntax
response = client.unassign_ipv6_addresses(
Ipv6Addresses=[
'string',
],
NetworkInterfaceId='string'
)
[REQUIRED]
The IPv6 addresses to unassign from the network interface.
[REQUIRED]
The ID of the network interface.
dict
Response Syntax
{
'NetworkInterfaceId': 'string',
'UnassignedIpv6Addresses': [
'string',
]
}
Response Structure
(dict) --
NetworkInterfaceId (string) --
The ID of the network interface.
UnassignedIpv6Addresses (list) --
The IPv6 addresses that have been unassigned from the network interface.
Unassigns one or more secondary private IP addresses from a network interface.
See also: AWS API Documentation
Request Syntax
response = client.unassign_private_ip_addresses(
NetworkInterfaceId='string',
PrivateIpAddresses=[
'string',
]
)
[REQUIRED]
The ID of the network interface.
[REQUIRED]
The secondary private IP addresses to unassign from the network interface. You can specify this option multiple times to unassign more than one IP address.
None
Examples
This example unassigns the specified private IP address from the specified network interface.
response = client.unassign_private_ip_addresses(
NetworkInterfaceId='eni-e5aa89a3',
PrivateIpAddresses=[
'10.0.0.82',
],
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Disables detailed monitoring for a running instance. For more information, see Monitoring Your Instances and Volumes in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.unmonitor_instances(
InstanceIds=[
'string',
],
DryRun=True|False
)
[REQUIRED]
The IDs of the instances.
dict
Response Syntax
{
'InstanceMonitorings': [
{
'InstanceId': 'string',
'Monitoring': {
'State': 'disabled'|'disabling'|'enabled'|'pending'
}
},
]
}
Response Structure
(dict) --
InstanceMonitorings (list) --
The monitoring information.
(dict) --
Describes the monitoring of an instance.
InstanceId (string) --
The ID of the instance.
Monitoring (dict) --
The monitoring for the instance.
State (string) --
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
[VPC only] Updates the description of an egress (outbound) security group rule. You can replace an existing description, or add a description to a rule that did not have one previously.
You specify the description as part of the IP permissions structure. You can remove a description for a security group rule by omitting the description parameter in the request.
See also: AWS API Documentation
Request Syntax
response = client.update_security_group_rule_descriptions_egress(
DryRun=True|False,
GroupId='string',
GroupName='string',
IpPermissions=[
{
'FromPort': 123,
'IpProtocol': 'string',
'IpRanges': [
{
'CidrIp': 'string',
'Description': 'string'
},
],
'Ipv6Ranges': [
{
'CidrIpv6': 'string',
'Description': 'string'
},
],
'PrefixListIds': [
{
'Description': 'string',
'PrefixListId': 'string'
},
],
'ToPort': 123,
'UserIdGroupPairs': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'PeeringStatus': 'string',
'UserId': 'string',
'VpcId': 'string',
'VpcPeeringConnectionId': 'string'
},
]
},
]
)
[REQUIRED]
The IP permissions for the security group rule.
Describes a set of permissions for a security group rule.
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The IP protocol name (tcp , udp , icmp , icmpv6 ) or number (see Protocol Numbers ).
[VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp , udp , icmp , or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp , udp , and icmp , you must specify a port range. For icmpv6 , the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
The IPv4 ranges.
Describes an IPv4 range.
The IPv4 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv4 address, use the /32 prefix length.
A description for the security group rule that references this IPv4 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The IPv6 ranges.
[EC2-VPC only] Describes an IPv6 range.
The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv6 address, use the /128 prefix length.
A description for the security group rule that references this IPv6 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The prefix list IDs for an AWS service. With outbound rules, this is the AWS service to access through a VPC endpoint from instances associated with the security group.
Describes a prefix list ID.
A description for the security group rule that references this prefix list ID.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the prefix.
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The security group and AWS account ID pairs.
Describes a security group and AWS account ID pair.
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the security group.
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
The status of a VPC peering connection, if applicable.
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
The ID of the VPC for the referenced security group, if applicable.
The ID of the VPC peering connection, if applicable.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true if the request succeeds; otherwise, returns an error.
Updates the description of an ingress (inbound) security group rule. You can replace an existing description, or add a description to a rule that did not have one previously.
You specify the description as part of the IP permissions structure. You can remove a description for a security group rule by omitting the description parameter in the request.
See also: AWS API Documentation
Request Syntax
response = client.update_security_group_rule_descriptions_ingress(
DryRun=True|False,
GroupId='string',
GroupName='string',
IpPermissions=[
{
'FromPort': 123,
'IpProtocol': 'string',
'IpRanges': [
{
'CidrIp': 'string',
'Description': 'string'
},
],
'Ipv6Ranges': [
{
'CidrIpv6': 'string',
'Description': 'string'
},
],
'PrefixListIds': [
{
'Description': 'string',
'PrefixListId': 'string'
},
],
'ToPort': 123,
'UserIdGroupPairs': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'PeeringStatus': 'string',
'UserId': 'string',
'VpcId': 'string',
'VpcPeeringConnectionId': 'string'
},
]
},
]
)
[REQUIRED]
The IP permissions for the security group rule.
Describes a set of permissions for a security group rule.
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The IP protocol name (tcp , udp , icmp , icmpv6 ) or number (see Protocol Numbers ).
[VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp , udp , icmp , or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp , udp , and icmp , you must specify a port range. For icmpv6 , the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
The IPv4 ranges.
Describes an IPv4 range.
The IPv4 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv4 address, use the /32 prefix length.
A description for the security group rule that references this IPv4 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The IPv6 ranges.
[EC2-VPC only] Describes an IPv6 range.
The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv6 address, use the /128 prefix length.
A description for the security group rule that references this IPv6 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The prefix list IDs for an AWS service. With outbound rules, this is the AWS service to access through a VPC endpoint from instances associated with the security group.
Describes a prefix list ID.
A description for the security group rule that references this prefix list ID.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the prefix.
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The security group and AWS account ID pairs.
Describes a security group and AWS account ID pair.
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the security group.
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
The status of a VPC peering connection, if applicable.
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
The ID of the VPC for the referenced security group, if applicable.
The ID of the VPC peering connection, if applicable.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true if the request succeeds; otherwise, returns an error.
Stops advertising an IPv4 address range that is provisioned as an address pool.
You can perform this operation at most once every 10 seconds, even if you specify different address ranges each time.
It can take a few minutes before traffic to the specified addresses stops routing to AWS because of BGP propagation delays.
See also: AWS API Documentation
Request Syntax
response = client.withdraw_byoip_cidr(
Cidr='string',
DryRun=True|False
)
[REQUIRED]
The public IPv4 address range, in CIDR notation.
dict
Response Syntax
{
'ByoipCidr': {
'Cidr': 'string',
'Description': 'string',
'StatusMessage': 'string',
'State': 'advertised'|'deprovisioned'|'failed-deprovision'|'failed-provision'|'pending-deprovision'|'pending-provision'|'provisioned'
}
}
Response Structure
(dict) --
ByoipCidr (dict) --
Information about the address pool.
Cidr (string) --
The public IPv4 address range, in CIDR notation.
Description (string) --
The description of the address range.
StatusMessage (string) --
Upon success, contains the ID of the address pool. Otherwise, contains an error message.
State (string) --
The state of the address pool.
The available paginators are:
paginator = client.get_paginator('describe_byoip_cidrs')
Creates an iterator that will paginate through responses from EC2.Client.describe_byoip_cidrs().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'ByoipCidrs': [
{
'Cidr': 'string',
'Description': 'string',
'StatusMessage': 'string',
'State': 'advertised'|'deprovisioned'|'failed-deprovision'|'failed-provision'|'pending-deprovision'|'pending-provision'|'provisioned'
},
],
}
Response Structure
(dict) --
ByoipCidrs (list) --
Information about your address ranges.
(dict) --
Information about an address range that is provisioned for use with your AWS resources through bring your own IP addresses (BYOIP).
Cidr (string) --
The public IPv4 address range, in CIDR notation.
Description (string) --
The description of the address range.
StatusMessage (string) --
Upon success, contains the ID of the address pool. Otherwise, contains an error message.
State (string) --
The state of the address pool.
paginator = client.get_paginator('describe_capacity_reservations')
Creates an iterator that will paginate through responses from EC2.Client.describe_capacity_reservations().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
CapacityReservationIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The ID of the Capacity Reservation.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'CapacityReservations': [
{
'CapacityReservationId': 'string',
'InstanceType': 'string',
'InstancePlatform': 'Linux/UNIX'|'Red Hat Enterprise Linux'|'SUSE Linux'|'Windows'|'Windows with SQL Server'|'Windows with SQL Server Enterprise'|'Windows with SQL Server Standard'|'Windows with SQL Server Web'|'Linux with SQL Server Standard'|'Linux with SQL Server Web'|'Linux with SQL Server Enterprise',
'AvailabilityZone': 'string',
'Tenancy': 'default'|'dedicated',
'TotalInstanceCount': 123,
'AvailableInstanceCount': 123,
'EbsOptimized': True|False,
'EphemeralStorage': True|False,
'State': 'active'|'expired'|'cancelled'|'pending'|'failed',
'EndDate': datetime(2015, 1, 1),
'EndDateType': 'unlimited'|'limited',
'InstanceMatchCriteria': 'open'|'targeted',
'CreateDate': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
]
}
Response Structure
(dict) --
CapacityReservations (list) --
Information about the Capacity Reservations.
(dict) --
Describes a Capacity Reservation.
CapacityReservationId (string) --
The ID of the Capacity Reservation.
InstanceType (string) --
The type of instance for which the Capacity Reservation reserves capacity.
InstancePlatform (string) --
The type of operating system for which the Capacity Reservation reserves capacity.
AvailabilityZone (string) --
The Availability Zone in which the capacity is reserved.
Tenancy (string) --
Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy settings:
TotalInstanceCount (integer) --
The number of instances for which the Capacity Reservation reserves capacity.
AvailableInstanceCount (integer) --
The remaining capacity. Indicates the number of instances that can be launched in the Capacity Reservation.
EbsOptimized (boolean) --
Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized instance.
EphemeralStorage (boolean) --
Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.
State (string) --
The current state of the Capacity Reservation. A Capacity Reservation can be in one of the following states:
EndDate (datetime) --
The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to expired when it reaches its end date and time.
EndDateType (string) --
Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following end types:
InstanceMatchCriteria (string) --
Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
CreateDate (datetime) --
The date and time at which the Capacity Reservation was created.
Tags (list) --
Any tags assigned to the Capacity Reservation.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
paginator = client.get_paginator('describe_classic_link_instances')
Creates an iterator that will paginate through responses from EC2.Client.describe_classic_link_instances().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
InstanceIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more instance IDs. Must be instances linked to a VPC through ClassicLink.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Instances': [
{
'Groups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'InstanceId': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VpcId': 'string'
},
],
}
Response Structure
(dict) --
Instances (list) --
Information about one or more linked EC2-Classic instances.
(dict) --
Describes a linked EC2-Classic instance.
Groups (list) --
A list of security groups.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
InstanceId (string) --
The ID of the instance.
Tags (list) --
Any tags assigned to the instance.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VpcId (string) --
The ID of the VPC.
paginator = client.get_paginator('describe_client_vpn_authorization_rules')
Creates an iterator that will paginate through responses from EC2.Client.describe_client_vpn_authorization_rules().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ClientVpnEndpointId='string',
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The ID of the Client VPN endpoint.
One or more filters. Filter names and values are case-sensitive.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'AuthorizationRules': [
{
'ClientVpnEndpointId': 'string',
'Description': 'string',
'GroupId': 'string',
'AccessAll': True|False,
'DestinationCidr': 'string',
'Status': {
'Code': 'authorizing'|'active'|'failed'|'revoking',
'Message': 'string'
}
},
],
}
Response Structure
(dict) --
AuthorizationRules (list) --
Information about the authorization rules.
(dict) --
Information about an authorization rule.
ClientVpnEndpointId (string) --
The ID of the Client VPN endpoint with which the authorization rule is associated.
Description (string) --
A brief description of the authorization rule.
GroupId (string) --
The ID of the Active Directory group to which the authorization rule grants access.
AccessAll (boolean) --
Indicates whether the authorization rule grants access to all clients.
DestinationCidr (string) --
The IPv4 address range, in CIDR notation, of the network to which the authorization rule applies.
Status (dict) --
The current state of the authorization rule.
Code (string) --
The state of the authorization rule.
Message (string) --
A message about the status of the authorization rule, if applicable.
paginator = client.get_paginator('describe_client_vpn_connections')
Creates an iterator that will paginate through responses from EC2.Client.describe_client_vpn_connections().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ClientVpnEndpointId='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The ID of the Client VPN endpoint.
One or more filters. Filter names and values are case-sensitive.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Connections': [
{
'ClientVpnEndpointId': 'string',
'Timestamp': 'string',
'ConnectionId': 'string',
'Username': 'string',
'ConnectionEstablishedTime': 'string',
'IngressBytes': 'string',
'EgressBytes': 'string',
'IngressPackets': 'string',
'EgressPackets': 'string',
'ClientIp': 'string',
'CommonName': 'string',
'Status': {
'Code': 'active'|'failed-to-terminate'|'terminating'|'terminated',
'Message': 'string'
},
'ConnectionEndTime': 'string'
},
],
}
Response Structure
(dict) --
Connections (list) --
Information about the active and terminated client connections.
(dict) --
Describes a client connection.
ClientVpnEndpointId (string) --
The ID of the Client VPN endpoint to which the client is connected.
Timestamp (string) --
The current date and time.
ConnectionId (string) --
The ID of the client connection.
Username (string) --
The username of the client who established the client connection. This information is only provided if Active Directory client authentication is used.
ConnectionEstablishedTime (string) --
The date and time the client connection was established.
IngressBytes (string) --
The number of bytes sent by the client.
EgressBytes (string) --
The number of bytes received by the client.
IngressPackets (string) --
The number of packets sent by the client.
EgressPackets (string) --
The number of packets received by the client.
ClientIp (string) --
The IP address of the client.
CommonName (string) --
The common name associated with the client. This is either the name of the client certificate, or the Active Directory user name.
Status (dict) --
The current state of the client connection.
Code (string) --
The state of the client connection.
Message (string) --
A message about the status of the client connection, if applicable.
ConnectionEndTime (string) --
The date and time the client connection was terminated.
paginator = client.get_paginator('describe_client_vpn_endpoints')
Creates an iterator that will paginate through responses from EC2.Client.describe_client_vpn_endpoints().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ClientVpnEndpointIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The ID of the Client VPN endpoint.
One or more filters. Filter names and values are case-sensitive.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'ClientVpnEndpoints': [
{
'ClientVpnEndpointId': 'string',
'Description': 'string',
'Status': {
'Code': 'pending-associate'|'available'|'deleting'|'deleted',
'Message': 'string'
},
'CreationTime': 'string',
'DeletionTime': 'string',
'DnsName': 'string',
'ClientCidrBlock': 'string',
'DnsServers': [
'string',
],
'SplitTunnel': True|False,
'VpnProtocol': 'openvpn',
'TransportProtocol': 'tcp'|'udp',
'AssociatedTargetNetworks': [
{
'NetworkId': 'string',
'NetworkType': 'vpc'
},
],
'ServerCertificateArn': 'string',
'AuthenticationOptions': [
{
'Type': 'certificate-authentication'|'directory-service-authentication',
'ActiveDirectory': {
'DirectoryId': 'string'
},
'MutualAuthentication': {
'ClientRootCertificateChain': 'string'
}
},
],
'ConnectionLogOptions': {
'Enabled': True|False,
'CloudwatchLogGroup': 'string',
'CloudwatchLogStream': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
}
Response Structure
(dict) --
ClientVpnEndpoints (list) --
Information about the Client VPN endpoints.
(dict) --
Describes a Client VPN endpoint.
ClientVpnEndpointId (string) --
The ID of the Client VPN endpoint.
Description (string) --
A brief description of the endpoint.
Status (dict) --
The current state of the Client VPN endpoint.
Code (string) --
The state of the Client VPN endpoint. Possible states include:
Message (string) --
A message about the status of the Client VPN endpoint.
CreationTime (string) --
The date and time the Client VPN endpoint was created.
DeletionTime (string) --
The date and time the Client VPN endpoint was deleted, if applicable.
DnsName (string) --
The DNS name to be used by clients when connecting to the Client VPN endpoint.
ClientCidrBlock (string) --
The IPv4 address range, in CIDR notation, from which client IP addresses are assigned.
DnsServers (list) --
Information about the DNS servers to be used for DNS resolution.
SplitTunnel (boolean) --
Indicates whether VPN split tunneling is supported.
VpnProtocol (string) --
The protocol used by the VPN session.
TransportProtocol (string) --
The transport protocol used by the Client VPN endpoint.
AssociatedTargetNetworks (list) --
Information about the associated target networks. A target network is a subnet in a VPC.
(dict) --
Describes a target network that is associated with a Client VPN endpoint. A target network is a subnet in a VPC.
NetworkId (string) --
The ID of the subnet.
NetworkType (string) --
The target network type.
ServerCertificateArn (string) --
The ARN of the server certificate.
AuthenticationOptions (list) --
Information about the authentication method used by the Client VPN endpoint.
(dict) --
Describes the authentication methods used by a Client VPN endpoint. Client VPN supports Active Directory and mutual authentication. For more information, see Authentication in the AWS Client VPN Administrator Guide .
Type (string) --
The authentication type used.
ActiveDirectory (dict) --
Information about the Active Directory, if applicable.
DirectoryId (string) --
The ID of the Active Directory used for authentication.
MutualAuthentication (dict) --
Information about the authentication certificates, if applicable.
ClientRootCertificateChain (string) --
The ARN of the client certificate.
ConnectionLogOptions (dict) --
Information about the client connection logging options for the Client VPN endpoint.
Enabled (boolean) --
Indicates whether client connection logging is enabled for the Client VPN endpoint.
CloudwatchLogGroup (string) --
The name of the Amazon CloudWatch Logs log group to which connection logging data is published.
CloudwatchLogStream (string) --
The name of the Amazon CloudWatch Logs log stream to which connection logging data is published.
Tags (list) --
Any tags assigned to the Client VPN endpoint.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
paginator = client.get_paginator('describe_client_vpn_routes')
Creates an iterator that will paginate through responses from EC2.Client.describe_client_vpn_routes().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ClientVpnEndpointId='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The ID of the Client VPN endpoint.
One or more filters. Filter names and values are case-sensitive.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Routes': [
{
'ClientVpnEndpointId': 'string',
'DestinationCidr': 'string',
'TargetSubnet': 'string',
'Type': 'string',
'Origin': 'string',
'Status': {
'Code': 'creating'|'active'|'failed'|'deleting',
'Message': 'string'
},
'Description': 'string'
},
],
}
Response Structure
(dict) --
Routes (list) --
Information about the Client VPN endpoint routes.
(dict) --
Information about a Client VPN endpoint route.
ClientVpnEndpointId (string) --
The ID of the Client VPN endpoint with which the route is associated.
DestinationCidr (string) --
The IPv4 address range, in CIDR notation, of the route destination.
TargetSubnet (string) --
The ID of the subnet through which traffic is routed.
Type (string) --
The route type.
Origin (string) --
Indicates how the route was associated with the Client VPN endpoint. associate indicates that the route was automatically added when the target network was associated with the Client VPN endpoint. add-route indicates that the route was manually added using the CreateClientVpnRoute action.
Status (dict) --
The current state of the route.
Code (string) --
The state of the Client VPN endpoint route.
Message (string) --
A message about the status of the Client VPN endpoint route, if applicable.
Description (string) --
A brief description of the route.
paginator = client.get_paginator('describe_client_vpn_target_networks')
Creates an iterator that will paginate through responses from EC2.Client.describe_client_vpn_target_networks().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ClientVpnEndpointId='string',
AssociationIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The ID of the Client VPN endpoint.
The IDs of the target network associations.
One or more filters. Filter names and values are case-sensitive.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'ClientVpnTargetNetworks': [
{
'AssociationId': 'string',
'VpcId': 'string',
'TargetNetworkId': 'string',
'ClientVpnEndpointId': 'string',
'Status': {
'Code': 'associating'|'associated'|'association-failed'|'disassociating'|'disassociated',
'Message': 'string'
},
'SecurityGroups': [
'string',
]
},
],
}
Response Structure
(dict) --
ClientVpnTargetNetworks (list) --
Information about the associated target networks.
(dict) --
Describes a target network associated with a Client VPN endpoint.
AssociationId (string) --
The ID of the association.
VpcId (string) --
The ID of the VPC in which the target network (subnet) is located.
TargetNetworkId (string) --
The ID of the subnet specified as the target network.
ClientVpnEndpointId (string) --
The ID of the Client VPN endpoint with which the target network is associated.
Status (dict) --
The current state of the target network association.
Code (string) --
The state of the target network association.
Message (string) --
A message about the status of the target network association, if applicable.
SecurityGroups (list) --
The IDs of the security groups applied to the target network association.
paginator = client.get_paginator('describe_dhcp_options')
Creates an iterator that will paginate through responses from EC2.Client.describe_dhcp_options().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DhcpOptionsIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The IDs of one or more DHCP options sets.
Default: Describes all your DHCP options sets.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'DhcpOptions': [
{
'DhcpConfigurations': [
{
'Key': 'string',
'Values': [
{
'Value': 'string'
},
]
},
],
'DhcpOptionsId': 'string',
'OwnerId': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
}
Response Structure
(dict) --
DhcpOptions (list) --
Information about one or more DHCP options sets.
(dict) --
Describes a set of DHCP options.
DhcpConfigurations (list) --
One or more DHCP options in the set.
(dict) --
Describes a DHCP configuration option.
Key (string) --
The name of a DHCP option.
Values (list) --
One or more values for the DHCP option.
(dict) --
Describes a value for a resource attribute that is a String.
Value (string) --
The attribute value. The value is case-sensitive.
DhcpOptionsId (string) --
The ID of the set of DHCP options.
OwnerId (string) --
The ID of the AWS account that owns the DHCP options set.
Tags (list) --
Any tags assigned to the DHCP options set.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
paginator = client.get_paginator('describe_egress_only_internet_gateways')
Creates an iterator that will paginate through responses from EC2.Client.describe_egress_only_internet_gateways().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
EgressOnlyInternetGatewayIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more egress-only internet gateway IDs.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'EgressOnlyInternetGateways': [
{
'Attachments': [
{
'State': 'attaching'|'attached'|'detaching'|'detached',
'VpcId': 'string'
},
],
'EgressOnlyInternetGatewayId': 'string'
},
],
}
Response Structure
(dict) --
EgressOnlyInternetGateways (list) --
Information about the egress-only internet gateways.
(dict) --
Describes an egress-only internet gateway.
Attachments (list) --
Information about the attachment of the egress-only internet gateway.
(dict) --
Describes the attachment of a VPC to an internet gateway or an egress-only internet gateway.
State (string) --
The current state of the attachment. For an internet gateway, the state is available when attached to a VPC; otherwise, this value is not returned.
VpcId (string) --
The ID of the VPC.
EgressOnlyInternetGatewayId (string) --
The ID of the egress-only internet gateway.
paginator = client.get_paginator('describe_fleets')
Creates an iterator that will paginate through responses from EC2.Client.describe_fleets().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
FleetIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The ID of the EC2 Fleets.
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Fleets': [
{
'ActivityStatus': 'error'|'pending-fulfillment'|'pending-termination'|'fulfilled',
'CreateTime': datetime(2015, 1, 1),
'FleetId': 'string',
'FleetState': 'submitted'|'active'|'deleted'|'failed'|'deleted-running'|'deleted-terminating'|'modifying',
'ClientToken': 'string',
'ExcessCapacityTerminationPolicy': 'no-termination'|'termination',
'FulfilledCapacity': 123.0,
'FulfilledOnDemandCapacity': 123.0,
'LaunchTemplateConfigs': [
{
'LaunchTemplateSpecification': {
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'Version': 'string'
},
'Overrides': [
{
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'MaxPrice': 'string',
'SubnetId': 'string',
'AvailabilityZone': 'string',
'WeightedCapacity': 123.0,
'Priority': 123.0,
'Placement': {
'GroupName': 'string'
}
},
]
},
],
'TargetCapacitySpecification': {
'TotalTargetCapacity': 123,
'OnDemandTargetCapacity': 123,
'SpotTargetCapacity': 123,
'DefaultTargetCapacityType': 'spot'|'on-demand'
},
'TerminateInstancesWithExpiration': True|False,
'Type': 'request'|'maintain'|'instant',
'ValidFrom': datetime(2015, 1, 1),
'ValidUntil': datetime(2015, 1, 1),
'ReplaceUnhealthyInstances': True|False,
'SpotOptions': {
'AllocationStrategy': 'lowest-price'|'diversified',
'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate',
'InstancePoolsToUseCount': 123,
'SingleInstanceType': True|False,
'SingleAvailabilityZone': True|False,
'MinTargetCapacity': 123,
'MaxTotalPrice': 'string'
},
'OnDemandOptions': {
'AllocationStrategy': 'lowest-price'|'prioritized',
'SingleInstanceType': True|False,
'SingleAvailabilityZone': True|False,
'MinTargetCapacity': 123,
'MaxTotalPrice': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'Errors': [
{
'LaunchTemplateAndOverrides': {
'LaunchTemplateSpecification': {
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'Version': 'string'
},
'Overrides': {
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'MaxPrice': 'string',
'SubnetId': 'string',
'AvailabilityZone': 'string',
'WeightedCapacity': 123.0,
'Priority': 123.0,
'Placement': {
'GroupName': 'string'
}
}
},
'Lifecycle': 'spot'|'on-demand',
'ErrorCode': 'string',
'ErrorMessage': 'string'
},
],
'Instances': [
{
'LaunchTemplateAndOverrides': {
'LaunchTemplateSpecification': {
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'Version': 'string'
},
'Overrides': {
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'MaxPrice': 'string',
'SubnetId': 'string',
'AvailabilityZone': 'string',
'WeightedCapacity': 123.0,
'Priority': 123.0,
'Placement': {
'GroupName': 'string'
}
}
},
'Lifecycle': 'spot'|'on-demand',
'InstanceIds': [
'string',
],
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'Platform': 'Windows'
},
]
},
]
}
Response Structure
(dict) --
Fleets (list) --
Information about the EC2 Fleets.
(dict) --
Describes an EC2 Fleet.
ActivityStatus (string) --
The progress of the EC2 Fleet. If there is an error, the status is error . After all requests are placed, the status is pending_fulfillment . If the size of the EC2 Fleet is equal to or greater than its target capacity, the status is fulfilled . If the size of the EC2 Fleet is decreased, the status is pending_termination while instances are terminating.
CreateTime (datetime) --
The creation date and time of the EC2 Fleet.
FleetId (string) --
The ID of the EC2 Fleet.
FleetState (string) --
The state of the EC2 Fleet.
ClientToken (string) --
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency .
Constraints: Maximum 64 ASCII characters
ExcessCapacityTerminationPolicy (string) --
Indicates whether running instances should be terminated if the target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.
FulfilledCapacity (float) --
The number of units fulfilled by this request compared to the set target capacity.
FulfilledOnDemandCapacity (float) --
The number of units fulfilled by this request compared to the set target On-Demand capacity.
LaunchTemplateConfigs (list) --
The launch template and overrides.
(dict) --
Describes a launch template and overrides.
LaunchTemplateSpecification (dict) --
The launch template.
LaunchTemplateId (string) --
The ID of the launch template. You must specify either a template ID or a template name.
LaunchTemplateName (string) --
The name of the launch template. You must specify either a template name or a template ID.
Version (string) --
The version number of the launch template. You must specify a version number.
Overrides (list) --
Any parameters that you specify override the same parameters in the launch template.
(dict) --
Describes overrides for a launch template.
InstanceType (string) --
The instance type.
MaxPrice (string) --
The maximum price per unit hour that you are willing to pay for a Spot Instance.
SubnetId (string) --
The ID of the subnet in which to launch the instances.
AvailabilityZone (string) --
The Availability Zone in which to launch the instances.
WeightedCapacity (float) --
The number of units provided by the specified instance type.
Priority (float) --
The priority for the launch template override. If AllocationStrategy is set to prioritized , EC2 Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity. The highest priority is launched first. Valid values are whole numbers starting at 0 . The lower the number, the higher the priority. If no number is set, the override has the lowest priority.
Placement (dict) --
The location where the instance launched, if applicable.
GroupName (string) --
The name of the placement group the instance is in.
TargetCapacitySpecification (dict) --
The number of units to request. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is maintain , you can specify a target capacity of 0 and add capacity later.
TotalTargetCapacity (integer) --
The number of units to request, filled using DefaultTargetCapacityType .
OnDemandTargetCapacity (integer) --
The number of On-Demand units to request. If you specify a target capacity for Spot units, you cannot specify a target capacity for On-Demand units.
SpotTargetCapacity (integer) --
The maximum number of Spot units to launch. If you specify a target capacity for On-Demand units, you cannot specify a target capacity for Spot units.
DefaultTargetCapacityType (string) --
The default TotalTargetCapacity , which is either Spot or On-Demand .
TerminateInstancesWithExpiration (boolean) --
Indicates whether running instances should be terminated when the EC2 Fleet expires.
Type (string) --
The type of request. Indicates whether the EC2 Fleet only requests the target capacity, or also attempts to maintain it. If you request a certain target capacity, EC2 Fleet only places the required requests; it does not attempt to replenish instances if capacity is diminished, and does not submit requests in alternative capacity pools if capacity is unavailable. To maintain a certain target capacity, EC2 Fleet places the required requests to meet this target capacity. It also automatically replenishes any interrupted Spot Instances. Default: maintain .
ValidFrom (datetime) --
The start date and time of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). The default is to start fulfilling the request immediately.
ValidUntil (datetime) --
The end date and time of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). At this point, no new instance requests are placed or able to fulfill the request. The default end date is 7 days from the current date.
ReplaceUnhealthyInstances (boolean) --
Indicates whether EC2 Fleet should replace unhealthy instances.
SpotOptions (dict) --
The configuration of Spot Instances in an EC2 Fleet.
AllocationStrategy (string) --
Indicates how to allocate the target capacity across the Spot pools specified by the Spot Fleet request. The default is lowest-price .
InstanceInterruptionBehavior (string) --
The behavior when a Spot Instance is interrupted. The default is terminate .
InstancePoolsToUseCount (integer) --
The number of Spot pools across which to allocate your target Spot capacity. Valid only when AllocationStrategy is set to lowestPrice . EC2 Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify.
SingleInstanceType (boolean) --
Indicates that the fleet uses a single instance type to launch all Spot Instances in the fleet.
SingleAvailabilityZone (boolean) --
Indicates that the fleet launches all Spot Instances into a single Availability Zone.
MinTargetCapacity (integer) --
The minimum target capacity for Spot Instances in the fleet. If the minimum target capacity is not reached, the fleet launches no instances.
MaxTotalPrice (string) --
The maximum amount per hour for Spot Instances that you're willing to pay.
OnDemandOptions (dict) --
The allocation strategy of On-Demand Instances in an EC2 Fleet.
AllocationStrategy (string) --
The order of the launch template overrides to use in fulfilling On-Demand capacity. If you specify lowest-price , EC2 Fleet uses price to determine the order, launching the lowest price first. If you specify prioritized , EC2 Fleet uses the priority that you assigned to each launch template override, launching the highest priority first. If you do not specify a value, EC2 Fleet defaults to lowest-price .
SingleInstanceType (boolean) --
Indicates that the fleet uses a single instance type to launch all On-Demand Instances in the fleet.
SingleAvailabilityZone (boolean) --
Indicates that the fleet launches all On-Demand Instances into a single Availability Zone.
MinTargetCapacity (integer) --
The minimum target capacity for On-Demand Instances in the fleet. If the minimum target capacity is not reached, the fleet launches no instances.
MaxTotalPrice (string) --
The maximum amount per hour for On-Demand Instances that you're willing to pay.
Tags (list) --
The tags for an EC2 Fleet resource.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Errors (list) --
Information about the instances that could not be launched by the fleet. Valid only when Type is set to instant .
(dict) --
Describes the instances that could not be launched by the fleet.
LaunchTemplateAndOverrides (dict) --
The launch templates and overrides that were used for launching the instances. Any parameters that you specify in the Overrides override the same parameters in the launch template.
LaunchTemplateSpecification (dict) --
The launch template.
LaunchTemplateId (string) --
The ID of the launch template. You must specify either a template ID or a template name.
LaunchTemplateName (string) --
The name of the launch template. You must specify either a template name or a template ID.
Version (string) --
The version number of the launch template. You must specify a version number.
Overrides (dict) --
Any parameters that you specify override the same parameters in the launch template.
InstanceType (string) --
The instance type.
MaxPrice (string) --
The maximum price per unit hour that you are willing to pay for a Spot Instance.
SubnetId (string) --
The ID of the subnet in which to launch the instances.
AvailabilityZone (string) --
The Availability Zone in which to launch the instances.
WeightedCapacity (float) --
The number of units provided by the specified instance type.
Priority (float) --
The priority for the launch template override. If AllocationStrategy is set to prioritized , EC2 Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity. The highest priority is launched first. Valid values are whole numbers starting at 0 . The lower the number, the higher the priority. If no number is set, the override has the lowest priority.
Placement (dict) --
The location where the instance launched, if applicable.
GroupName (string) --
The name of the placement group the instance is in.
Lifecycle (string) --
Indicates if the instance that could not be launched was a Spot Instance or On-Demand Instance.
ErrorCode (string) --
The error code that indicates why the instance could not be launched. For more information about error codes, see Error Codes .
ErrorMessage (string) --
The error message that describes why the instance could not be launched. For more information about error messages, see ee Error Codes .
Instances (list) --
Information about the instances that were launched by the fleet. Valid only when Type is set to instant .
(dict) --
Describes the instances that were launched by the fleet.
LaunchTemplateAndOverrides (dict) --
The launch templates and overrides that were used for launching the instances. Any parameters that you specify in the Overrides override the same parameters in the launch template.
LaunchTemplateSpecification (dict) --
The launch template.
LaunchTemplateId (string) --
The ID of the launch template. You must specify either a template ID or a template name.
LaunchTemplateName (string) --
The name of the launch template. You must specify either a template name or a template ID.
Version (string) --
The version number of the launch template. You must specify a version number.
Overrides (dict) --
Any parameters that you specify override the same parameters in the launch template.
InstanceType (string) --
The instance type.
MaxPrice (string) --
The maximum price per unit hour that you are willing to pay for a Spot Instance.
SubnetId (string) --
The ID of the subnet in which to launch the instances.
AvailabilityZone (string) --
The Availability Zone in which to launch the instances.
WeightedCapacity (float) --
The number of units provided by the specified instance type.
Priority (float) --
The priority for the launch template override. If AllocationStrategy is set to prioritized , EC2 Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity. The highest priority is launched first. Valid values are whole numbers starting at 0 . The lower the number, the higher the priority. If no number is set, the override has the lowest priority.
Placement (dict) --
The location where the instance launched, if applicable.
GroupName (string) --
The name of the placement group the instance is in.
Lifecycle (string) --
Indicates if the instance that was launched is a Spot Instance or On-Demand Instance.
InstanceIds (list) --
The IDs of the instances.
InstanceType (string) --
The instance type.
Platform (string) --
The value is Windows for Windows instances; otherwise blank.
paginator = client.get_paginator('describe_flow_logs')
Creates an iterator that will paginate through responses from EC2.Client.describe_flow_logs().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
FlowLogIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more flow log IDs.
Constraint: Maximum of 1000 flow log IDs.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'FlowLogs': [
{
'CreationTime': datetime(2015, 1, 1),
'DeliverLogsErrorMessage': 'string',
'DeliverLogsPermissionArn': 'string',
'DeliverLogsStatus': 'string',
'FlowLogId': 'string',
'FlowLogStatus': 'string',
'LogGroupName': 'string',
'ResourceId': 'string',
'TrafficType': 'ACCEPT'|'REJECT'|'ALL',
'LogDestinationType': 'cloud-watch-logs'|'s3',
'LogDestination': 'string'
},
],
}
Response Structure
(dict) --
FlowLogs (list) --
Information about the flow logs.
(dict) --
Describes a flow log.
CreationTime (datetime) --
The date and time the flow log was created.
DeliverLogsErrorMessage (string) --
Information about the error that occurred. Rate limited indicates that CloudWatch Logs throttling has been applied for one or more network interfaces, or that you've reached the limit on the number of log groups that you can create. Access error indicates that the IAM role associated with the flow log does not have sufficient permissions to publish to CloudWatch Logs. Unknown error indicates an internal error.
DeliverLogsPermissionArn (string) --
The ARN of the IAM role that posts logs to CloudWatch Logs.
DeliverLogsStatus (string) --
The status of the logs delivery (SUCCESS | FAILED ).
FlowLogId (string) --
The flow log ID.
FlowLogStatus (string) --
The status of the flow log (ACTIVE ).
LogGroupName (string) --
The name of the flow log group.
ResourceId (string) --
The ID of the resource on which the flow log was created.
TrafficType (string) --
The type of traffic captured for the flow log.
LogDestinationType (string) --
Specifies the type of destination to which the flow log data is published. Flow log data can be published to CloudWatch Logs or Amazon S3.
LogDestination (string) --
Specifies the destination to which the flow log data is published. Flow log data can be published to an CloudWatch Logs log group or an Amazon S3 bucket. If the flow log publishes to CloudWatch Logs, this element indicates the Amazon Resource Name (ARN) of the CloudWatch Logs log group to which the data is published. If the flow log publishes to Amazon S3, this element indicates the ARN of the Amazon S3 bucket to which the data is published.
paginator = client.get_paginator('describe_fpga_images')
Creates an iterator that will paginate through responses from EC2.Client.describe_fpga_images().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
FpgaImageIds=[
'string',
],
Owners=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The AFI IDs.
Filters the AFI by owner. Specify an AWS account ID, self (owner is the sender of the request), or an AWS owner alias (valid values are amazon | aws-marketplace ).
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'FpgaImages': [
{
'FpgaImageId': 'string',
'FpgaImageGlobalId': 'string',
'Name': 'string',
'Description': 'string',
'ShellVersion': 'string',
'PciId': {
'DeviceId': 'string',
'VendorId': 'string',
'SubsystemId': 'string',
'SubsystemVendorId': 'string'
},
'State': {
'Code': 'pending'|'failed'|'available'|'unavailable',
'Message': 'string'
},
'CreateTime': datetime(2015, 1, 1),
'UpdateTime': datetime(2015, 1, 1),
'OwnerId': 'string',
'OwnerAlias': 'string',
'ProductCodes': [
{
'ProductCodeId': 'string',
'ProductCodeType': 'devpay'|'marketplace'
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'Public': True|False,
'DataRetentionSupport': True|False
},
],
}
Response Structure
(dict) --
FpgaImages (list) --
Information about the FPGA images.
(dict) --
Describes an Amazon FPGA image (AFI).
FpgaImageId (string) --
The FPGA image identifier (AFI ID).
FpgaImageGlobalId (string) --
The global FPGA image identifier (AGFI ID).
Name (string) --
The name of the AFI.
Description (string) --
The description of the AFI.
ShellVersion (string) --
The version of the AWS Shell that was used to create the bitstream.
PciId (dict) --
Information about the PCI bus.
DeviceId (string) --
The ID of the device.
VendorId (string) --
The ID of the vendor.
SubsystemId (string) --
The ID of the subsystem.
SubsystemVendorId (string) --
The ID of the vendor for the subsystem.
State (dict) --
Information about the state of the AFI.
Code (string) --
The state. The following are the possible values:
Message (string) --
If the state is failed , this is the error message.
CreateTime (datetime) --
The date and time the AFI was created.
UpdateTime (datetime) --
The time of the most recent update to the AFI.
OwnerId (string) --
The AWS account ID of the AFI owner.
OwnerAlias (string) --
The alias of the AFI owner. Possible values include self , amazon , and aws-marketplace .
ProductCodes (list) --
The product codes for the AFI.
(dict) --
Describes a product code.
ProductCodeId (string) --
The product code.
ProductCodeType (string) --
The type of product code.
Tags (list) --
Any tags assigned to the AFI.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Public (boolean) --
Indicates whether the AFI is public.
DataRetentionSupport (boolean) --
Indicates whether data retention support is enabled for the AFI.
paginator = client.get_paginator('describe_host_reservation_offerings')
Creates an iterator that will paginate through responses from EC2.Client.describe_host_reservation_offerings().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxDuration=123,
MinDuration=123,
OfferingId='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'OfferingSet': [
{
'CurrencyCode': 'USD',
'Duration': 123,
'HourlyPrice': 'string',
'InstanceFamily': 'string',
'OfferingId': 'string',
'PaymentOption': 'AllUpfront'|'PartialUpfront'|'NoUpfront',
'UpfrontPrice': 'string'
},
]
}
Response Structure
(dict) --
OfferingSet (list) --
Information about the offerings.
(dict) --
Details about the Dedicated Host Reservation offering.
CurrencyCode (string) --
The currency of the offering.
Duration (integer) --
The duration of the offering (in seconds).
HourlyPrice (string) --
The hourly price of the offering.
InstanceFamily (string) --
The instance family of the offering.
OfferingId (string) --
The ID of the offering.
PaymentOption (string) --
The available payment option.
UpfrontPrice (string) --
The upfront price of the offering. Does not apply to No Upfront offerings.
paginator = client.get_paginator('describe_host_reservations')
Creates an iterator that will paginate through responses from EC2.Client.describe_host_reservations().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
HostReservationIdSet=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The host reservation IDs.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'HostReservationSet': [
{
'Count': 123,
'CurrencyCode': 'USD',
'Duration': 123,
'End': datetime(2015, 1, 1),
'HostIdSet': [
'string',
],
'HostReservationId': 'string',
'HourlyPrice': 'string',
'InstanceFamily': 'string',
'OfferingId': 'string',
'PaymentOption': 'AllUpfront'|'PartialUpfront'|'NoUpfront',
'Start': datetime(2015, 1, 1),
'State': 'payment-pending'|'payment-failed'|'active'|'retired',
'UpfrontPrice': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
}
Response Structure
(dict) --
HostReservationSet (list) --
Details about the reservation's configuration.
(dict) --
Details about the Dedicated Host Reservation and associated Dedicated Hosts.
Count (integer) --
The number of Dedicated Hosts the reservation is associated with.
CurrencyCode (string) --
The currency in which the upfrontPrice and hourlyPrice amounts are specified. At this time, the only supported currency is USD .
Duration (integer) --
The length of the reservation's term, specified in seconds. Can be 31536000 (1 year) | 94608000 (3 years) .
End (datetime) --
The date and time that the reservation ends.
HostIdSet (list) --
The IDs of the Dedicated Hosts associated with the reservation.
HostReservationId (string) --
The ID of the reservation that specifies the associated Dedicated Hosts.
HourlyPrice (string) --
The hourly price of the reservation.
InstanceFamily (string) --
The instance family of the Dedicated Host Reservation. The instance family on the Dedicated Host must be the same in order for it to benefit from the reservation.
OfferingId (string) --
The ID of the reservation. This remains the same regardless of which Dedicated Hosts are associated with it.
PaymentOption (string) --
The payment option selected for this reservation.
Start (datetime) --
The date and time that the reservation started.
State (string) --
The state of the reservation.
UpfrontPrice (string) --
The upfront price of the reservation.
Tags (list) --
Any tags assigned to the Dedicated Host Reservation.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
paginator = client.get_paginator('describe_hosts')
Creates an iterator that will paginate through responses from EC2.Client.describe_hosts().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
HostIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The IDs of the Dedicated Hosts. The IDs are used for targeted instance launches.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Hosts': [
{
'AutoPlacement': 'on'|'off',
'AvailabilityZone': 'string',
'AvailableCapacity': {
'AvailableInstanceCapacity': [
{
'AvailableCapacity': 123,
'InstanceType': 'string',
'TotalCapacity': 123
},
],
'AvailableVCpus': 123
},
'ClientToken': 'string',
'HostId': 'string',
'HostProperties': {
'Cores': 123,
'InstanceType': 'string',
'Sockets': 123,
'TotalVCpus': 123
},
'HostReservationId': 'string',
'Instances': [
{
'InstanceId': 'string',
'InstanceType': 'string'
},
],
'State': 'available'|'under-assessment'|'permanent-failure'|'released'|'released-permanent-failure'|'pending',
'AllocationTime': datetime(2015, 1, 1),
'ReleaseTime': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'HostRecovery': 'on'|'off'
},
],
}
Response Structure
(dict) --
Hosts (list) --
Information about the Dedicated Hosts.
(dict) --
Describes the properties of the Dedicated Host.
AutoPlacement (string) --
Whether auto-placement is on or off.
AvailabilityZone (string) --
The Availability Zone of the Dedicated Host.
AvailableCapacity (dict) --
The number of new instances that can be launched onto the Dedicated Host.
AvailableInstanceCapacity (list) --
The total number of instances supported by the Dedicated Host.
(dict) --
Information about the instance type that the Dedicated Host supports.
AvailableCapacity (integer) --
The number of instances that can still be launched onto the Dedicated Host.
InstanceType (string) --
The instance type size supported by the Dedicated Host.
TotalCapacity (integer) --
The total number of instances that can be launched onto the Dedicated Host.
AvailableVCpus (integer) --
The number of vCPUs available on the Dedicated Host.
ClientToken (string) --
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency .
HostId (string) --
The ID of the Dedicated Host.
HostProperties (dict) --
The hardware specifications of the Dedicated Host.
Cores (integer) --
The number of cores on the Dedicated Host.
InstanceType (string) --
The instance type size that the Dedicated Host supports (for example, m3.medium ).
Sockets (integer) --
The number of sockets on the Dedicated Host.
TotalVCpus (integer) --
The number of vCPUs on the Dedicated Host.
HostReservationId (string) --
The reservation ID of the Dedicated Host. This returns a null response if the Dedicated Host doesn't have an associated reservation.
Instances (list) --
The IDs and instance type that are currently running on the Dedicated Host.
(dict) --
Describes an instance running on a Dedicated Host.
InstanceId (string) --
the IDs of instances that are running on the Dedicated Host.
InstanceType (string) --
The instance type size (for example, m3.medium ) of the running instance.
State (string) --
The Dedicated Host's state.
AllocationTime (datetime) --
The time that the Dedicated Host was allocated.
ReleaseTime (datetime) --
The time that the Dedicated Host was released.
Tags (list) --
Any tags assigned to the Dedicated Host.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
HostRecovery (string) --
Indicates whether host recovery is enabled or disabled for the Dedicated Host.
paginator = client.get_paginator('describe_iam_instance_profile_associations')
Creates an iterator that will paginate through responses from EC2.Client.describe_iam_instance_profile_associations().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
AssociationIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The IAM instance profile associations.
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'IamInstanceProfileAssociations': [
{
'AssociationId': 'string',
'InstanceId': 'string',
'IamInstanceProfile': {
'Arn': 'string',
'Id': 'string'
},
'State': 'associating'|'associated'|'disassociating'|'disassociated',
'Timestamp': datetime(2015, 1, 1)
},
],
}
Response Structure
(dict) --
IamInstanceProfileAssociations (list) --
Information about the IAM instance profile associations.
(dict) --
Describes an association between an IAM instance profile and an instance.
AssociationId (string) --
The ID of the association.
InstanceId (string) --
The ID of the instance.
IamInstanceProfile (dict) --
The IAM instance profile.
Arn (string) --
The Amazon Resource Name (ARN) of the instance profile.
Id (string) --
The ID of the instance profile.
State (string) --
The state of the association.
Timestamp (datetime) --
The time the IAM instance profile was associated with the instance.
paginator = client.get_paginator('describe_import_image_tasks')
Creates an iterator that will paginate through responses from EC2.Client.describe_import_image_tasks().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
ImportTaskIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
Filter tasks using the task-state filter and one of the following values: active, completed, deleting, deleted.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A list of import image task IDs.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'ImportImageTasks': [
{
'Architecture': 'string',
'Description': 'string',
'Encrypted': True|False,
'Hypervisor': 'string',
'ImageId': 'string',
'ImportTaskId': 'string',
'KmsKeyId': 'string',
'LicenseType': 'string',
'Platform': 'string',
'Progress': 'string',
'SnapshotDetails': [
{
'Description': 'string',
'DeviceName': 'string',
'DiskImageSize': 123.0,
'Format': 'string',
'Progress': 'string',
'SnapshotId': 'string',
'Status': 'string',
'StatusMessage': 'string',
'Url': 'string',
'UserBucket': {
'S3Bucket': 'string',
'S3Key': 'string'
}
},
],
'Status': 'string',
'StatusMessage': 'string'
},
],
}
Response Structure
(dict) --
ImportImageTasks (list) --
A list of zero or more import image tasks that are currently active or were completed or canceled in the previous 7 days.
(dict) --
Describes an import image task.
Architecture (string) --
The architecture of the virtual machine.
Valid values: i386 | x86_64 | arm64
Description (string) --
A description of the import task.
Encrypted (boolean) --
Indicates whether the image is encrypted.
Hypervisor (string) --
The target hypervisor for the import task.
Valid values: xen
ImageId (string) --
The ID of the Amazon Machine Image (AMI) of the imported virtual machine.
ImportTaskId (string) --
The ID of the import image task.
KmsKeyId (string) --
The identifier for the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to create the encrypted image.
LicenseType (string) --
The license type of the virtual machine.
Platform (string) --
The description string for the import image task.
Progress (string) --
The percentage of progress of the import image task.
SnapshotDetails (list) --
Information about the snapshots.
(dict) --
Describes the snapshot created from the imported disk.
Description (string) --
A description for the snapshot.
DeviceName (string) --
The block device mapping for the snapshot.
DiskImageSize (float) --
The size of the disk in the snapshot, in GiB.
Format (string) --
The format of the disk image from which the snapshot is created.
Progress (string) --
The percentage of progress for the task.
SnapshotId (string) --
The snapshot ID of the disk being imported.
Status (string) --
A brief status of the snapshot creation.
StatusMessage (string) --
A detailed status message for the snapshot creation.
Url (string) --
The URL used to access the disk image.
UserBucket (dict) --
The S3 bucket for the disk image.
S3Bucket (string) --
The S3 bucket from which the disk image was created.
S3Key (string) --
The file name of the disk image.
Status (string) --
A brief status for the import image task.
StatusMessage (string) --
A descriptive status message for the import image task.
paginator = client.get_paginator('describe_import_snapshot_tasks')
Creates an iterator that will paginate through responses from EC2.Client.describe_import_snapshot_tasks().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
ImportTaskIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A list of import snapshot task IDs.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'ImportSnapshotTasks': [
{
'Description': 'string',
'ImportTaskId': 'string',
'SnapshotTaskDetail': {
'Description': 'string',
'DiskImageSize': 123.0,
'Encrypted': True|False,
'Format': 'string',
'KmsKeyId': 'string',
'Progress': 'string',
'SnapshotId': 'string',
'Status': 'string',
'StatusMessage': 'string',
'Url': 'string',
'UserBucket': {
'S3Bucket': 'string',
'S3Key': 'string'
}
}
},
],
}
Response Structure
(dict) --
ImportSnapshotTasks (list) --
A list of zero or more import snapshot tasks that are currently active or were completed or canceled in the previous 7 days.
(dict) --
Describes an import snapshot task.
Description (string) --
A description of the import snapshot task.
ImportTaskId (string) --
The ID of the import snapshot task.
SnapshotTaskDetail (dict) --
Describes an import snapshot task.
Description (string) --
The description of the snapshot.
DiskImageSize (float) --
The size of the disk in the snapshot, in GiB.
Encrypted (boolean) --
Indicates whether the snapshot is encrypted.
Format (string) --
The format of the disk image from which the snapshot is created.
KmsKeyId (string) --
The identifier for the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to create the encrypted snapshot.
Progress (string) --
The percentage of completion for the import snapshot task.
SnapshotId (string) --
The snapshot ID of the disk being imported.
Status (string) --
A brief status for the import snapshot task.
StatusMessage (string) --
A detailed status message for the import snapshot task.
Url (string) --
The URL of the disk image from which the snapshot is created.
UserBucket (dict) --
The S3 bucket for the disk image.
S3Bucket (string) --
The S3 bucket from which the disk image was created.
S3Key (string) --
The file name of the disk image.
paginator = client.get_paginator('describe_instance_credit_specifications')
Creates an iterator that will paginate through responses from EC2.Client.describe_instance_credit_specifications().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
InstanceIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The instance IDs.
Default: Describes all your instances.
Constraints: Maximum 1000 explicitly specified instance IDs.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'InstanceCreditSpecifications': [
{
'InstanceId': 'string',
'CpuCredits': 'string'
},
],
}
Response Structure
(dict) --
InstanceCreditSpecifications (list) --
Information about the credit option for CPU usage of an instance.
(dict) --
Describes the credit option for CPU usage of a T2 or T3 instance.
InstanceId (string) --
The ID of the instance.
CpuCredits (string) --
The credit option for CPU usage of the instance. Valid values are standard and unlimited .
paginator = client.get_paginator('describe_instance_status')
Creates an iterator that will paginate through responses from EC2.Client.describe_instance_status().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
InstanceIds=[
'string',
],
DryRun=True|False,
IncludeAllInstances=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The instance IDs.
Default: Describes all your instances.
Constraints: Maximum 100 explicitly specified instance IDs.
When true , includes the health status for all instances. When false , includes the health status for running instances only.
Default: false
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'InstanceStatuses': [
{
'AvailabilityZone': 'string',
'Events': [
{
'InstanceEventId': 'string',
'Code': 'instance-reboot'|'system-reboot'|'system-maintenance'|'instance-retirement'|'instance-stop',
'Description': 'string',
'NotAfter': datetime(2015, 1, 1),
'NotBefore': datetime(2015, 1, 1),
'NotBeforeDeadline': datetime(2015, 1, 1)
},
],
'InstanceId': 'string',
'InstanceState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceStatus': {
'Details': [
{
'ImpairedSince': datetime(2015, 1, 1),
'Name': 'reachability',
'Status': 'passed'|'failed'|'insufficient-data'|'initializing'
},
],
'Status': 'ok'|'impaired'|'insufficient-data'|'not-applicable'|'initializing'
},
'SystemStatus': {
'Details': [
{
'ImpairedSince': datetime(2015, 1, 1),
'Name': 'reachability',
'Status': 'passed'|'failed'|'insufficient-data'|'initializing'
},
],
'Status': 'ok'|'impaired'|'insufficient-data'|'not-applicable'|'initializing'
}
},
],
}
Response Structure
(dict) --
InstanceStatuses (list) --
Information about the status of the instances.
(dict) --
Describes the status of an instance.
AvailabilityZone (string) --
The Availability Zone of the instance.
Events (list) --
Any scheduled events associated with the instance.
(dict) --
Describes a scheduled event for an instance.
InstanceEventId (string) --
The ID of the event.
Code (string) --
The event code.
Description (string) --
A description of the event.
After a scheduled event is completed, it can still be described for up to a week. If the event has been completed, this description starts with the following text: [Completed].
NotAfter (datetime) --
The latest scheduled end time for the event.
NotBefore (datetime) --
The earliest scheduled start time for the event.
NotBeforeDeadline (datetime) --
The deadline for starting the event.
InstanceId (string) --
The ID of the instance.
InstanceState (dict) --
The intended state of the instance. DescribeInstanceStatus requires that an instance be in the running state.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
InstanceStatus (dict) --
Reports impaired functionality that stems from issues internal to the instance, such as impaired reachability.
Details (list) --
The system instance health or application instance health.
(dict) --
Describes the instance status.
ImpairedSince (datetime) --
The time when a status check failed. For an instance that was launched and impaired, this is the time when the instance was launched.
Name (string) --
The type of instance status.
Status (string) --
The status.
Status (string) --
The status.
SystemStatus (dict) --
Reports impaired functionality that stems from issues related to the systems that support an instance, such as hardware failures and network connectivity problems.
Details (list) --
The system instance health or application instance health.
(dict) --
Describes the instance status.
ImpairedSince (datetime) --
The time when a status check failed. For an instance that was launched and impaired, this is the time when the instance was launched.
Name (string) --
The type of instance status.
Status (string) --
The status.
Status (string) --
The status.
paginator = client.get_paginator('describe_instances')
Creates an iterator that will paginate through responses from EC2.Client.describe_instances().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
InstanceIds=[
'string',
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The instance IDs.
Default: Describes all your instances.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Reservations': [
{
'Groups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'Instances': [
{
'AmiLaunchIndex': 123,
'ImageId': 'string',
'InstanceId': 'string',
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'KernelId': 'string',
'KeyName': 'string',
'LaunchTime': datetime(2015, 1, 1),
'Monitoring': {
'State': 'disabled'|'disabling'|'enabled'|'pending'
},
'Placement': {
'AvailabilityZone': 'string',
'Affinity': 'string',
'GroupName': 'string',
'PartitionNumber': 123,
'HostId': 'string',
'Tenancy': 'default'|'dedicated'|'host',
'SpreadDomain': 'string'
},
'Platform': 'Windows',
'PrivateDnsName': 'string',
'PrivateIpAddress': 'string',
'ProductCodes': [
{
'ProductCodeId': 'string',
'ProductCodeType': 'devpay'|'marketplace'
},
],
'PublicDnsName': 'string',
'PublicIpAddress': 'string',
'RamdiskId': 'string',
'State': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'StateTransitionReason': 'string',
'SubnetId': 'string',
'VpcId': 'string',
'Architecture': 'i386'|'x86_64'|'arm64',
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'Ebs': {
'AttachTime': datetime(2015, 1, 1),
'DeleteOnTermination': True|False,
'Status': 'attaching'|'attached'|'detaching'|'detached',
'VolumeId': 'string'
}
},
],
'ClientToken': 'string',
'EbsOptimized': True|False,
'EnaSupport': True|False,
'Hypervisor': 'ovm'|'xen',
'IamInstanceProfile': {
'Arn': 'string',
'Id': 'string'
},
'InstanceLifecycle': 'spot'|'scheduled',
'ElasticGpuAssociations': [
{
'ElasticGpuId': 'string',
'ElasticGpuAssociationId': 'string',
'ElasticGpuAssociationState': 'string',
'ElasticGpuAssociationTime': 'string'
},
],
'ElasticInferenceAcceleratorAssociations': [
{
'ElasticInferenceAcceleratorArn': 'string',
'ElasticInferenceAcceleratorAssociationId': 'string',
'ElasticInferenceAcceleratorAssociationState': 'string',
'ElasticInferenceAcceleratorAssociationTime': datetime(2015, 1, 1)
},
],
'NetworkInterfaces': [
{
'Association': {
'IpOwnerId': 'string',
'PublicDnsName': 'string',
'PublicIp': 'string'
},
'Attachment': {
'AttachTime': datetime(2015, 1, 1),
'AttachmentId': 'string',
'DeleteOnTermination': True|False,
'DeviceIndex': 123,
'Status': 'attaching'|'attached'|'detaching'|'detached'
},
'Description': 'string',
'Groups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'MacAddress': 'string',
'NetworkInterfaceId': 'string',
'OwnerId': 'string',
'PrivateDnsName': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Association': {
'IpOwnerId': 'string',
'PublicDnsName': 'string',
'PublicIp': 'string'
},
'Primary': True|False,
'PrivateDnsName': 'string',
'PrivateIpAddress': 'string'
},
],
'SourceDestCheck': True|False,
'Status': 'available'|'associated'|'attaching'|'in-use'|'detaching',
'SubnetId': 'string',
'VpcId': 'string',
'InterfaceType': 'string'
},
],
'RootDeviceName': 'string',
'RootDeviceType': 'ebs'|'instance-store',
'SecurityGroups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'SourceDestCheck': True|False,
'SpotInstanceRequestId': 'string',
'SriovNetSupport': 'string',
'StateReason': {
'Code': 'string',
'Message': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VirtualizationType': 'hvm'|'paravirtual',
'CpuOptions': {
'CoreCount': 123,
'ThreadsPerCore': 123
},
'CapacityReservationId': 'string',
'CapacityReservationSpecification': {
'CapacityReservationPreference': 'open'|'none',
'CapacityReservationTarget': {
'CapacityReservationId': 'string'
}
},
'HibernationOptions': {
'Configured': True|False
},
'Licenses': [
{
'LicenseConfigurationArn': 'string'
},
]
},
],
'OwnerId': 'string',
'RequesterId': 'string',
'ReservationId': 'string'
},
],
}
Response Structure
(dict) --
Reservations (list) --
Information about the reservations.
(dict) --
Describes a reservation.
Groups (list) --
[EC2-Classic only] The security groups.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
Instances (list) --
The instances.
(dict) --
Describes an instance.
AmiLaunchIndex (integer) --
The AMI launch index, which can be used to find this instance in the launch group.
ImageId (string) --
The ID of the AMI used to launch the instance.
InstanceId (string) --
The ID of the instance.
InstanceType (string) --
The instance type.
KernelId (string) --
The kernel associated with this instance, if applicable.
KeyName (string) --
The name of the key pair, if this instance was launched with an associated key pair.
LaunchTime (datetime) --
The time the instance was launched.
Monitoring (dict) --
The monitoring for the instance.
State (string) --
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
Placement (dict) --
The location where the instance launched, if applicable.
AvailabilityZone (string) --
The Availability Zone of the instance.
If not specified, an Availability Zone will be automatically chosen for you based on the load balancing criteria for the Region.
Affinity (string) --
The affinity setting for the instance on the Dedicated Host. This parameter is not supported for the ImportInstance command.
GroupName (string) --
The name of the placement group the instance is in.
PartitionNumber (integer) --
The number of the partition the instance is in. Valid only if the placement group strategy is set to partition .
HostId (string) --
The ID of the Dedicated Host on which the instance resides. This parameter is not supported for the ImportInstance command.
Tenancy (string) --
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for the ImportInstance command.
SpreadDomain (string) --
Reserved for future use.
Platform (string) --
The value is Windows for Windows instances; otherwise blank.
PrivateDnsName (string) --
(IPv4 only) The private DNS hostname name assigned to the instance. This DNS hostname can only be used inside the Amazon EC2 network. This name is not available until the instance enters the running state.
[EC2-VPC] The Amazon-provided DNS server resolves Amazon-provided private DNS hostnames if you've enabled DNS resolution and DNS hostnames in your VPC. If you are not using the Amazon-provided DNS server in your VPC, your custom domain name servers must resolve the hostname as appropriate.
PrivateIpAddress (string) --
The private IPv4 address assigned to the instance.
ProductCodes (list) --
The product codes attached to this instance, if applicable.
(dict) --
Describes a product code.
ProductCodeId (string) --
The product code.
ProductCodeType (string) --
The type of product code.
PublicDnsName (string) --
(IPv4 only) The public DNS name assigned to the instance. This name is not available until the instance enters the running state. For EC2-VPC, this name is only available if you've enabled DNS hostnames for your VPC.
PublicIpAddress (string) --
The public IPv4 address assigned to the instance, if applicable.
RamdiskId (string) --
The RAM disk associated with this instance, if applicable.
State (dict) --
The current state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
StateTransitionReason (string) --
The reason for the most recent state transition. This might be an empty string.
SubnetId (string) --
[EC2-VPC] The ID of the subnet in which the instance is running.
VpcId (string) --
[EC2-VPC] The ID of the VPC in which the instance is running.
Architecture (string) --
The architecture of the image.
BlockDeviceMappings (list) --
Any block device mapping entries for the instance.
(dict) --
Describes a block device mapping.
DeviceName (string) --
The device name (for example, /dev/sdh or xvdh ).
Ebs (dict) --
Parameters used to automatically set up EBS volumes when the instance is launched.
AttachTime (datetime) --
The time stamp when the attachment initiated.
DeleteOnTermination (boolean) --
Indicates whether the volume is deleted on instance termination.
Status (string) --
The attachment state.
VolumeId (string) --
The ID of the EBS volume.
ClientToken (string) --
The idempotency token you provided when you launched the instance, if applicable.
EbsOptimized (boolean) --
Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.
EnaSupport (boolean) --
Specifies whether enhanced networking with ENA is enabled.
Hypervisor (string) --
The hypervisor type of the instance.
IamInstanceProfile (dict) --
The IAM instance profile associated with the instance, if applicable.
Arn (string) --
The Amazon Resource Name (ARN) of the instance profile.
Id (string) --
The ID of the instance profile.
InstanceLifecycle (string) --
Indicates whether this is a Spot Instance or a Scheduled Instance.
ElasticGpuAssociations (list) --
The Elastic GPU associated with the instance.
(dict) --
Describes the association between an instance and an Elastic Graphics accelerator.
ElasticGpuId (string) --
The ID of the Elastic Graphics accelerator.
ElasticGpuAssociationId (string) --
The ID of the association.
ElasticGpuAssociationState (string) --
The state of the association between the instance and the Elastic Graphics accelerator.
ElasticGpuAssociationTime (string) --
The time the Elastic Graphics accelerator was associated with the instance.
ElasticInferenceAcceleratorAssociations (list) --
The elastic inference accelerator associated with the instance.
(dict) --
Describes the association between an instance and an elastic inference accelerator.
ElasticInferenceAcceleratorArn (string) --
The Amazon Resource Name (ARN) of the elastic inference accelerator.
ElasticInferenceAcceleratorAssociationId (string) --
The ID of the association.
ElasticInferenceAcceleratorAssociationState (string) --
The state of the elastic inference accelerator.
ElasticInferenceAcceleratorAssociationTime (datetime) --
The time at which the elastic inference accelerator is associated with an instance.
NetworkInterfaces (list) --
[EC2-VPC] The network interfaces for the instance.
(dict) --
Describes a network interface.
Association (dict) --
The association information for an Elastic IPv4 associated with the network interface.
IpOwnerId (string) --
The ID of the owner of the Elastic IP address.
PublicDnsName (string) --
The public DNS name.
PublicIp (string) --
The public IP address or Elastic IP address bound to the network interface.
Attachment (dict) --
The network interface attachment.
AttachTime (datetime) --
The time stamp when the attachment initiated.
AttachmentId (string) --
The ID of the network interface attachment.
DeleteOnTermination (boolean) --
Indicates whether the network interface is deleted when the instance is terminated.
DeviceIndex (integer) --
The index of the device on the instance for the network interface attachment.
Status (string) --
The attachment state.
Description (string) --
The description.
Groups (list) --
One or more security groups.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
Ipv6Addresses (list) --
One or more IPv6 addresses associated with the network interface.
(dict) --
Describes an IPv6 address.
Ipv6Address (string) --
The IPv6 address.
MacAddress (string) --
The MAC address.
NetworkInterfaceId (string) --
The ID of the network interface.
OwnerId (string) --
The ID of the AWS account that created the network interface.
PrivateDnsName (string) --
The private DNS name.
PrivateIpAddress (string) --
The IPv4 address of the network interface within the subnet.
PrivateIpAddresses (list) --
One or more private IPv4 addresses associated with the network interface.
(dict) --
Describes a private IPv4 address.
Association (dict) --
The association information for an Elastic IP address for the network interface.
IpOwnerId (string) --
The ID of the owner of the Elastic IP address.
PublicDnsName (string) --
The public DNS name.
PublicIp (string) --
The public IP address or Elastic IP address bound to the network interface.
Primary (boolean) --
Indicates whether this IPv4 address is the primary private IP address of the network interface.
PrivateDnsName (string) --
The private IPv4 DNS name.
PrivateIpAddress (string) --
The private IPv4 address of the network interface.
SourceDestCheck (boolean) --
Indicates whether to validate network traffic to or from this network interface.
Status (string) --
The status of the network interface.
SubnetId (string) --
The ID of the subnet.
VpcId (string) --
The ID of the VPC.
InterfaceType (string) --
Describes the type of network interface.
Valid values: interface | efa
RootDeviceName (string) --
The device name of the root device volume (for example, /dev/sda1 ).
RootDeviceType (string) --
The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
SecurityGroups (list) --
The security groups for the instance.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
SourceDestCheck (boolean) --
Specifies whether to enable an instance launched in a VPC to perform NAT. This controls whether source/destination checking is enabled on the instance. A value of true means that checking is enabled, and false means that checking is disabled. The value must be false for the instance to perform NAT. For more information, see NAT Instances in the Amazon Virtual Private Cloud User Guide .
SpotInstanceRequestId (string) --
If the request is a Spot Instance request, the ID of the request.
SriovNetSupport (string) --
Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
StateReason (dict) --
The reason for the most recent state transition.
Code (string) --
The reason code for the state change.
Message (string) --
The message for the state change.
Tags (list) --
Any tags assigned to the instance.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VirtualizationType (string) --
The virtualization type of the instance.
CpuOptions (dict) --
The CPU options for the instance.
CoreCount (integer) --
The number of CPU cores for the instance.
ThreadsPerCore (integer) --
The number of threads per CPU core.
CapacityReservationId (string) --
The ID of the Capacity Reservation.
CapacityReservationSpecification (dict) --
Information about the Capacity Reservation targeting option.
CapacityReservationPreference (string) --
Describes the instance's Capacity Reservation preferences. Possible preferences include:
CapacityReservationTarget (dict) --
Information about the targeted Capacity Reservation.
CapacityReservationId (string) --
The ID of the Capacity Reservation.
HibernationOptions (dict) --
Indicates whether the instance is enabled for hibernation.
Configured (boolean) --
If this parameter is set to true , your instance is enabled for hibernation; otherwise, it is not enabled for hibernation.
Licenses (list) --
The license configurations.
(dict) --
Describes a license configuration.
LicenseConfigurationArn (string) --
The Amazon Resource Name (ARN) of the license configuration.
OwnerId (string) --
The ID of the AWS account that owns the reservation.
RequesterId (string) --
The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling).
ReservationId (string) --
The ID of the reservation.
paginator = client.get_paginator('describe_internet_gateways')
Creates an iterator that will paginate through responses from EC2.Client.describe_internet_gateways().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
InternetGatewayIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more internet gateway IDs.
Default: Describes all your internet gateways.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'InternetGateways': [
{
'Attachments': [
{
'State': 'attaching'|'attached'|'detaching'|'detached',
'VpcId': 'string'
},
],
'InternetGatewayId': 'string',
'OwnerId': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
}
Response Structure
(dict) --
InternetGateways (list) --
Information about one or more internet gateways.
(dict) --
Describes an internet gateway.
Attachments (list) --
Any VPCs attached to the internet gateway.
(dict) --
Describes the attachment of a VPC to an internet gateway or an egress-only internet gateway.
State (string) --
The current state of the attachment. For an internet gateway, the state is available when attached to a VPC; otherwise, this value is not returned.
VpcId (string) --
The ID of the VPC.
InternetGatewayId (string) --
The ID of the internet gateway.
OwnerId (string) --
The ID of the AWS account that owns the internet gateway.
Tags (list) --
Any tags assigned to the internet gateway.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
paginator = client.get_paginator('describe_launch_template_versions')
Creates an iterator that will paginate through responses from EC2.Client.describe_launch_template_versions().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
LaunchTemplateId='string',
LaunchTemplateName='string',
Versions=[
'string',
],
MinVersion='string',
MaxVersion='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more versions of the launch template.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'LaunchTemplateVersions': [
{
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'VersionNumber': 123,
'VersionDescription': 'string',
'CreateTime': datetime(2015, 1, 1),
'CreatedBy': 'string',
'DefaultVersion': True|False,
'LaunchTemplateData': {
'KernelId': 'string',
'EbsOptimized': True|False,
'IamInstanceProfile': {
'Arn': 'string',
'Name': 'string'
},
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'Encrypted': True|False,
'DeleteOnTermination': True|False,
'Iops': 123,
'KmsKeyId': 'string',
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1'
},
'NoDevice': 'string'
},
],
'NetworkInterfaces': [
{
'AssociatePublicIpAddress': True|False,
'DeleteOnTermination': True|False,
'Description': 'string',
'DeviceIndex': 123,
'Groups': [
'string',
],
'InterfaceType': 'string',
'Ipv6AddressCount': 123,
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'NetworkInterfaceId': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
'SecondaryPrivateIpAddressCount': 123,
'SubnetId': 'string'
},
],
'ImageId': 'string',
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'KeyName': 'string',
'Monitoring': {
'Enabled': True|False
},
'Placement': {
'AvailabilityZone': 'string',
'Affinity': 'string',
'GroupName': 'string',
'HostId': 'string',
'Tenancy': 'default'|'dedicated'|'host',
'SpreadDomain': 'string'
},
'RamDiskId': 'string',
'DisableApiTermination': True|False,
'InstanceInitiatedShutdownBehavior': 'stop'|'terminate',
'UserData': 'string',
'TagSpecifications': [
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
'ElasticGpuSpecifications': [
{
'Type': 'string'
},
],
'ElasticInferenceAccelerators': [
{
'Type': 'string'
},
],
'SecurityGroupIds': [
'string',
],
'SecurityGroups': [
'string',
],
'InstanceMarketOptions': {
'MarketType': 'spot',
'SpotOptions': {
'MaxPrice': 'string',
'SpotInstanceType': 'one-time'|'persistent',
'BlockDurationMinutes': 123,
'ValidUntil': datetime(2015, 1, 1),
'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate'
}
},
'CreditSpecification': {
'CpuCredits': 'string'
},
'CpuOptions': {
'CoreCount': 123,
'ThreadsPerCore': 123
},
'CapacityReservationSpecification': {
'CapacityReservationPreference': 'open'|'none',
'CapacityReservationTarget': {
'CapacityReservationId': 'string'
}
},
'LicenseSpecifications': [
{
'LicenseConfigurationArn': 'string'
},
],
'HibernationOptions': {
'Configured': True|False
}
}
},
],
}
Response Structure
(dict) --
LaunchTemplateVersions (list) --
Information about the launch template versions.
(dict) --
Describes a launch template version.
LaunchTemplateId (string) --
The ID of the launch template.
LaunchTemplateName (string) --
The name of the launch template.
VersionNumber (integer) --
The version number.
VersionDescription (string) --
The description for the version.
CreateTime (datetime) --
The time the version was created.
CreatedBy (string) --
The principal that created the version.
DefaultVersion (boolean) --
Indicates whether the version is the default version.
LaunchTemplateData (dict) --
Information about the launch template.
KernelId (string) --
The ID of the kernel, if applicable.
EbsOptimized (boolean) --
Indicates whether the instance is optimized for Amazon EBS I/O.
IamInstanceProfile (dict) --
The IAM instance profile.
Arn (string) --
The Amazon Resource Name (ARN) of the instance profile.
Name (string) --
The name of the instance profile.
BlockDeviceMappings (list) --
The block device mappings.
(dict) --
Describes a block device mapping.
DeviceName (string) --
The device name.
VirtualName (string) --
The virtual device name (ephemeralN).
Ebs (dict) --
Information about the block device for an EBS volume.
Encrypted (boolean) --
Indicates whether the EBS volume is encrypted.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports.
KmsKeyId (string) --
The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption.
SnapshotId (string) --
The ID of the snapshot.
VolumeSize (integer) --
The size of the volume, in GiB.
VolumeType (string) --
The volume type.
NoDevice (string) --
Suppresses the specified device included in the block device mapping of the AMI.
NetworkInterfaces (list) --
The network interfaces.
(dict) --
Describes a network interface.
AssociatePublicIpAddress (boolean) --
Indicates whether to associate a public IPv4 address with eth0 for a new network interface.
DeleteOnTermination (boolean) --
Indicates whether the network interface is deleted when the instance is terminated.
Description (string) --
A description for the network interface.
DeviceIndex (integer) --
The device index for the network interface attachment.
Groups (list) --
The IDs of one or more security groups.
InterfaceType (string) --
The type of network interface.
Ipv6AddressCount (integer) --
The number of IPv6 addresses for the network interface.
Ipv6Addresses (list) --
The IPv6 addresses for the network interface.
(dict) --
Describes an IPv6 address.
Ipv6Address (string) --
The IPv6 address.
NetworkInterfaceId (string) --
The ID of the network interface.
PrivateIpAddress (string) --
The primary private IPv4 address of the network interface.
PrivateIpAddresses (list) --
One or more private IPv4 addresses.
(dict) --
Describes a secondary private IPv4 address for a network interface.
Primary (boolean) --
Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.
PrivateIpAddress (string) --
The private IPv4 addresses.
SecondaryPrivateIpAddressCount (integer) --
The number of secondary private IPv4 addresses for the network interface.
SubnetId (string) --
The ID of the subnet for the network interface.
ImageId (string) --
The ID of the AMI that was used to launch the instance.
InstanceType (string) --
The instance type.
KeyName (string) --
The name of the key pair.
Monitoring (dict) --
The monitoring for the instance.
Enabled (boolean) --
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
Placement (dict) --
The placement of the instance.
AvailabilityZone (string) --
The Availability Zone of the instance.
Affinity (string) --
The affinity setting for the instance on the Dedicated Host.
GroupName (string) --
The name of the placement group for the instance.
HostId (string) --
The ID of the Dedicated Host for the instance.
Tenancy (string) --
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware.
SpreadDomain (string) --
Reserved for future use.
RamDiskId (string) --
The ID of the RAM disk, if applicable.
DisableApiTermination (boolean) --
If set to true , indicates that the instance cannot be terminated using the Amazon EC2 console, command line tool, or API.
InstanceInitiatedShutdownBehavior (string) --
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
UserData (string) --
The user data for the instance.
TagSpecifications (list) --
The tags.
(dict) --
The tag specification for the launch template.
ResourceType (string) --
The type of resource.
Tags (list) --
The tags for the resource.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
ElasticGpuSpecifications (list) --
The elastic GPU specification.
(dict) --
Describes an elastic GPU.
Type (string) --
The elastic GPU type.
ElasticInferenceAccelerators (list) --
The elastic inference accelerator for the instance.
(dict) --
Describes an elastic inference accelerator.
Type (string) --
The type of elastic inference accelerator. The possible values are eia1.medium, eia1.large, and eia1.xlarge.
SecurityGroupIds (list) --
The security group IDs.
SecurityGroups (list) --
The security group names.
InstanceMarketOptions (dict) --
The market (purchasing) option for the instances.
MarketType (string) --
The market type.
SpotOptions (dict) --
The options for Spot Instances.
MaxPrice (string) --
The maximum hourly price you're willing to pay for the Spot Instances.
SpotInstanceType (string) --
The Spot Instance request type.
BlockDurationMinutes (integer) --
The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).
ValidUntil (datetime) --
The end date of the request. For a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached.
InstanceInterruptionBehavior (string) --
The behavior when a Spot Instance is interrupted.
CreditSpecification (dict) --
The credit option for CPU usage of the instance.
CpuCredits (string) --
The credit option for CPU usage of a T2 or T3 instance. Valid values are standard and unlimited .
CpuOptions (dict) --
The CPU options for the instance. For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide .
CoreCount (integer) --
The number of CPU cores for the instance.
ThreadsPerCore (integer) --
The number of threads per CPU core.
CapacityReservationSpecification (dict) --
Information about the Capacity Reservation targeting option.
CapacityReservationPreference (string) --
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
CapacityReservationTarget (dict) --
Information about the target Capacity Reservation.
CapacityReservationId (string) --
The ID of the Capacity Reservation.
LicenseSpecifications (list) --
The license configurations.
(dict) --
Describes a license configuration.
LicenseConfigurationArn (string) --
The Amazon Resource Name (ARN) of the license configuration.
HibernationOptions (dict) --
Indicates whether an instance is configured for hibernation. For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
Configured (boolean) --
If this parameter is set to true , the instance is enabled for hibernation; otherwise, it is not enabled for hibernation.
paginator = client.get_paginator('describe_launch_templates')
Creates an iterator that will paginate through responses from EC2.Client.describe_launch_templates().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
LaunchTemplateIds=[
'string',
],
LaunchTemplateNames=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more launch template IDs.
One or more launch template names.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'LaunchTemplates': [
{
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'CreateTime': datetime(2015, 1, 1),
'CreatedBy': 'string',
'DefaultVersionNumber': 123,
'LatestVersionNumber': 123,
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
}
Response Structure
(dict) --
LaunchTemplates (list) --
Information about the launch templates.
(dict) --
Describes a launch template.
LaunchTemplateId (string) --
The ID of the launch template.
LaunchTemplateName (string) --
The name of the launch template.
CreateTime (datetime) --
The time launch template was created.
CreatedBy (string) --
The principal that created the launch template.
DefaultVersionNumber (integer) --
The version number of the default version of the launch template.
LatestVersionNumber (integer) --
The version number of the latest version of the launch template.
Tags (list) --
The tags for the launch template.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
paginator = client.get_paginator('describe_moving_addresses')
Creates an iterator that will paginate through responses from EC2.Client.describe_moving_addresses().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
PublicIps=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more Elastic IP addresses.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'MovingAddressStatuses': [
{
'MoveStatus': 'movingToVpc'|'restoringToClassic',
'PublicIp': 'string'
},
],
}
Response Structure
(dict) --
MovingAddressStatuses (list) --
The status for each Elastic IP address.
(dict) --
Describes the status of a moving Elastic IP address.
MoveStatus (string) --
The status of the Elastic IP address that's being moved to the EC2-VPC platform, or restored to the EC2-Classic platform.
PublicIp (string) --
The Elastic IP address.
paginator = client.get_paginator('describe_nat_gateways')
Creates an iterator that will paginate through responses from EC2.Client.describe_nat_gateways().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
NatGatewayIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more NAT gateway IDs.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'NatGateways': [
{
'CreateTime': datetime(2015, 1, 1),
'DeleteTime': datetime(2015, 1, 1),
'FailureCode': 'string',
'FailureMessage': 'string',
'NatGatewayAddresses': [
{
'AllocationId': 'string',
'NetworkInterfaceId': 'string',
'PrivateIp': 'string',
'PublicIp': 'string'
},
],
'NatGatewayId': 'string',
'ProvisionedBandwidth': {
'ProvisionTime': datetime(2015, 1, 1),
'Provisioned': 'string',
'RequestTime': datetime(2015, 1, 1),
'Requested': 'string',
'Status': 'string'
},
'State': 'pending'|'failed'|'available'|'deleting'|'deleted',
'SubnetId': 'string',
'VpcId': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
}
Response Structure
(dict) --
NatGateways (list) --
Information about the NAT gateways.
(dict) --
Describes a NAT gateway.
CreateTime (datetime) --
The date and time the NAT gateway was created.
DeleteTime (datetime) --
The date and time the NAT gateway was deleted, if applicable.
FailureCode (string) --
If the NAT gateway could not be created, specifies the error code for the failure. (InsufficientFreeAddressesInSubnet | Gateway.NotAttached | InvalidAllocationID.NotFound | Resource.AlreadyAssociated | InternalError | InvalidSubnetID.NotFound )
FailureMessage (string) --
If the NAT gateway could not be created, specifies the error message for the failure, that corresponds to the error code.
NatGatewayAddresses (list) --
Information about the IP addresses and network interface associated with the NAT gateway.
(dict) --
Describes the IP addresses and network interface associated with a NAT gateway.
AllocationId (string) --
The allocation ID of the Elastic IP address that's associated with the NAT gateway.
NetworkInterfaceId (string) --
The ID of the network interface associated with the NAT gateway.
PrivateIp (string) --
The private IP address associated with the Elastic IP address.
PublicIp (string) --
The Elastic IP address associated with the NAT gateway.
NatGatewayId (string) --
The ID of the NAT gateway.
ProvisionedBandwidth (dict) --
Reserved. If you need to sustain traffic greater than the documented limits , contact us through the Support Center .
ProvisionTime (datetime) --
Reserved. If you need to sustain traffic greater than the documented limits , contact us through the Support Center .
Provisioned (string) --
Reserved. If you need to sustain traffic greater than the documented limits , contact us through the Support Center .
RequestTime (datetime) --
Reserved. If you need to sustain traffic greater than the documented limits , contact us through the Support Center .
Requested (string) --
Reserved. If you need to sustain traffic greater than the documented limits , contact us through the Support Center .
Status (string) --
Reserved. If you need to sustain traffic greater than the documented limits , contact us through the Support Center .
State (string) --
The state of the NAT gateway.
SubnetId (string) --
The ID of the subnet in which the NAT gateway is located.
VpcId (string) --
The ID of the VPC in which the NAT gateway is located.
Tags (list) --
The tags for the NAT gateway.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
paginator = client.get_paginator('describe_network_acls')
Creates an iterator that will paginate through responses from EC2.Client.describe_network_acls().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
NetworkAclIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more network ACL IDs.
Default: Describes all your network ACLs.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'NetworkAcls': [
{
'Associations': [
{
'NetworkAclAssociationId': 'string',
'NetworkAclId': 'string',
'SubnetId': 'string'
},
],
'Entries': [
{
'CidrBlock': 'string',
'Egress': True|False,
'IcmpTypeCode': {
'Code': 123,
'Type': 123
},
'Ipv6CidrBlock': 'string',
'PortRange': {
'From': 123,
'To': 123
},
'Protocol': 'string',
'RuleAction': 'allow'|'deny',
'RuleNumber': 123
},
],
'IsDefault': True|False,
'NetworkAclId': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VpcId': 'string',
'OwnerId': 'string'
},
],
}
Response Structure
(dict) --
NetworkAcls (list) --
Information about one or more network ACLs.
(dict) --
Describes a network ACL.
Associations (list) --
Any associations between the network ACL and one or more subnets
(dict) --
Describes an association between a network ACL and a subnet.
NetworkAclAssociationId (string) --
The ID of the association between a network ACL and a subnet.
NetworkAclId (string) --
The ID of the network ACL.
SubnetId (string) --
The ID of the subnet.
Entries (list) --
One or more entries (rules) in the network ACL.
(dict) --
Describes an entry in a network ACL.
CidrBlock (string) --
The IPv4 network range to allow or deny, in CIDR notation.
Egress (boolean) --
Indicates whether the rule is an egress rule (applied to traffic leaving the subnet).
IcmpTypeCode (dict) --
ICMP protocol: The ICMP type and code.
Code (integer) --
The ICMP code. A value of -1 means all codes for the specified ICMP type.
Type (integer) --
The ICMP type. A value of -1 means all types.
Ipv6CidrBlock (string) --
The IPv6 network range to allow or deny, in CIDR notation.
PortRange (dict) --
TCP or UDP protocols: The range of ports the rule applies to.
From (integer) --
The first port in the range.
To (integer) --
The last port in the range.
Protocol (string) --
The protocol number. A value of "-1" means all protocols.
RuleAction (string) --
Indicates whether to allow or deny the traffic that matches the rule.
RuleNumber (integer) --
The rule number for the entry. ACL entries are processed in ascending order by rule number.
IsDefault (boolean) --
Indicates whether this is the default network ACL for the VPC.
NetworkAclId (string) --
The ID of the network ACL.
Tags (list) --
Any tags assigned to the network ACL.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VpcId (string) --
The ID of the VPC for the network ACL.
OwnerId (string) --
The ID of the AWS account that owns the network ACL.
paginator = client.get_paginator('describe_network_interface_permissions')
Creates an iterator that will paginate through responses from EC2.Client.describe_network_interface_permissions().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
NetworkInterfacePermissionIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more network interface permission IDs.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'NetworkInterfacePermissions': [
{
'NetworkInterfacePermissionId': 'string',
'NetworkInterfaceId': 'string',
'AwsAccountId': 'string',
'AwsService': 'string',
'Permission': 'INSTANCE-ATTACH'|'EIP-ASSOCIATE',
'PermissionState': {
'State': 'pending'|'granted'|'revoking'|'revoked',
'StatusMessage': 'string'
}
},
],
}
Response Structure
(dict) --
Contains the output for DescribeNetworkInterfacePermissions.
NetworkInterfacePermissions (list) --
The network interface permissions.
(dict) --
Describes a permission for a network interface.
NetworkInterfacePermissionId (string) --
The ID of the network interface permission.
NetworkInterfaceId (string) --
The ID of the network interface.
AwsAccountId (string) --
The AWS account ID.
AwsService (string) --
The AWS service.
Permission (string) --
The type of permission.
PermissionState (dict) --
Information about the state of the permission.
State (string) --
The state of the permission.
StatusMessage (string) --
A status message, if applicable.
paginator = client.get_paginator('describe_network_interfaces')
Creates an iterator that will paginate through responses from EC2.Client.describe_network_interfaces().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
NetworkInterfaceIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more network interface IDs.
Default: Describes all your network interfaces.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'NetworkInterfaces': [
{
'Association': {
'AllocationId': 'string',
'AssociationId': 'string',
'IpOwnerId': 'string',
'PublicDnsName': 'string',
'PublicIp': 'string'
},
'Attachment': {
'AttachTime': datetime(2015, 1, 1),
'AttachmentId': 'string',
'DeleteOnTermination': True|False,
'DeviceIndex': 123,
'InstanceId': 'string',
'InstanceOwnerId': 'string',
'Status': 'attaching'|'attached'|'detaching'|'detached'
},
'AvailabilityZone': 'string',
'Description': 'string',
'Groups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'InterfaceType': 'interface'|'natGateway'|'efa',
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'MacAddress': 'string',
'NetworkInterfaceId': 'string',
'OwnerId': 'string',
'PrivateDnsName': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Association': {
'AllocationId': 'string',
'AssociationId': 'string',
'IpOwnerId': 'string',
'PublicDnsName': 'string',
'PublicIp': 'string'
},
'Primary': True|False,
'PrivateDnsName': 'string',
'PrivateIpAddress': 'string'
},
],
'RequesterId': 'string',
'RequesterManaged': True|False,
'SourceDestCheck': True|False,
'Status': 'available'|'associated'|'attaching'|'in-use'|'detaching',
'SubnetId': 'string',
'TagSet': [
{
'Key': 'string',
'Value': 'string'
},
],
'VpcId': 'string'
},
],
}
Response Structure
(dict) --
Contains the output of DescribeNetworkInterfaces.
NetworkInterfaces (list) --
Information about one or more network interfaces.
(dict) --
Describes a network interface.
Association (dict) --
The association information for an Elastic IP address (IPv4) associated with the network interface.
AllocationId (string) --
The allocation ID.
AssociationId (string) --
The association ID.
IpOwnerId (string) --
The ID of the Elastic IP address owner.
PublicDnsName (string) --
The public DNS name.
PublicIp (string) --
The address of the Elastic IP address bound to the network interface.
Attachment (dict) --
The network interface attachment.
AttachTime (datetime) --
The timestamp indicating when the attachment initiated.
AttachmentId (string) --
The ID of the network interface attachment.
DeleteOnTermination (boolean) --
Indicates whether the network interface is deleted when the instance is terminated.
DeviceIndex (integer) --
The device index of the network interface attachment on the instance.
InstanceId (string) --
The ID of the instance.
InstanceOwnerId (string) --
The AWS account ID of the owner of the instance.
Status (string) --
The attachment state.
AvailabilityZone (string) --
The Availability Zone.
Description (string) --
A description.
Groups (list) --
Any security groups for the network interface.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
InterfaceType (string) --
The type of network interface.
Ipv6Addresses (list) --
The IPv6 addresses associated with the network interface.
(dict) --
Describes an IPv6 address associated with a network interface.
Ipv6Address (string) --
The IPv6 address.
MacAddress (string) --
The MAC address.
NetworkInterfaceId (string) --
The ID of the network interface.
OwnerId (string) --
The AWS account ID of the owner of the network interface.
PrivateDnsName (string) --
The private DNS name.
PrivateIpAddress (string) --
The IPv4 address of the network interface within the subnet.
PrivateIpAddresses (list) --
The private IPv4 addresses associated with the network interface.
(dict) --
Describes the private IPv4 address of a network interface.
Association (dict) --
The association information for an Elastic IP address (IPv4) associated with the network interface.
AllocationId (string) --
The allocation ID.
AssociationId (string) --
The association ID.
IpOwnerId (string) --
The ID of the Elastic IP address owner.
PublicDnsName (string) --
The public DNS name.
PublicIp (string) --
The address of the Elastic IP address bound to the network interface.
Primary (boolean) --
Indicates whether this IPv4 address is the primary private IPv4 address of the network interface.
PrivateDnsName (string) --
The private DNS name.
PrivateIpAddress (string) --
The private IPv4 address.
RequesterId (string) --
The ID of the entity that launched the instance on your behalf (for example, AWS Management Console or Auto Scaling).
RequesterManaged (boolean) --
Indicates whether the network interface is being managed by AWS.
SourceDestCheck (boolean) --
Indicates whether traffic to or from the instance is validated.
Status (string) --
The status of the network interface.
SubnetId (string) --
The ID of the subnet.
TagSet (list) --
Any tags assigned to the network interface.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VpcId (string) --
The ID of the VPC.
paginator = client.get_paginator('describe_prefix_lists')
Creates an iterator that will paginate through responses from EC2.Client.describe_prefix_lists().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PrefixListIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more prefix list IDs.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'PrefixLists': [
{
'Cidrs': [
'string',
],
'PrefixListId': 'string',
'PrefixListName': 'string'
},
]
}
Response Structure
(dict) --
PrefixLists (list) --
All available prefix lists.
(dict) --
Describes prefixes for AWS services.
Cidrs (list) --
The IP address range of the AWS service.
PrefixListId (string) --
The ID of the prefix.
PrefixListName (string) --
The name of the prefix.
paginator = client.get_paginator('describe_principal_id_format')
Creates an iterator that will paginate through responses from EC2.Client.describe_principal_id_format().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
Resources=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The type of resource: bundle | conversion-task | customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association | export-task | flow-log | image | import-task | instance | internet-gateway | network-acl | network-acl-association | network-interface | network-interface-attachment | prefix-list | reservation | route-table | route-table-association | security-group | snapshot | subnet | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Principals': [
{
'Arn': 'string',
'Statuses': [
{
'Deadline': datetime(2015, 1, 1),
'Resource': 'string',
'UseLongIds': True|False
},
]
},
],
}
Response Structure
(dict) --
Principals (list) --
Information about the ID format settings for the ARN.
(dict) --
PrincipalIdFormat description
Arn (string) --
PrincipalIdFormatARN description
Statuses (list) --
PrincipalIdFormatStatuses description
(dict) --
Describes the ID format for a resource.
Deadline (datetime) --
The date in UTC at which you are permanently switched over to using longer IDs. If a deadline is not yet available for this resource type, this field is not returned.
Resource (string) --
The type of resource.
UseLongIds (boolean) --
Indicates whether longer IDs (17-character IDs) are enabled for the resource.
paginator = client.get_paginator('describe_public_ipv4_pools')
Creates an iterator that will paginate through responses from EC2.Client.describe_public_ipv4_pools().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PoolIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The IDs of the address pools.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'PublicIpv4Pools': [
{
'PoolId': 'string',
'Description': 'string',
'PoolAddressRanges': [
{
'FirstAddress': 'string',
'LastAddress': 'string',
'AddressCount': 123,
'AvailableAddressCount': 123
},
],
'TotalAddressCount': 123,
'TotalAvailableAddressCount': 123
},
],
}
Response Structure
(dict) --
PublicIpv4Pools (list) --
Information about the address pools.
(dict) --
Describes an address pool.
PoolId (string) --
The ID of the IPv4 address pool.
Description (string) --
A description of the address pool.
PoolAddressRanges (list) --
The address ranges.
(dict) --
Describes an address range of an IPv4 address pool.
FirstAddress (string) --
The first IP address in the range.
LastAddress (string) --
The last IP address in the range.
AddressCount (integer) --
The number of addresses in the range.
AvailableAddressCount (integer) --
The number of available addresses in the range.
TotalAddressCount (integer) --
The total number of addresses.
TotalAvailableAddressCount (integer) --
The total number of available addresses.
paginator = client.get_paginator('describe_reserved_instances_modifications')
Creates an iterator that will paginate through responses from EC2.Client.describe_reserved_instances_modifications().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
ReservedInstancesModificationIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'StartingToken': 'string'
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
IDs for the submitted modification request.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'ReservedInstancesModifications': [
{
'ClientToken': 'string',
'CreateDate': datetime(2015, 1, 1),
'EffectiveDate': datetime(2015, 1, 1),
'ModificationResults': [
{
'ReservedInstancesId': 'string',
'TargetConfiguration': {
'AvailabilityZone': 'string',
'InstanceCount': 123,
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'Platform': 'string',
'Scope': 'Availability Zone'|'Region'
}
},
],
'ReservedInstancesIds': [
{
'ReservedInstancesId': 'string'
},
],
'ReservedInstancesModificationId': 'string',
'Status': 'string',
'StatusMessage': 'string',
'UpdateDate': datetime(2015, 1, 1)
},
]
}
Response Structure
(dict) --
Contains the output of DescribeReservedInstancesModifications.
ReservedInstancesModifications (list) --
The Reserved Instance modification information.
(dict) --
Describes a Reserved Instance modification.
ClientToken (string) --
A unique, case-sensitive key supplied by the client to ensure that the request is idempotent. For more information, see Ensuring Idempotency .
CreateDate (datetime) --
The time when the modification request was created.
EffectiveDate (datetime) --
The time for the modification to become effective.
ModificationResults (list) --
Contains target configurations along with their corresponding new Reserved Instance IDs.
(dict) --
Describes the modification request/s.
ReservedInstancesId (string) --
The ID for the Reserved Instances that were created as part of the modification request. This field is only available when the modification is fulfilled.
TargetConfiguration (dict) --
The target Reserved Instances configurations supplied as part of the modification request.
AvailabilityZone (string) --
The Availability Zone for the modified Reserved Instances.
InstanceCount (integer) --
The number of modified Reserved Instances.
Note
This is a required field for a request.
InstanceType (string) --
The instance type for the modified Reserved Instances.
Platform (string) --
The network platform of the modified Reserved Instances, which is either EC2-Classic or EC2-VPC.
Scope (string) --
Whether the Reserved Instance is applied to instances in a Region or instances in a specific Availability Zone.
ReservedInstancesIds (list) --
The IDs of one or more Reserved Instances.
(dict) --
Describes the ID of a Reserved Instance.
ReservedInstancesId (string) --
The ID of the Reserved Instance.
ReservedInstancesModificationId (string) --
A unique ID for the Reserved Instance modification.
Status (string) --
The status of the Reserved Instances modification request.
StatusMessage (string) --
The reason for the status.
UpdateDate (datetime) --
The time when the modification request was last updated.
paginator = client.get_paginator('describe_reserved_instances_offerings')
Creates an iterator that will paginate through responses from EC2.Client.describe_reserved_instances_offerings().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
AvailabilityZone='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
IncludeMarketplace=True|False,
InstanceType='t1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
MaxDuration=123,
MaxInstanceCount=123,
MinDuration=123,
OfferingClass='standard'|'convertible',
ProductDescription='Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
ReservedInstancesOfferingIds=[
'string',
],
DryRun=True|False,
InstanceTenancy='default'|'dedicated'|'host',
OfferingType='Heavy Utilization'|'Medium Utilization'|'Light Utilization'|'No Upfront'|'Partial Upfront'|'All Upfront',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The maximum duration (in seconds) to filter when searching for offerings.
Default: 94608000 (3 years)
The maximum number of instances to filter when searching for offerings.
Default: 20
The minimum duration (in seconds) to filter when searching for offerings.
Default: 2592000 (1 month)
One or more Reserved Instances offering IDs.
The tenancy of the instances covered by the reservation. A Reserved Instance with a tenancy of dedicated is applied to instances that run in a VPC on single-tenant hardware (i.e., Dedicated Instances).
Important: The host value cannot be used with this parameter. Use the default or dedicated values only.
Default: default
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'ReservedInstancesOfferings': [
{
'AvailabilityZone': 'string',
'Duration': 123,
'FixedPrice': ...,
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
'ReservedInstancesOfferingId': 'string',
'UsagePrice': ...,
'CurrencyCode': 'USD',
'InstanceTenancy': 'default'|'dedicated'|'host',
'Marketplace': True|False,
'OfferingClass': 'standard'|'convertible',
'OfferingType': 'Heavy Utilization'|'Medium Utilization'|'Light Utilization'|'No Upfront'|'Partial Upfront'|'All Upfront',
'PricingDetails': [
{
'Count': 123,
'Price': 123.0
},
],
'RecurringCharges': [
{
'Amount': 123.0,
'Frequency': 'Hourly'
},
],
'Scope': 'Availability Zone'|'Region'
},
],
}
Response Structure
(dict) --
Contains the output of DescribeReservedInstancesOfferings.
ReservedInstancesOfferings (list) --
A list of Reserved Instances offerings.
(dict) --
Describes a Reserved Instance offering.
AvailabilityZone (string) --
The Availability Zone in which the Reserved Instance can be used.
Duration (integer) --
The duration of the Reserved Instance, in seconds.
FixedPrice (float) --
The purchase price of the Reserved Instance.
InstanceType (string) --
The instance type on which the Reserved Instance can be used.
ProductDescription (string) --
The Reserved Instance product platform description.
ReservedInstancesOfferingId (string) --
The ID of the Reserved Instance offering. This is the offering ID used in GetReservedInstancesExchangeQuote to confirm that an exchange can be made.
UsagePrice (float) --
The usage price of the Reserved Instance, per hour.
CurrencyCode (string) --
The currency of the Reserved Instance offering you are purchasing. It's specified using ISO 4217 standard currency codes. At this time, the only supported currency is USD .
InstanceTenancy (string) --
The tenancy of the instance.
Marketplace (boolean) --
Indicates whether the offering is available through the Reserved Instance Marketplace (resale) or AWS. If it's a Reserved Instance Marketplace offering, this is true .
OfferingClass (string) --
If convertible it can be exchanged for Reserved Instances of the same or higher monetary value, with different configurations. If standard , it is not possible to perform an exchange.
OfferingType (string) --
The Reserved Instance offering type.
PricingDetails (list) --
The pricing details of the Reserved Instance offering.
(dict) --
Describes a Reserved Instance offering.
Count (integer) --
The number of reservations available for the price.
Price (float) --
The price per instance.
RecurringCharges (list) --
The recurring charge tag assigned to the resource.
(dict) --
Describes a recurring charge.
Amount (float) --
The amount of the recurring charge.
Frequency (string) --
The frequency of the recurring charge.
Scope (string) --
Whether the Reserved Instance is applied to instances in a Region or an Availability Zone.
paginator = client.get_paginator('describe_route_tables')
Creates an iterator that will paginate through responses from EC2.Client.describe_route_tables().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
RouteTableIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more route table IDs.
Default: Describes all your route tables.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'RouteTables': [
{
'Associations': [
{
'Main': True|False,
'RouteTableAssociationId': 'string',
'RouteTableId': 'string',
'SubnetId': 'string'
},
],
'PropagatingVgws': [
{
'GatewayId': 'string'
},
],
'RouteTableId': 'string',
'Routes': [
{
'DestinationCidrBlock': 'string',
'DestinationIpv6CidrBlock': 'string',
'DestinationPrefixListId': 'string',
'EgressOnlyInternetGatewayId': 'string',
'GatewayId': 'string',
'InstanceId': 'string',
'InstanceOwnerId': 'string',
'NatGatewayId': 'string',
'TransitGatewayId': 'string',
'NetworkInterfaceId': 'string',
'Origin': 'CreateRouteTable'|'CreateRoute'|'EnableVgwRoutePropagation',
'State': 'active'|'blackhole',
'VpcPeeringConnectionId': 'string'
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VpcId': 'string',
'OwnerId': 'string'
},
],
}
Response Structure
(dict) --
Contains the output of DescribeRouteTables.
RouteTables (list) --
Information about one or more route tables.
(dict) --
Describes a route table.
Associations (list) --
The associations between the route table and one or more subnets.
(dict) --
Describes an association between a route table and a subnet.
Main (boolean) --
Indicates whether this is the main route table.
RouteTableAssociationId (string) --
The ID of the association between a route table and a subnet.
RouteTableId (string) --
The ID of the route table.
SubnetId (string) --
The ID of the subnet. A subnet ID is not returned for an implicit association.
PropagatingVgws (list) --
Any virtual private gateway (VGW) propagating routes.
(dict) --
Describes a virtual private gateway propagating route.
GatewayId (string) --
The ID of the virtual private gateway.
RouteTableId (string) --
The ID of the route table.
Routes (list) --
The routes in the route table.
(dict) --
Describes a route in a route table.
DestinationCidrBlock (string) --
The IPv4 CIDR block used for the destination match.
DestinationIpv6CidrBlock (string) --
The IPv6 CIDR block used for the destination match.
DestinationPrefixListId (string) --
The prefix of the AWS service.
EgressOnlyInternetGatewayId (string) --
The ID of the egress-only internet gateway.
GatewayId (string) --
The ID of a gateway attached to your VPC.
InstanceId (string) --
The ID of a NAT instance in your VPC.
InstanceOwnerId (string) --
The AWS account ID of the owner of the instance.
NatGatewayId (string) --
The ID of a NAT gateway.
TransitGatewayId (string) --
The ID of a transit gateway.
NetworkInterfaceId (string) --
The ID of the network interface.
Origin (string) --
Describes how the route was created.
State (string) --
The state of the route. The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, or the specified NAT instance has been terminated).
VpcPeeringConnectionId (string) --
The ID of a VPC peering connection.
Tags (list) --
Any tags assigned to the route table.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VpcId (string) --
The ID of the VPC.
OwnerId (string) --
The ID of the AWS account that owns the route table.
paginator = client.get_paginator('describe_scheduled_instance_availability')
Creates an iterator that will paginate through responses from EC2.Client.describe_scheduled_instance_availability().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
FirstSlotStartTimeRange={
'EarliestTime': datetime(2015, 1, 1),
'LatestTime': datetime(2015, 1, 1)
},
MaxSlotDurationInHours=123,
MinSlotDurationInHours=123,
Recurrence={
'Frequency': 'string',
'Interval': 123,
'OccurrenceDays': [
123,
],
'OccurrenceRelativeToEnd': True|False,
'OccurrenceUnit': 'string'
},
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
[REQUIRED]
The time period for the first schedule to start.
The earliest date and time, in UTC, for the Scheduled Instance to start.
The latest date and time, in UTC, for the Scheduled Instance to start. This value must be later than or equal to the earliest date and at most three months in the future.
[REQUIRED]
The schedule recurrence.
The frequency (Daily , Weekly , or Monthly ).
The interval quantity. The interval unit depends on the value of Frequency . For example, every 2 weeks or every 2 months.
The days. For a monthly schedule, this is one or more days of the month (1-31). For a weekly schedule, this is one or more days of the week (1-7, where 1 is Sunday). You can't specify this value with a daily schedule. If the occurrence is relative to the end of the month, you can specify only a single day.
Indicates whether the occurrence is relative to the end of the specified week or month. You can't specify this value with a daily schedule.
The unit for OccurrenceDays (DayOfWeek or DayOfMonth ). This value is required for a monthly schedule. You can't specify DayOfWeek with a weekly schedule. You can't specify this value with a daily schedule.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'ScheduledInstanceAvailabilitySet': [
{
'AvailabilityZone': 'string',
'AvailableInstanceCount': 123,
'FirstSlotStartTime': datetime(2015, 1, 1),
'HourlyPrice': 'string',
'InstanceType': 'string',
'MaxTermDurationInDays': 123,
'MinTermDurationInDays': 123,
'NetworkPlatform': 'string',
'Platform': 'string',
'PurchaseToken': 'string',
'Recurrence': {
'Frequency': 'string',
'Interval': 123,
'OccurrenceDaySet': [
123,
],
'OccurrenceRelativeToEnd': True|False,
'OccurrenceUnit': 'string'
},
'SlotDurationInHours': 123,
'TotalScheduledInstanceHours': 123
},
]
}
Response Structure
(dict) --
Contains the output of DescribeScheduledInstanceAvailability.
ScheduledInstanceAvailabilitySet (list) --
Information about the available Scheduled Instances.
(dict) --
Describes a schedule that is available for your Scheduled Instances.
AvailabilityZone (string) --
The Availability Zone.
AvailableInstanceCount (integer) --
The number of available instances.
FirstSlotStartTime (datetime) --
The time period for the first schedule to start.
HourlyPrice (string) --
The hourly price for a single instance.
InstanceType (string) --
The instance type. You can specify one of the C3, C4, M4, or R3 instance types.
MaxTermDurationInDays (integer) --
The maximum term. The only possible value is 365 days.
MinTermDurationInDays (integer) --
The minimum term. The only possible value is 365 days.
NetworkPlatform (string) --
The network platform (EC2-Classic or EC2-VPC ).
Platform (string) --
The platform (Linux/UNIX or Windows ).
PurchaseToken (string) --
The purchase token. This token expires in two hours.
Recurrence (dict) --
The schedule recurrence.
Frequency (string) --
The frequency (Daily , Weekly , or Monthly ).
Interval (integer) --
The interval quantity. The interval unit depends on the value of frequency . For example, every 2 weeks or every 2 months.
OccurrenceDaySet (list) --
The days. For a monthly schedule, this is one or more days of the month (1-31). For a weekly schedule, this is one or more days of the week (1-7, where 1 is Sunday).
OccurrenceRelativeToEnd (boolean) --
Indicates whether the occurrence is relative to the end of the specified week or month.
OccurrenceUnit (string) --
The unit for occurrenceDaySet (DayOfWeek or DayOfMonth ).
SlotDurationInHours (integer) --
The number of hours in the schedule.
TotalScheduledInstanceHours (integer) --
The total number of hours for a single instance for the entire term.
paginator = client.get_paginator('describe_scheduled_instances')
Creates an iterator that will paginate through responses from EC2.Client.describe_scheduled_instances().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
ScheduledInstanceIds=[
'string',
],
SlotStartTimeRange={
'EarliestTime': datetime(2015, 1, 1),
'LatestTime': datetime(2015, 1, 1)
},
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The Scheduled Instance IDs.
The time period for the first schedule to start.
The earliest date and time, in UTC, for the Scheduled Instance to start.
The latest date and time, in UTC, for the Scheduled Instance to start.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'ScheduledInstanceSet': [
{
'AvailabilityZone': 'string',
'CreateDate': datetime(2015, 1, 1),
'HourlyPrice': 'string',
'InstanceCount': 123,
'InstanceType': 'string',
'NetworkPlatform': 'string',
'NextSlotStartTime': datetime(2015, 1, 1),
'Platform': 'string',
'PreviousSlotEndTime': datetime(2015, 1, 1),
'Recurrence': {
'Frequency': 'string',
'Interval': 123,
'OccurrenceDaySet': [
123,
],
'OccurrenceRelativeToEnd': True|False,
'OccurrenceUnit': 'string'
},
'ScheduledInstanceId': 'string',
'SlotDurationInHours': 123,
'TermEndDate': datetime(2015, 1, 1),
'TermStartDate': datetime(2015, 1, 1),
'TotalScheduledInstanceHours': 123
},
]
}
Response Structure
(dict) --
Contains the output of DescribeScheduledInstances.
ScheduledInstanceSet (list) --
Information about the Scheduled Instances.
(dict) --
Describes a Scheduled Instance.
AvailabilityZone (string) --
The Availability Zone.
CreateDate (datetime) --
The date when the Scheduled Instance was purchased.
HourlyPrice (string) --
The hourly price for a single instance.
InstanceCount (integer) --
The number of instances.
InstanceType (string) --
The instance type.
NetworkPlatform (string) --
The network platform (EC2-Classic or EC2-VPC ).
NextSlotStartTime (datetime) --
The time for the next schedule to start.
Platform (string) --
The platform (Linux/UNIX or Windows ).
PreviousSlotEndTime (datetime) --
The time that the previous schedule ended or will end.
Recurrence (dict) --
The schedule recurrence.
Frequency (string) --
The frequency (Daily , Weekly , or Monthly ).
Interval (integer) --
The interval quantity. The interval unit depends on the value of frequency . For example, every 2 weeks or every 2 months.
OccurrenceDaySet (list) --
The days. For a monthly schedule, this is one or more days of the month (1-31). For a weekly schedule, this is one or more days of the week (1-7, where 1 is Sunday).
OccurrenceRelativeToEnd (boolean) --
Indicates whether the occurrence is relative to the end of the specified week or month.
OccurrenceUnit (string) --
The unit for occurrenceDaySet (DayOfWeek or DayOfMonth ).
ScheduledInstanceId (string) --
The Scheduled Instance ID.
SlotDurationInHours (integer) --
The number of hours in the schedule.
TermEndDate (datetime) --
The end date for the Scheduled Instance.
TermStartDate (datetime) --
The start date for the Scheduled Instance.
TotalScheduledInstanceHours (integer) --
The total number of hours for a single instance for the entire term.
paginator = client.get_paginator('describe_security_groups')
Creates an iterator that will paginate through responses from EC2.Client.describe_security_groups().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
GroupIds=[
'string',
],
GroupNames=[
'string',
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The filters. If using multiple filters for rules, the results include security groups for which any combination of rules - not necessarily a single rule - match all filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The IDs of the security groups. Required for security groups in a nondefault VPC.
Default: Describes all your security groups.
[EC2-Classic and default VPC only] The names of the security groups. You can specify either the security group name or the security group ID. For security groups in a nondefault VPC, use the group-name filter to describe security groups by name.
Default: Describes all your security groups.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'SecurityGroups': [
{
'Description': 'string',
'GroupName': 'string',
'IpPermissions': [
{
'FromPort': 123,
'IpProtocol': 'string',
'IpRanges': [
{
'CidrIp': 'string',
'Description': 'string'
},
],
'Ipv6Ranges': [
{
'CidrIpv6': 'string',
'Description': 'string'
},
],
'PrefixListIds': [
{
'Description': 'string',
'PrefixListId': 'string'
},
],
'ToPort': 123,
'UserIdGroupPairs': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'PeeringStatus': 'string',
'UserId': 'string',
'VpcId': 'string',
'VpcPeeringConnectionId': 'string'
},
]
},
],
'OwnerId': 'string',
'GroupId': 'string',
'IpPermissionsEgress': [
{
'FromPort': 123,
'IpProtocol': 'string',
'IpRanges': [
{
'CidrIp': 'string',
'Description': 'string'
},
],
'Ipv6Ranges': [
{
'CidrIpv6': 'string',
'Description': 'string'
},
],
'PrefixListIds': [
{
'Description': 'string',
'PrefixListId': 'string'
},
],
'ToPort': 123,
'UserIdGroupPairs': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'PeeringStatus': 'string',
'UserId': 'string',
'VpcId': 'string',
'VpcPeeringConnectionId': 'string'
},
]
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VpcId': 'string'
},
],
}
Response Structure
(dict) --
SecurityGroups (list) --
Information about the security groups.
(dict) --
Describes a security group
Description (string) --
A description of the security group.
GroupName (string) --
The name of the security group.
IpPermissions (list) --
The inbound rules associated with the security group.
(dict) --
Describes a set of permissions for a security group rule.
FromPort (integer) --
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
IpProtocol (string) --
The IP protocol name (tcp , udp , icmp , icmpv6 ) or number (see Protocol Numbers ).
[VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp , udp , icmp , or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp , udp , and icmp , you must specify a port range. For icmpv6 , the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
IpRanges (list) --
The IPv4 ranges.
(dict) --
Describes an IPv4 range.
CidrIp (string) --
The IPv4 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv4 address, use the /32 prefix length.
Description (string) --
A description for the security group rule that references this IPv4 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
Ipv6Ranges (list) --
[VPC only] The IPv6 ranges.
(dict) --
[EC2-VPC only] Describes an IPv6 range.
CidrIpv6 (string) --
The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv6 address, use the /128 prefix length.
Description (string) --
A description for the security group rule that references this IPv6 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
PrefixListIds (list) --
[VPC only] The prefix list IDs for an AWS service. With outbound rules, this is the AWS service to access through a VPC endpoint from instances associated with the security group.
(dict) --
Describes a prefix list ID.
Description (string) --
A description for the security group rule that references this prefix list ID.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
PrefixListId (string) --
The ID of the prefix.
ToPort (integer) --
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
UserIdGroupPairs (list) --
The security group and AWS account ID pairs.
(dict) --
Describes a security group and AWS account ID pair.
Description (string) --
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
GroupId (string) --
The ID of the security group.
GroupName (string) --
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
PeeringStatus (string) --
The status of a VPC peering connection, if applicable.
UserId (string) --
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
VpcId (string) --
The ID of the VPC for the referenced security group, if applicable.
VpcPeeringConnectionId (string) --
The ID of the VPC peering connection, if applicable.
OwnerId (string) --
The AWS account ID of the owner of the security group.
GroupId (string) --
The ID of the security group.
IpPermissionsEgress (list) --
[VPC only] The outbound rules associated with the security group.
(dict) --
Describes a set of permissions for a security group rule.
FromPort (integer) --
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
IpProtocol (string) --
The IP protocol name (tcp , udp , icmp , icmpv6 ) or number (see Protocol Numbers ).
[VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp , udp , icmp , or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp , udp , and icmp , you must specify a port range. For icmpv6 , the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
IpRanges (list) --
The IPv4 ranges.
(dict) --
Describes an IPv4 range.
CidrIp (string) --
The IPv4 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv4 address, use the /32 prefix length.
Description (string) --
A description for the security group rule that references this IPv4 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
Ipv6Ranges (list) --
[VPC only] The IPv6 ranges.
(dict) --
[EC2-VPC only] Describes an IPv6 range.
CidrIpv6 (string) --
The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv6 address, use the /128 prefix length.
Description (string) --
A description for the security group rule that references this IPv6 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
PrefixListIds (list) --
[VPC only] The prefix list IDs for an AWS service. With outbound rules, this is the AWS service to access through a VPC endpoint from instances associated with the security group.
(dict) --
Describes a prefix list ID.
Description (string) --
A description for the security group rule that references this prefix list ID.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
PrefixListId (string) --
The ID of the prefix.
ToPort (integer) --
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
UserIdGroupPairs (list) --
The security group and AWS account ID pairs.
(dict) --
Describes a security group and AWS account ID pair.
Description (string) --
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
GroupId (string) --
The ID of the security group.
GroupName (string) --
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
PeeringStatus (string) --
The status of a VPC peering connection, if applicable.
UserId (string) --
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
VpcId (string) --
The ID of the VPC for the referenced security group, if applicable.
VpcPeeringConnectionId (string) --
The ID of the VPC peering connection, if applicable.
Tags (list) --
Any tags assigned to the security group.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VpcId (string) --
[VPC only] The ID of the VPC for the security group.
paginator = client.get_paginator('describe_snapshots')
Creates an iterator that will paginate through responses from EC2.Client.describe_snapshots().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
OwnerIds=[
'string',
],
RestorableByUserIds=[
'string',
],
SnapshotIds=[
'string',
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
Describes the snapshots owned by these owners.
The IDs of the AWS accounts that can create volumes from the snapshot.
The snapshot IDs.
Default: Describes the snapshots for which you have create volume permissions.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Snapshots': [
{
'DataEncryptionKeyId': 'string',
'Description': 'string',
'Encrypted': True|False,
'KmsKeyId': 'string',
'OwnerId': 'string',
'Progress': 'string',
'SnapshotId': 'string',
'StartTime': datetime(2015, 1, 1),
'State': 'pending'|'completed'|'error',
'StateMessage': 'string',
'VolumeId': 'string',
'VolumeSize': 123,
'OwnerAlias': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
}
Response Structure
(dict) --
Snapshots (list) --
Information about the snapshots.
(dict) --
Describes a snapshot.
DataEncryptionKeyId (string) --
The data encryption key identifier for the snapshot. This value is a unique identifier that corresponds to the data encryption key that was used to encrypt the original volume or snapshot copy. Because data encryption keys are inherited by volumes created from snapshots, and vice versa, if snapshots share the same data encryption key identifier, then they belong to the same volume/snapshot lineage. This parameter is only returned by DescribeSnapshots .
Description (string) --
The description for the snapshot.
Encrypted (boolean) --
Indicates whether the snapshot is encrypted.
KmsKeyId (string) --
The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the volume encryption key for the parent volume.
OwnerId (string) --
The AWS account ID of the EBS snapshot owner.
Progress (string) --
The progress of the snapshot, as a percentage.
SnapshotId (string) --
The ID of the snapshot. Each snapshot receives a unique identifier when it is created.
StartTime (datetime) --
The time stamp when the snapshot was initiated.
State (string) --
The snapshot state.
StateMessage (string) --
Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy operation fails (for example, if the proper AWS Key Management Service (AWS KMS) permissions are not obtained) this field displays error state details to help you diagnose why the error occurred. This parameter is only returned by DescribeSnapshots .
VolumeId (string) --
The ID of the volume that was used to create the snapshot. Snapshots created by the CopySnapshot action have an arbitrary volume ID that should not be used for any purpose.
VolumeSize (integer) --
The size of the volume, in GiB.
OwnerAlias (string) --
Value from an Amazon-maintained list (amazon | self | all | aws-marketplace | microsoft ) of snapshot owners. Not to be confused with the user-configured AWS account alias, which is set from the IAM console.
Tags (list) --
Any tags assigned to the snapshot.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
paginator = client.get_paginator('describe_spot_fleet_instances')
Creates an iterator that will paginate through responses from EC2.Client.describe_spot_fleet_instances().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
SpotFleetRequestId='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The ID of the Spot Fleet request.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'ActiveInstances': [
{
'InstanceId': 'string',
'InstanceType': 'string',
'SpotInstanceRequestId': 'string',
'InstanceHealth': 'healthy'|'unhealthy'
},
],
'SpotFleetRequestId': 'string'
}
Response Structure
(dict) --
Contains the output of DescribeSpotFleetInstances.
ActiveInstances (list) --
The running instances. This list is refreshed periodically and might be out of date.
(dict) --
Describes a running instance in a Spot Fleet.
InstanceId (string) --
The ID of the instance.
InstanceType (string) --
The instance type.
SpotInstanceRequestId (string) --
The ID of the Spot Instance request.
InstanceHealth (string) --
The health status of the instance. If the status of either the instance status check or the system status check is impaired , the health status of the instance is unhealthy . Otherwise, the health status is healthy .
SpotFleetRequestId (string) --
The ID of the Spot Fleet request.
paginator = client.get_paginator('describe_spot_fleet_requests')
Creates an iterator that will paginate through responses from EC2.Client.describe_spot_fleet_requests().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
SpotFleetRequestIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The IDs of the Spot Fleet requests.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'SpotFleetRequestConfigs': [
{
'ActivityStatus': 'error'|'pending_fulfillment'|'pending_termination'|'fulfilled',
'CreateTime': datetime(2015, 1, 1),
'SpotFleetRequestConfig': {
'AllocationStrategy': 'lowestPrice'|'diversified',
'OnDemandAllocationStrategy': 'lowestPrice'|'prioritized',
'ClientToken': 'string',
'ExcessCapacityTerminationPolicy': 'noTermination'|'default',
'FulfilledCapacity': 123.0,
'OnDemandFulfilledCapacity': 123.0,
'IamFleetRole': 'string',
'LaunchSpecifications': [
{
'SecurityGroups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'AddressingType': 'string',
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'Iops': 123,
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Encrypted': True|False,
'KmsKeyId': 'string'
},
'NoDevice': 'string'
},
],
'EbsOptimized': True|False,
'IamInstanceProfile': {
'Arn': 'string',
'Name': 'string'
},
'ImageId': 'string',
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'KernelId': 'string',
'KeyName': 'string',
'Monitoring': {
'Enabled': True|False
},
'NetworkInterfaces': [
{
'AssociatePublicIpAddress': True|False,
'DeleteOnTermination': True|False,
'Description': 'string',
'DeviceIndex': 123,
'Groups': [
'string',
],
'Ipv6AddressCount': 123,
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'NetworkInterfaceId': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
'SecondaryPrivateIpAddressCount': 123,
'SubnetId': 'string',
'InterfaceType': 'string'
},
],
'Placement': {
'AvailabilityZone': 'string',
'GroupName': 'string',
'Tenancy': 'default'|'dedicated'|'host'
},
'RamdiskId': 'string',
'SpotPrice': 'string',
'SubnetId': 'string',
'UserData': 'string',
'WeightedCapacity': 123.0,
'TagSpecifications': [
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
]
},
],
'LaunchTemplateConfigs': [
{
'LaunchTemplateSpecification': {
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'Version': 'string'
},
'Overrides': [
{
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'SpotPrice': 'string',
'SubnetId': 'string',
'AvailabilityZone': 'string',
'WeightedCapacity': 123.0,
'Priority': 123.0
},
]
},
],
'SpotPrice': 'string',
'TargetCapacity': 123,
'OnDemandTargetCapacity': 123,
'OnDemandMaxTotalPrice': 'string',
'SpotMaxTotalPrice': 'string',
'TerminateInstancesWithExpiration': True|False,
'Type': 'request'|'maintain'|'instant',
'ValidFrom': datetime(2015, 1, 1),
'ValidUntil': datetime(2015, 1, 1),
'ReplaceUnhealthyInstances': True|False,
'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate',
'LoadBalancersConfig': {
'ClassicLoadBalancersConfig': {
'ClassicLoadBalancers': [
{
'Name': 'string'
},
]
},
'TargetGroupsConfig': {
'TargetGroups': [
{
'Arn': 'string'
},
]
}
},
'InstancePoolsToUseCount': 123
},
'SpotFleetRequestId': 'string',
'SpotFleetRequestState': 'submitted'|'active'|'cancelled'|'failed'|'cancelled_running'|'cancelled_terminating'|'modifying'
},
]
}
Response Structure
(dict) --
Contains the output of DescribeSpotFleetRequests.
SpotFleetRequestConfigs (list) --
Information about the configuration of your Spot Fleet.
(dict) --
Describes a Spot Fleet request.
ActivityStatus (string) --
The progress of the Spot Fleet request. If there is an error, the status is error . After all requests are placed, the status is pending_fulfillment . If the size of the fleet is equal to or greater than its target capacity, the status is fulfilled . If the size of the fleet is decreased, the status is pending_termination while Spot Instances are terminating.
CreateTime (datetime) --
The creation date and time of the request.
SpotFleetRequestConfig (dict) --
The configuration of the Spot Fleet request.
AllocationStrategy (string) --
Indicates how to allocate the target capacity across the Spot pools specified by the Spot Fleet request. The default is lowestPrice .
OnDemandAllocationStrategy (string) --
The order of the launch template overrides to use in fulfilling On-Demand capacity. If you specify lowestPrice , Spot Fleet uses price to determine the order, launching the lowest price first. If you specify prioritized , Spot Fleet uses the priority that you assign to each Spot Fleet launch template override, launching the highest priority first. If you do not specify a value, Spot Fleet defaults to lowestPrice .
ClientToken (string) --
A unique, case-sensitive identifier that you provide to ensure the idempotency of your listings. This helps to avoid duplicate listings. For more information, see Ensuring Idempotency .
ExcessCapacityTerminationPolicy (string) --
Indicates whether running Spot Instances should be terminated if you decrease the target capacity of the Spot Fleet request below the current size of the Spot Fleet.
FulfilledCapacity (float) --
The number of units fulfilled by this request compared to the set target capacity. You cannot set this value.
OnDemandFulfilledCapacity (float) --
The number of On-Demand units fulfilled by this request compared to the set target On-Demand capacity.
IamFleetRole (string) --
The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) role that grants the Spot Fleet the permission to request, launch, terminate, and tag instances on your behalf. For more information, see Spot Fleet Prerequisites in the Amazon EC2 User Guide for Linux Instances . Spot Fleet can terminate Spot Instances on your behalf when you cancel its Spot Fleet request using CancelSpotFleetRequests or when the Spot Fleet request expires, if you set TerminateInstancesWithExpiration .
LaunchSpecifications (list) --
The launch specifications for the Spot Fleet request. If you specify LaunchSpecifications , you can't specify LaunchTemplateConfigs . If you include On-Demand capacity in your request, you must use LaunchTemplateConfigs .
(dict) --
Describes the launch specification for one or more Spot Instances. If you include On-Demand capacity in your fleet request, you can't use SpotFleetLaunchSpecification ; you must use LaunchTemplateConfig .
SecurityGroups (list) --
One or more security groups. When requesting instances in a VPC, you must specify the IDs of the security groups. When requesting instances in EC2-Classic, you can specify the names or the IDs of the security groups.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
AddressingType (string) --
Deprecated.
BlockDeviceMappings (list) --
One or more block devices that are mapped to the Spot instances. You can't specify both a snapshot ID and an encryption value. This is because only blank volumes can be encrypted on creation. If a snapshot is the basis for a volume, it is not blank and its encryption status is used for the volume encryption status.
(dict) --
Describes a block device mapping.
DeviceName (string) --
The device name (for example, /dev/sdh or xvdh ).
VirtualName (string) --
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Ebs (dict) --
Parameters used to automatically set up EBS volumes when the instance is launched.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports. For io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
SnapshotId (string) --
The ID of the snapshot.
VolumeSize (integer) --
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Constraints: 1-16384 for General Purpose SSD (gp2 ), 4-16384 for Provisioned IOPS SSD (io1 ), 500-16384 for Throughput Optimized HDD (st1 ), 500-16384 for Cold HDD (sc1 ), and 1-1024 for Magnetic (standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
VolumeType (string) --
The volume type. If you set the type to io1 , you must also set the Iops property.
Default: standard
Encrypted (boolean) --
Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
In no case can you remove encryption from an encrypted volume.
Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
KmsKeyId (string) --
Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is encrypted.
This parameter is only supported on BlockDeviceMapping objects called by RunInstances , RequestSpotFleet , and RequestSpotInstances .
NoDevice (string) --
Suppresses the specified device included in the block device mapping of the AMI.
EbsOptimized (boolean) --
Indicates whether the instances are optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.
Default: false
IamInstanceProfile (dict) --
The IAM instance profile.
Arn (string) --
The Amazon Resource Name (ARN) of the instance profile.
Name (string) --
The name of the instance profile.
ImageId (string) --
The ID of the AMI.
InstanceType (string) --
The instance type.
KernelId (string) --
The ID of the kernel.
KeyName (string) --
The name of the key pair.
Monitoring (dict) --
Enable or disable monitoring for the instances.
Enabled (boolean) --
Enables monitoring for the instance.
Default: false
NetworkInterfaces (list) --
One or more network interfaces. If you specify a network interface, you must specify subnet IDs and security group IDs using the network interface.
(dict) --
Describes a network interface.
AssociatePublicIpAddress (boolean) --
Indicates whether to assign a public IPv4 address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is true .
DeleteOnTermination (boolean) --
If set to true , the interface is deleted when the instance is terminated. You can specify true only if creating a new network interface when launching an instance.
Description (string) --
The description of the network interface. Applies only if creating a network interface when launching an instance.
DeviceIndex (integer) --
The position of the network interface in the attachment order. A primary network interface has a device index of 0.
If you specify a network interface when launching an instance, you must specify the device index.
Groups (list) --
The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.
Ipv6AddressCount (integer) --
A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.
Ipv6Addresses (list) --
One or more IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.
(dict) --
Describes an IPv6 address.
Ipv6Address (string) --
The IPv6 address.
NetworkInterfaceId (string) --
The ID of the network interface.
PrivateIpAddress (string) --
The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance. You cannot specify this option if you're launching more than one instance in a RunInstances request.
PrivateIpAddresses (list) --
One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you're launching more than one instance in a RunInstances request.
(dict) --
Describes a secondary private IPv4 address for a network interface.
Primary (boolean) --
Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.
PrivateIpAddress (string) --
The private IPv4 addresses.
SecondaryPrivateIpAddressCount (integer) --
The number of secondary private IPv4 addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you're launching more than one instance in a RunInstances request.
SubnetId (string) --
The ID of the subnet associated with the network string. Applies only if creating a network interface when launching an instance.
InterfaceType (string) --
The type of network interface. To create an Elastic Fabric Adapter (EFA), specify efa . For more information, see Elastic Fabric Adapter in the Amazon Elastic Compute Cloud User Guide .
If you are not creating an EFA, specify interface or omit this parameter.
Valid values: interface | efa
Placement (dict) --
The placement information.
AvailabilityZone (string) --
The Availability Zone.
[Spot Fleet only] To specify multiple Availability Zones, separate them using commas; for example, "us-west-2a, us-west-2b".
GroupName (string) --
The name of the placement group.
Tenancy (string) --
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for Spot Instances.
RamdiskId (string) --
The ID of the RAM disk. Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, refer to the AWS Resource Center and search for the kernel ID.
SpotPrice (string) --
The maximum price per unit hour that you are willing to pay for a Spot Instance. If this value is not specified, the default is the Spot price specified for the fleet. To determine the Spot price per unit hour, divide the Spot price by the value of WeightedCapacity .
SubnetId (string) --
The ID of the subnet in which to launch the instances. To specify multiple subnets, separate them using commas; for example, "subnet-a61dafcf, subnet-65ea5f08".
UserData (string) --
The Base64-encoded user data that instances use when starting up.
WeightedCapacity (float) --
The number of units provided by the specified instance type. These are the same units that you chose to set the target capacity in terms of instances, or a performance characteristic such as vCPUs, memory, or I/O.
If the target capacity divided by this value is not a whole number, Amazon EC2 rounds the number of instances to the next whole number. If this value is not specified, the default is 1.
TagSpecifications (list) --
The tags to apply during creation.
(dict) --
The tags for a Spot Fleet resource.
ResourceType (string) --
The type of resource. Currently, the only resource type that is supported is instance .
Tags (list) --
The tags.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
LaunchTemplateConfigs (list) --
The launch template and overrides. If you specify LaunchTemplateConfigs , you can't specify LaunchSpecifications . If you include On-Demand capacity in your request, you must use LaunchTemplateConfigs .
(dict) --
Describes a launch template and overrides.
LaunchTemplateSpecification (dict) --
The launch template.
LaunchTemplateId (string) --
The ID of the launch template. You must specify either a template ID or a template name.
LaunchTemplateName (string) --
The name of the launch template. You must specify either a template name or a template ID.
Version (string) --
The version number of the launch template. You must specify a version number.
Overrides (list) --
Any parameters that you specify override the same parameters in the launch template.
(dict) --
Describes overrides for a launch template.
InstanceType (string) --
The instance type.
SpotPrice (string) --
The maximum price per unit hour that you are willing to pay for a Spot Instance.
SubnetId (string) --
The ID of the subnet in which to launch the instances.
AvailabilityZone (string) --
The Availability Zone in which to launch the instances.
WeightedCapacity (float) --
The number of units provided by the specified instance type.
Priority (float) --
The priority for the launch template override. If OnDemandAllocationStrategy is set to prioritized , Spot Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity. The highest priority is launched first. Valid values are whole numbers starting at 0 . The lower the number, the higher the priority. If no number is set, the launch template override has the lowest priority.
SpotPrice (string) --
The maximum price per unit hour that you are willing to pay for a Spot Instance. The default is the On-Demand price.
TargetCapacity (integer) --
The number of units to request for the Spot Fleet. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is maintain , you can specify a target capacity of 0 and add capacity later.
OnDemandTargetCapacity (integer) --
The number of On-Demand units to request. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is maintain , you can specify a target capacity of 0 and add capacity later.
OnDemandMaxTotalPrice (string) --
The maximum amount per hour for On-Demand Instances that you're willing to pay. You can use the onDemandMaxTotalPrice parameter, the spotMaxTotalPrice parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you're willing to pay. When the maximum amount you're willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.
SpotMaxTotalPrice (string) --
The maximum amount per hour for Spot Instances that you're willing to pay. You can use the spotdMaxTotalPrice parameter, the onDemandMaxTotalPrice parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you're willing to pay. When the maximum amount you're willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.
TerminateInstancesWithExpiration (boolean) --
Indicates whether running Spot Instances are terminated when the Spot Fleet request expires.
Type (string) --
The type of request. Indicates whether the Spot Fleet only requests the target capacity or also attempts to maintain it. When this value is request , the Spot Fleet only places the required requests. It does not attempt to replenish Spot Instances if capacity is diminished, nor does it submit requests in alternative Spot pools if capacity is not available. When this value is maintain , the Spot Fleet maintains the target capacity. The Spot Fleet places the required requests to meet capacity and automatically replenishes any interrupted instances. Default: maintain . instant is listed but is not used by Spot Fleet.
ValidFrom (datetime) --
The start date and time of the request, in UTC format (YYYY -MM -DD T*HH* :MM :SS Z). By default, Amazon EC2 starts fulfilling the request immediately.
ValidUntil (datetime) --
The end date and time of the request, in UTC format (YYYY -MM -DD T*HH* :MM :SS Z). After the end date and time, no new Spot Instance requests are placed or able to fulfill the request. If no value is specified, the Spot Fleet request remains until you cancel it.
ReplaceUnhealthyInstances (boolean) --
Indicates whether Spot Fleet should replace unhealthy instances.
InstanceInterruptionBehavior (string) --
The behavior when a Spot Instance is interrupted. The default is terminate .
LoadBalancersConfig (dict) --
One or more Classic Load Balancers and target groups to attach to the Spot Fleet request. Spot Fleet registers the running Spot Instances with the specified Classic Load Balancers and target groups.
With Network Load Balancers, Spot Fleet cannot register instances that have the following instance types: C1, CC1, CC2, CG1, CG2, CR1, CS1, G1, G2, HI1, HS1, M1, M2, M3, and T1.
ClassicLoadBalancersConfig (dict) --
The Classic Load Balancers.
ClassicLoadBalancers (list) --
One or more Classic Load Balancers.
(dict) --
Describes a Classic Load Balancer.
Name (string) --
The name of the load balancer.
TargetGroupsConfig (dict) --
The target groups.
TargetGroups (list) --
One or more target groups.
(dict) --
Describes a load balancer target group.
Arn (string) --
The Amazon Resource Name (ARN) of the target group.
InstancePoolsToUseCount (integer) --
The number of Spot pools across which to allocate your target Spot capacity. Valid only when Spot AllocationStrategy is set to lowest-price . Spot Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify.
SpotFleetRequestId (string) --
The ID of the Spot Fleet request.
SpotFleetRequestState (string) --
The state of the Spot Fleet request.
paginator = client.get_paginator('describe_spot_instance_requests')
Creates an iterator that will paginate through responses from EC2.Client.describe_spot_instance_requests().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
SpotInstanceRequestIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more Spot Instance request IDs.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'SpotInstanceRequests': [
{
'ActualBlockHourlyPrice': 'string',
'AvailabilityZoneGroup': 'string',
'BlockDurationMinutes': 123,
'CreateTime': datetime(2015, 1, 1),
'Fault': {
'Code': 'string',
'Message': 'string'
},
'InstanceId': 'string',
'LaunchGroup': 'string',
'LaunchSpecification': {
'UserData': 'string',
'SecurityGroups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'AddressingType': 'string',
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'Iops': 123,
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Encrypted': True|False,
'KmsKeyId': 'string'
},
'NoDevice': 'string'
},
],
'EbsOptimized': True|False,
'IamInstanceProfile': {
'Arn': 'string',
'Name': 'string'
},
'ImageId': 'string',
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'KernelId': 'string',
'KeyName': 'string',
'NetworkInterfaces': [
{
'AssociatePublicIpAddress': True|False,
'DeleteOnTermination': True|False,
'Description': 'string',
'DeviceIndex': 123,
'Groups': [
'string',
],
'Ipv6AddressCount': 123,
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'NetworkInterfaceId': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
'SecondaryPrivateIpAddressCount': 123,
'SubnetId': 'string',
'InterfaceType': 'string'
},
],
'Placement': {
'AvailabilityZone': 'string',
'GroupName': 'string',
'Tenancy': 'default'|'dedicated'|'host'
},
'RamdiskId': 'string',
'SubnetId': 'string',
'Monitoring': {
'Enabled': True|False
}
},
'LaunchedAvailabilityZone': 'string',
'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
'SpotInstanceRequestId': 'string',
'SpotPrice': 'string',
'State': 'open'|'active'|'closed'|'cancelled'|'failed',
'Status': {
'Code': 'string',
'Message': 'string',
'UpdateTime': datetime(2015, 1, 1)
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'Type': 'one-time'|'persistent',
'ValidFrom': datetime(2015, 1, 1),
'ValidUntil': datetime(2015, 1, 1),
'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate'
},
],
}
Response Structure
(dict) --
Contains the output of DescribeSpotInstanceRequests.
SpotInstanceRequests (list) --
One or more Spot Instance requests.
(dict) --
Describes a Spot Instance request.
ActualBlockHourlyPrice (string) --
If you specified a duration and your Spot Instance request was fulfilled, this is the fixed hourly price in effect for the Spot Instance while it runs.
AvailabilityZoneGroup (string) --
The Availability Zone group. If you specify the same Availability Zone group for all Spot Instance requests, all Spot Instances are launched in the same Availability Zone.
BlockDurationMinutes (integer) --
The duration for the Spot Instance, in minutes.
CreateTime (datetime) --
The date and time when the Spot Instance request was created, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).
Fault (dict) --
The fault codes for the Spot Instance request, if any.
Code (string) --
The reason code for the Spot Instance state change.
Message (string) --
The message for the Spot Instance state change.
InstanceId (string) --
The instance ID, if an instance has been launched to fulfill the Spot Instance request.
LaunchGroup (string) --
The instance launch group. Launch groups are Spot Instances that launch together and terminate together.
LaunchSpecification (dict) --
Additional information for launching instances.
UserData (string) --
The Base64-encoded user data for the instance.
SecurityGroups (list) --
One or more security groups. When requesting instances in a VPC, you must specify the IDs of the security groups. When requesting instances in EC2-Classic, you can specify the names or the IDs of the security groups.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
AddressingType (string) --
Deprecated.
BlockDeviceMappings (list) --
One or more block device mapping entries.
(dict) --
Describes a block device mapping.
DeviceName (string) --
The device name (for example, /dev/sdh or xvdh ).
VirtualName (string) --
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Ebs (dict) --
Parameters used to automatically set up EBS volumes when the instance is launched.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports. For io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
SnapshotId (string) --
The ID of the snapshot.
VolumeSize (integer) --
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Constraints: 1-16384 for General Purpose SSD (gp2 ), 4-16384 for Provisioned IOPS SSD (io1 ), 500-16384 for Throughput Optimized HDD (st1 ), 500-16384 for Cold HDD (sc1 ), and 1-1024 for Magnetic (standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
VolumeType (string) --
The volume type. If you set the type to io1 , you must also set the Iops property.
Default: standard
Encrypted (boolean) --
Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
In no case can you remove encryption from an encrypted volume.
Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
KmsKeyId (string) --
Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is encrypted.
This parameter is only supported on BlockDeviceMapping objects called by RunInstances , RequestSpotFleet , and RequestSpotInstances .
NoDevice (string) --
Suppresses the specified device included in the block device mapping of the AMI.
EbsOptimized (boolean) --
Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.
Default: false
IamInstanceProfile (dict) --
The IAM instance profile.
Arn (string) --
The Amazon Resource Name (ARN) of the instance profile.
Name (string) --
The name of the instance profile.
ImageId (string) --
The ID of the AMI.
InstanceType (string) --
The instance type.
KernelId (string) --
The ID of the kernel.
KeyName (string) --
The name of the key pair.
NetworkInterfaces (list) --
One or more network interfaces. If you specify a network interface, you must specify subnet IDs and security group IDs using the network interface.
(dict) --
Describes a network interface.
AssociatePublicIpAddress (boolean) --
Indicates whether to assign a public IPv4 address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is true .
DeleteOnTermination (boolean) --
If set to true , the interface is deleted when the instance is terminated. You can specify true only if creating a new network interface when launching an instance.
Description (string) --
The description of the network interface. Applies only if creating a network interface when launching an instance.
DeviceIndex (integer) --
The position of the network interface in the attachment order. A primary network interface has a device index of 0.
If you specify a network interface when launching an instance, you must specify the device index.
Groups (list) --
The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.
Ipv6AddressCount (integer) --
A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.
Ipv6Addresses (list) --
One or more IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.
(dict) --
Describes an IPv6 address.
Ipv6Address (string) --
The IPv6 address.
NetworkInterfaceId (string) --
The ID of the network interface.
PrivateIpAddress (string) --
The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance. You cannot specify this option if you're launching more than one instance in a RunInstances request.
PrivateIpAddresses (list) --
One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you're launching more than one instance in a RunInstances request.
(dict) --
Describes a secondary private IPv4 address for a network interface.
Primary (boolean) --
Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.
PrivateIpAddress (string) --
The private IPv4 addresses.
SecondaryPrivateIpAddressCount (integer) --
The number of secondary private IPv4 addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you're launching more than one instance in a RunInstances request.
SubnetId (string) --
The ID of the subnet associated with the network string. Applies only if creating a network interface when launching an instance.
InterfaceType (string) --
The type of network interface. To create an Elastic Fabric Adapter (EFA), specify efa . For more information, see Elastic Fabric Adapter in the Amazon Elastic Compute Cloud User Guide .
If you are not creating an EFA, specify interface or omit this parameter.
Valid values: interface | efa
Placement (dict) --
The placement information for the instance.
AvailabilityZone (string) --
The Availability Zone.
[Spot Fleet only] To specify multiple Availability Zones, separate them using commas; for example, "us-west-2a, us-west-2b".
GroupName (string) --
The name of the placement group.
Tenancy (string) --
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for Spot Instances.
RamdiskId (string) --
The ID of the RAM disk.
SubnetId (string) --
The ID of the subnet in which to launch the instance.
Monitoring (dict) --
Describes the monitoring of an instance.
Enabled (boolean) --
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
LaunchedAvailabilityZone (string) --
The Availability Zone in which the request is launched.
ProductDescription (string) --
The product description associated with the Spot Instance.
SpotInstanceRequestId (string) --
The ID of the Spot Instance request.
SpotPrice (string) --
The maximum price per hour that you are willing to pay for a Spot Instance.
State (string) --
The state of the Spot Instance request. Spot status information helps track your Spot Instance requests. For more information, see Spot Status in the Amazon EC2 User Guide for Linux Instances .
Status (dict) --
The status code and status message describing the Spot Instance request.
Code (string) --
The status code. For a list of status codes, see Spot Status Codes in the Amazon EC2 User Guide for Linux Instances .
Message (string) --
The description for the status code.
UpdateTime (datetime) --
The date and time of the most recent status update, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).
Tags (list) --
Any tags assigned to the resource.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
Type (string) --
The Spot Instance request type.
ValidFrom (datetime) --
The start date of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). The request becomes active at this date and time.
ValidUntil (datetime) --
The end date of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). If this is a one-time request, it remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date is reached. The default end date is 7 days from the current date.
InstanceInterruptionBehavior (string) --
The behavior when a Spot Instance is interrupted.
paginator = client.get_paginator('describe_spot_price_history')
Creates an iterator that will paginate through responses from EC2.Client.describe_spot_price_history().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
AvailabilityZone='string',
DryRun=True|False,
EndTime=datetime(2015, 1, 1),
InstanceTypes=[
't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
],
ProductDescriptions=[
'string',
],
StartTime=datetime(2015, 1, 1),
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
Filters the results by the specified instance types.
Filters the results by the specified basic product descriptions.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'SpotPriceHistory': [
{
'AvailabilityZone': 'string',
'InstanceType': 't1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
'SpotPrice': 'string',
'Timestamp': datetime(2015, 1, 1)
},
]
}
Response Structure
(dict) --
Contains the output of DescribeSpotPriceHistory.
SpotPriceHistory (list) --
The historical Spot prices.
(dict) --
Describes the maximum price per hour that you are willing to pay for a Spot Instance.
AvailabilityZone (string) --
The Availability Zone.
InstanceType (string) --
The instance type.
ProductDescription (string) --
A general description of the AMI.
SpotPrice (string) --
The maximum price per hour that you are willing to pay for a Spot Instance.
Timestamp (datetime) --
The date and time the request was created, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z).
paginator = client.get_paginator('describe_stale_security_groups')
Creates an iterator that will paginate through responses from EC2.Client.describe_stale_security_groups().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
VpcId='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The ID of the VPC.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'StaleSecurityGroupSet': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'StaleIpPermissions': [
{
'FromPort': 123,
'IpProtocol': 'string',
'IpRanges': [
'string',
],
'PrefixListIds': [
'string',
],
'ToPort': 123,
'UserIdGroupPairs': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'PeeringStatus': 'string',
'UserId': 'string',
'VpcId': 'string',
'VpcPeeringConnectionId': 'string'
},
]
},
],
'StaleIpPermissionsEgress': [
{
'FromPort': 123,
'IpProtocol': 'string',
'IpRanges': [
'string',
],
'PrefixListIds': [
'string',
],
'ToPort': 123,
'UserIdGroupPairs': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'PeeringStatus': 'string',
'UserId': 'string',
'VpcId': 'string',
'VpcPeeringConnectionId': 'string'
},
]
},
],
'VpcId': 'string'
},
]
}
Response Structure
(dict) --
StaleSecurityGroupSet (list) --
Information about the stale security groups.
(dict) --
Describes a stale security group (a security group that contains stale rules).
Description (string) --
The description of the security group.
GroupId (string) --
The ID of the security group.
GroupName (string) --
The name of the security group.
StaleIpPermissions (list) --
Information about the stale inbound rules in the security group.
(dict) --
Describes a stale rule in a security group.
FromPort (integer) --
The start of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.
IpProtocol (string) --
The IP protocol name (for tcp , udp , and icmp ) or number (see Protocol Numbers) .
IpRanges (list) --
The IP ranges. Not applicable for stale security group rules.
PrefixListIds (list) --
The prefix list IDs for an AWS service. Not applicable for stale security group rules.
ToPort (integer) --
The end of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.
UserIdGroupPairs (list) --
The security group pairs. Returns the ID of the referenced security group and VPC, and the ID and status of the VPC peering connection.
(dict) --
Describes a security group and AWS account ID pair.
Description (string) --
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
GroupId (string) --
The ID of the security group.
GroupName (string) --
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
PeeringStatus (string) --
The status of a VPC peering connection, if applicable.
UserId (string) --
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
VpcId (string) --
The ID of the VPC for the referenced security group, if applicable.
VpcPeeringConnectionId (string) --
The ID of the VPC peering connection, if applicable.
StaleIpPermissionsEgress (list) --
Information about the stale outbound rules in the security group.
(dict) --
Describes a stale rule in a security group.
FromPort (integer) --
The start of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.
IpProtocol (string) --
The IP protocol name (for tcp , udp , and icmp ) or number (see Protocol Numbers) .
IpRanges (list) --
The IP ranges. Not applicable for stale security group rules.
PrefixListIds (list) --
The prefix list IDs for an AWS service. Not applicable for stale security group rules.
ToPort (integer) --
The end of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.
UserIdGroupPairs (list) --
The security group pairs. Returns the ID of the referenced security group and VPC, and the ID and status of the VPC peering connection.
(dict) --
Describes a security group and AWS account ID pair.
Description (string) --
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
GroupId (string) --
The ID of the security group.
GroupName (string) --
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
PeeringStatus (string) --
The status of a VPC peering connection, if applicable.
UserId (string) --
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
VpcId (string) --
The ID of the VPC for the referenced security group, if applicable.
VpcPeeringConnectionId (string) --
The ID of the VPC peering connection, if applicable.
VpcId (string) --
The ID of the VPC for the security group.
paginator = client.get_paginator('describe_subnets')
Creates an iterator that will paginate through responses from EC2.Client.describe_subnets().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
SubnetIds=[
'string',
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more subnet IDs.
Default: Describes all your subnets.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Subnets': [
{
'AvailabilityZone': 'string',
'AvailabilityZoneId': 'string',
'AvailableIpAddressCount': 123,
'CidrBlock': 'string',
'DefaultForAz': True|False,
'MapPublicIpOnLaunch': True|False,
'State': 'pending'|'available',
'SubnetId': 'string',
'VpcId': 'string',
'OwnerId': 'string',
'AssignIpv6AddressOnCreation': True|False,
'Ipv6CidrBlockAssociationSet': [
{
'AssociationId': 'string',
'Ipv6CidrBlock': 'string',
'Ipv6CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
}
},
],
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'SubnetArn': 'string'
},
],
}
Response Structure
(dict) --
Subnets (list) --
Information about one or more subnets.
(dict) --
Describes a subnet.
AvailabilityZone (string) --
The Availability Zone of the subnet.
AvailabilityZoneId (string) --
The AZ ID of the subnet.
AvailableIpAddressCount (integer) --
The number of unused private IPv4 addresses in the subnet. The IPv4 addresses for any stopped instances are considered unavailable.
CidrBlock (string) --
The IPv4 CIDR block assigned to the subnet.
DefaultForAz (boolean) --
Indicates whether this is the default subnet for the Availability Zone.
MapPublicIpOnLaunch (boolean) --
Indicates whether instances launched in this subnet receive a public IPv4 address.
State (string) --
The current state of the subnet.
SubnetId (string) --
The ID of the subnet.
VpcId (string) --
The ID of the VPC the subnet is in.
OwnerId (string) --
The ID of the AWS account that owns the subnet.
AssignIpv6AddressOnCreation (boolean) --
Indicates whether a network interface created in this subnet (including a network interface created by RunInstances ) receives an IPv6 address.
Ipv6CidrBlockAssociationSet (list) --
Information about the IPv6 CIDR blocks associated with the subnet.
(dict) --
Describes an IPv6 CIDR block associated with a subnet.
AssociationId (string) --
The association ID for the CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
Ipv6CidrBlockState (dict) --
Information about the state of the CIDR block.
State (string) --
The state of a CIDR block.
StatusMessage (string) --
A message about the status of the CIDR block, if applicable.
Tags (list) --
Any tags assigned to the subnet.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
SubnetArn (string) --
The Amazon Resource Name (ARN) of the subnet.
paginator = client.get_paginator('describe_tags')
Creates an iterator that will paginate through responses from EC2.Client.describe_tags().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Tags': [
{
'Key': 'string',
'ResourceId': 'string',
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Value': 'string'
},
]
}
Response Structure
(dict) --
Tags (list) --
The tags.
(dict) --
Describes a tag.
Key (string) --
The tag key.
ResourceId (string) --
The ID of the resource.
ResourceType (string) --
The resource type.
Value (string) --
The tag value.
paginator = client.get_paginator('describe_traffic_mirror_filters')
Creates an iterator that will paginate through responses from EC2.Client.describe_traffic_mirror_filters().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
TrafficMirrorFilterIds=[
'string',
],
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The ID of the Traffic Mirror filter.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'TrafficMirrorFilters': [
{
'TrafficMirrorFilterId': 'string',
'IngressFilterRules': [
{
'TrafficMirrorFilterRuleId': 'string',
'TrafficMirrorFilterId': 'string',
'TrafficDirection': 'ingress'|'egress',
'RuleNumber': 123,
'RuleAction': 'accept'|'reject',
'Protocol': 123,
'DestinationPortRange': {
'FromPort': 123,
'ToPort': 123
},
'SourcePortRange': {
'FromPort': 123,
'ToPort': 123
},
'DestinationCidrBlock': 'string',
'SourceCidrBlock': 'string',
'Description': 'string'
},
],
'EgressFilterRules': [
{
'TrafficMirrorFilterRuleId': 'string',
'TrafficMirrorFilterId': 'string',
'TrafficDirection': 'ingress'|'egress',
'RuleNumber': 123,
'RuleAction': 'accept'|'reject',
'Protocol': 123,
'DestinationPortRange': {
'FromPort': 123,
'ToPort': 123
},
'SourcePortRange': {
'FromPort': 123,
'ToPort': 123
},
'DestinationCidrBlock': 'string',
'SourceCidrBlock': 'string',
'Description': 'string'
},
],
'NetworkServices': [
'amazon-dns',
],
'Description': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
}
Response Structure
(dict) --
TrafficMirrorFilters (list) --
Information about one or more Traffic Mirror filters.
(dict) --
Describes the Traffic Mirror filter.
TrafficMirrorFilterId (string) --
The ID of the Traffic Mirror filter.
IngressFilterRules (list) --
Information about the ingress rules that are associated with the Traffic Mirror filter.
(dict) --
Describes the Traffic Mirror rule.
TrafficMirrorFilterRuleId (string) --
The ID of the Traffic Mirror rule.
TrafficMirrorFilterId (string) --
The ID of the Traffic Mirror filter that the rule is associated with.
TrafficDirection (string) --
The traffic direction assigned to the Traffic Mirror rule.
RuleNumber (integer) --
The rule number of the Traffic Mirror rule.
RuleAction (string) --
The action assigned to the Traffic Mirror rule.
Protocol (integer) --
The protocol assigned to the Traffic Mirror rule.
DestinationPortRange (dict) --
The destination port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
SourcePortRange (dict) --
The source port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
DestinationCidrBlock (string) --
The destination CIDR block assigned to the Traffic Mirror rule.
SourceCidrBlock (string) --
The source CIDR block assigned to the Traffic Mirror rule.
Description (string) --
The description of the Traffic Mirror rule.
EgressFilterRules (list) --
Information about the egress rules that are associated with the Traffic Mirror filter.
(dict) --
Describes the Traffic Mirror rule.
TrafficMirrorFilterRuleId (string) --
The ID of the Traffic Mirror rule.
TrafficMirrorFilterId (string) --
The ID of the Traffic Mirror filter that the rule is associated with.
TrafficDirection (string) --
The traffic direction assigned to the Traffic Mirror rule.
RuleNumber (integer) --
The rule number of the Traffic Mirror rule.
RuleAction (string) --
The action assigned to the Traffic Mirror rule.
Protocol (integer) --
The protocol assigned to the Traffic Mirror rule.
DestinationPortRange (dict) --
The destination port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
SourcePortRange (dict) --
The source port range assigned to the Traffic Mirror rule.
FromPort (integer) --
The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
ToPort (integer) --
The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.
DestinationCidrBlock (string) --
The destination CIDR block assigned to the Traffic Mirror rule.
SourceCidrBlock (string) --
The source CIDR block assigned to the Traffic Mirror rule.
Description (string) --
The description of the Traffic Mirror rule.
NetworkServices (list) --
The network service traffic that is associated with the Traffic Mirror filter.
Description (string) --
The description of the Traffic Mirror filter.
Tags (list) --
The tags assigned to the Traffic Mirror filter.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
paginator = client.get_paginator('describe_traffic_mirror_sessions')
Creates an iterator that will paginate through responses from EC2.Client.describe_traffic_mirror_sessions().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
TrafficMirrorSessionIds=[
'string',
],
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The ID of the Traffic Mirror session.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'TrafficMirrorSessions': [
{
'TrafficMirrorSessionId': 'string',
'TrafficMirrorTargetId': 'string',
'TrafficMirrorFilterId': 'string',
'NetworkInterfaceId': 'string',
'OwnerId': 'string',
'PacketLength': 123,
'SessionNumber': 123,
'VirtualNetworkId': 123,
'Description': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
}
Response Structure
(dict) --
TrafficMirrorSessions (list) --
Describes one or more Traffic Mirror sessions. By default, all Traffic Mirror sessions are described. Alternatively, you can filter the results.
(dict) --
Describes a Traffic Mirror session.
TrafficMirrorSessionId (string) --
The ID for the Traffic Mirror session.
TrafficMirrorTargetId (string) --
The ID of the Traffic Mirror target.
TrafficMirrorFilterId (string) --
The ID of the Traffic Mirror filter.
NetworkInterfaceId (string) --
The ID of the Traffic Mirror session's network interface.
OwnerId (string) --
The ID of the account that owns the Traffic Mirror session.
PacketLength (integer) --
The number of bytes in each packet to mirror. These are the bytes after the VXLAN header. To mirror a subset, set this to the length (in bytes) to mirror. For example, if you set this value to 100, then the first 100 bytes that meet the filter criteria are copied to the target. Do not specify this parameter when you want to mirror the entire packet
SessionNumber (integer) --
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
Valid values are 1-32766.
VirtualNetworkId (integer) --
The virtual network ID associated with the Traffic Mirror session.
Description (string) --
The description of the Traffic Mirror session.
Tags (list) --
The tags assigned to the Traffic Mirror session.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
paginator = client.get_paginator('describe_traffic_mirror_targets')
Creates an iterator that will paginate through responses from EC2.Client.describe_traffic_mirror_targets().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
TrafficMirrorTargetIds=[
'string',
],
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The ID of the Traffic Mirror targets.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'TrafficMirrorTargets': [
{
'TrafficMirrorTargetId': 'string',
'NetworkInterfaceId': 'string',
'NetworkLoadBalancerArn': 'string',
'Type': 'network-interface'|'network-load-balancer',
'Description': 'string',
'OwnerId': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
}
Response Structure
(dict) --
TrafficMirrorTargets (list) --
Information about one or more Traffic Mirror targets.
(dict) --
Describes a Traffic Mirror target.
TrafficMirrorTargetId (string) --
The ID of the Traffic Mirror target.
NetworkInterfaceId (string) --
The network interface ID that is attached to the target.
NetworkLoadBalancerArn (string) --
The Amazon Resource Name (ARN) of the Network Load Balancer.
Type (string) --
The type of Traffic Mirror target.
Description (string) --
Information about the Traffic Mirror target.
OwnerId (string) --
The ID of the account that owns the Traffic Mirror target.
Tags (list) --
The tags assigned to the Traffic Mirror target.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
paginator = client.get_paginator('describe_transit_gateway_attachments')
Creates an iterator that will paginate through responses from EC2.Client.describe_transit_gateway_attachments().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
TransitGatewayAttachmentIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The IDs of the attachments.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'TransitGatewayAttachments': [
{
'TransitGatewayAttachmentId': 'string',
'TransitGatewayId': 'string',
'TransitGatewayOwnerId': 'string',
'ResourceOwnerId': 'string',
'ResourceType': 'vpc'|'vpn'|'direct-connect-gateway',
'ResourceId': 'string',
'State': 'pendingAcceptance'|'rollingBack'|'pending'|'available'|'modifying'|'deleting'|'deleted'|'failed'|'rejected'|'rejecting'|'failing',
'Association': {
'TransitGatewayRouteTableId': 'string',
'State': 'associating'|'associated'|'disassociating'|'disassociated'
},
'CreationTime': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
}
Response Structure
(dict) --
TransitGatewayAttachments (list) --
Information about the attachments.
(dict) --
Describes an attachment between a resource and a transit gateway.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
TransitGatewayId (string) --
The ID of the transit gateway.
TransitGatewayOwnerId (string) --
The ID of the AWS account that owns the transit gateway.
ResourceOwnerId (string) --
The ID of the AWS account that owns the resource.
ResourceType (string) --
The resource type.
ResourceId (string) --
The ID of the resource.
State (string) --
The attachment state.
Association (dict) --
The association.
TransitGatewayRouteTableId (string) --
The ID of the route table for the transit gateway.
State (string) --
The state of the association.
CreationTime (datetime) --
The creation time.
Tags (list) --
The tags for the attachment.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
paginator = client.get_paginator('describe_transit_gateway_route_tables')
Creates an iterator that will paginate through responses from EC2.Client.describe_transit_gateway_route_tables().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
TransitGatewayRouteTableIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The IDs of the transit gateway route tables.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'TransitGatewayRouteTables': [
{
'TransitGatewayRouteTableId': 'string',
'TransitGatewayId': 'string',
'State': 'pending'|'available'|'deleting'|'deleted',
'DefaultAssociationRouteTable': True|False,
'DefaultPropagationRouteTable': True|False,
'CreationTime': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
}
Response Structure
(dict) --
TransitGatewayRouteTables (list) --
Information about the transit gateway route tables.
(dict) --
Describes a transit gateway route table.
TransitGatewayRouteTableId (string) --
The ID of the transit gateway route table.
TransitGatewayId (string) --
The ID of the transit gateway.
State (string) --
The state of the transit gateway route table.
DefaultAssociationRouteTable (boolean) --
Indicates whether this is the default association route table for the transit gateway.
DefaultPropagationRouteTable (boolean) --
Indicates whether this is the default propagation route table for the transit gateway.
CreationTime (datetime) --
The creation time.
Tags (list) --
Any tags assigned to the route table.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
paginator = client.get_paginator('describe_transit_gateway_vpc_attachments')
Creates an iterator that will paginate through responses from EC2.Client.describe_transit_gateway_vpc_attachments().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
TransitGatewayAttachmentIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The IDs of the attachments.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'TransitGatewayVpcAttachments': [
{
'TransitGatewayAttachmentId': 'string',
'TransitGatewayId': 'string',
'VpcId': 'string',
'VpcOwnerId': 'string',
'State': 'pendingAcceptance'|'rollingBack'|'pending'|'available'|'modifying'|'deleting'|'deleted'|'failed'|'rejected'|'rejecting'|'failing',
'SubnetIds': [
'string',
],
'CreationTime': datetime(2015, 1, 1),
'Options': {
'DnsSupport': 'enable'|'disable',
'Ipv6Support': 'enable'|'disable'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
}
Response Structure
(dict) --
TransitGatewayVpcAttachments (list) --
Information about the VPC attachments.
(dict) --
Describes a VPC attachment.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
TransitGatewayId (string) --
The ID of the transit gateway.
VpcId (string) --
The ID of the VPC.
VpcOwnerId (string) --
The ID of the AWS account that owns the VPC.
State (string) --
The state of the VPC attachment.
SubnetIds (list) --
The IDs of the subnets.
CreationTime (datetime) --
The creation time.
Options (dict) --
The VPC attachment options.
DnsSupport (string) --
Indicates whether DNS support is enabled.
Ipv6Support (string) --
Indicates whether IPv6 support is enabled.
Tags (list) --
The tags for the VPC attachment.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
paginator = client.get_paginator('describe_transit_gateways')
Creates an iterator that will paginate through responses from EC2.Client.describe_transit_gateways().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
TransitGatewayIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The IDs of the transit gateways.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'TransitGateways': [
{
'TransitGatewayId': 'string',
'TransitGatewayArn': 'string',
'State': 'pending'|'available'|'modifying'|'deleting'|'deleted',
'OwnerId': 'string',
'Description': 'string',
'CreationTime': datetime(2015, 1, 1),
'Options': {
'AmazonSideAsn': 123,
'AutoAcceptSharedAttachments': 'enable'|'disable',
'DefaultRouteTableAssociation': 'enable'|'disable',
'AssociationDefaultRouteTableId': 'string',
'DefaultRouteTablePropagation': 'enable'|'disable',
'PropagationDefaultRouteTableId': 'string',
'VpnEcmpSupport': 'enable'|'disable',
'DnsSupport': 'enable'|'disable'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
}
Response Structure
(dict) --
TransitGateways (list) --
Information about the transit gateways.
(dict) --
Describes a transit gateway.
TransitGatewayId (string) --
The ID of the transit gateway.
TransitGatewayArn (string) --
The Amazon Resource Name (ARN) of the transit gateway.
State (string) --
The state of the transit gateway.
OwnerId (string) --
The ID of the AWS account ID that owns the transit gateway.
Description (string) --
The description of the transit gateway.
CreationTime (datetime) --
The creation time.
Options (dict) --
The transit gateway options.
AmazonSideAsn (integer) --
A private Autonomous System Number (ASN) for the Amazon side of a BGP session. The range is 64512 to 65534 for 16-bit ASNs and 4200000000 to 4294967294 for 32-bit ASNs.
AutoAcceptSharedAttachments (string) --
Indicates whether attachment requests are automatically accepted.
DefaultRouteTableAssociation (string) --
Indicates whether resource attachments are automatically associated with the default association route table.
AssociationDefaultRouteTableId (string) --
The ID of the default association route table.
DefaultRouteTablePropagation (string) --
Indicates whether resource attachments automatically propagate routes to the default propagation route table.
PropagationDefaultRouteTableId (string) --
The ID of the default propagation route table.
VpnEcmpSupport (string) --
Indicates whether Equal Cost Multipath Protocol support is enabled.
DnsSupport (string) --
Indicates whether DNS support is enabled.
Tags (list) --
The tags for the transit gateway.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
paginator = client.get_paginator('describe_volume_status')
Creates an iterator that will paginate through responses from EC2.Client.describe_volume_status().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
VolumeIds=[
'string',
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The IDs of the volumes.
Default: Describes all your volumes.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'VolumeStatuses': [
{
'Actions': [
{
'Code': 'string',
'Description': 'string',
'EventId': 'string',
'EventType': 'string'
},
],
'AvailabilityZone': 'string',
'Events': [
{
'Description': 'string',
'EventId': 'string',
'EventType': 'string',
'NotAfter': datetime(2015, 1, 1),
'NotBefore': datetime(2015, 1, 1)
},
],
'VolumeId': 'string',
'VolumeStatus': {
'Details': [
{
'Name': 'io-enabled'|'io-performance',
'Status': 'string'
},
],
'Status': 'ok'|'impaired'|'insufficient-data'
}
},
]
}
Response Structure
(dict) --
VolumeStatuses (list) --
Information about the status of the volumes.
(dict) --
Describes the volume status.
Actions (list) --
The details of the operation.
(dict) --
Describes a volume status operation code.
Code (string) --
The code identifying the operation, for example, enable-volume-io .
Description (string) --
A description of the operation.
EventId (string) --
The ID of the event associated with this operation.
EventType (string) --
The event type associated with this operation.
AvailabilityZone (string) --
The Availability Zone of the volume.
Events (list) --
A list of events associated with the volume.
(dict) --
Describes a volume status event.
Description (string) --
A description of the event.
EventId (string) --
The ID of this event.
EventType (string) --
The type of this event.
NotAfter (datetime) --
The latest end time of the event.
NotBefore (datetime) --
The earliest start time of the event.
VolumeId (string) --
The volume ID.
VolumeStatus (dict) --
The volume status.
Details (list) --
The details of the volume status.
(dict) --
Describes a volume status.
Name (string) --
The name of the volume status.
Status (string) --
The intended status of the volume status.
Status (string) --
The status of the volume.
paginator = client.get_paginator('describe_volumes')
Creates an iterator that will paginate through responses from EC2.Client.describe_volumes().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
VolumeIds=[
'string',
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The volume IDs.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Volumes': [
{
'Attachments': [
{
'AttachTime': datetime(2015, 1, 1),
'Device': 'string',
'InstanceId': 'string',
'State': 'attaching'|'attached'|'detaching'|'detached'|'busy',
'VolumeId': 'string',
'DeleteOnTermination': True|False
},
],
'AvailabilityZone': 'string',
'CreateTime': datetime(2015, 1, 1),
'Encrypted': True|False,
'KmsKeyId': 'string',
'Size': 123,
'SnapshotId': 'string',
'State': 'creating'|'available'|'in-use'|'deleting'|'deleted'|'error',
'VolumeId': 'string',
'Iops': 123,
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1'
},
],
}
Response Structure
(dict) --
Volumes (list) --
Information about the volumes.
(dict) --
Describes a volume.
Attachments (list) --
Information about the volume attachments.
(dict) --
Describes volume attachment details.
AttachTime (datetime) --
The time stamp when the attachment initiated.
Device (string) --
The device name.
InstanceId (string) --
The ID of the instance.
State (string) --
The attachment state of the volume.
VolumeId (string) --
The ID of the volume.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
AvailabilityZone (string) --
The Availability Zone for the volume.
CreateTime (datetime) --
The time stamp when volume creation was initiated.
Encrypted (boolean) --
Indicates whether the volume is encrypted.
KmsKeyId (string) --
The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the volume encryption key for the volume.
Size (integer) --
The size of the volume, in GiBs.
SnapshotId (string) --
The snapshot from which the volume was created, if applicable.
State (string) --
The volume state.
VolumeId (string) --
The ID of the volume.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports. For Provisioned IOPS SSD volumes, this represents the number of IOPS that are provisioned for the volume. For General Purpose SSD volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes, in most Regions. The maximum IOPS for io1 of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS.
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
Tags (list) --
Any tags assigned to the volume.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VolumeType (string) --
The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.
paginator = client.get_paginator('describe_volumes_modifications')
Creates an iterator that will paginate through responses from EC2.Client.describe_volumes_modifications().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
VolumeIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The IDs of the volumes for which in-progress modifications will be described.
The filters. Supported filters: volume-id , modification-state , target-size , target-iops , target-volume-type , original-size , original-iops , original-volume-type , start-time .
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'VolumesModifications': [
{
'VolumeId': 'string',
'ModificationState': 'modifying'|'optimizing'|'completed'|'failed',
'StatusMessage': 'string',
'TargetSize': 123,
'TargetIops': 123,
'TargetVolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'OriginalSize': 123,
'OriginalIops': 123,
'OriginalVolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Progress': 123,
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1)
},
],
}
Response Structure
(dict) --
VolumesModifications (list) --
Information about the volume modifications.
(dict) --
Describes the modification status of an EBS volume.
If the volume has never been modified, some element values will be null.
VolumeId (string) --
The ID of the volume.
ModificationState (string) --
The current modification state. The modification state is null for unmodified volumes.
StatusMessage (string) --
A status message about the modification progress or failure.
TargetSize (integer) --
The target size of the volume, in GiB.
TargetIops (integer) --
The target IOPS rate of the volume.
TargetVolumeType (string) --
The target EBS volume type of the volume.
OriginalSize (integer) --
The original size of the volume.
OriginalIops (integer) --
The original IOPS rate of the volume.
OriginalVolumeType (string) --
The original EBS volume type of the volume.
Progress (integer) --
The modification progress, from 0 to 100 percent complete.
StartTime (datetime) --
The modification start time.
EndTime (datetime) --
The modification completion or failure time.
paginator = client.get_paginator('describe_vpc_classic_link_dns_support')
Creates an iterator that will paginate through responses from EC2.Client.describe_vpc_classic_link_dns_support().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
VpcIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more VPC IDs.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Vpcs': [
{
'ClassicLinkDnsSupported': True|False,
'VpcId': 'string'
},
]
}
Response Structure
(dict) --
Vpcs (list) --
Information about the ClassicLink DNS support status of the VPCs.
(dict) --
Describes the ClassicLink DNS support status of a VPC.
ClassicLinkDnsSupported (boolean) --
Indicates whether ClassicLink DNS support is enabled for the VPC.
VpcId (string) --
The ID of the VPC.
paginator = client.get_paginator('describe_vpc_endpoint_connection_notifications')
Creates an iterator that will paginate through responses from EC2.Client.describe_vpc_endpoint_connection_notifications().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
ConnectionNotificationId='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'ConnectionNotificationSet': [
{
'ConnectionNotificationId': 'string',
'ServiceId': 'string',
'VpcEndpointId': 'string',
'ConnectionNotificationType': 'Topic',
'ConnectionNotificationArn': 'string',
'ConnectionEvents': [
'string',
],
'ConnectionNotificationState': 'Enabled'|'Disabled'
},
],
}
Response Structure
(dict) --
ConnectionNotificationSet (list) --
One or more notifications.
(dict) --
Describes a connection notification for a VPC endpoint or VPC endpoint service.
ConnectionNotificationId (string) --
The ID of the notification.
ServiceId (string) --
The ID of the endpoint service.
VpcEndpointId (string) --
The ID of the VPC endpoint.
ConnectionNotificationType (string) --
The type of notification.
ConnectionNotificationArn (string) --
The ARN of the SNS topic for the notification.
ConnectionEvents (list) --
The events for the notification. Valid values are Accept , Connect , Delete , and Reject .
ConnectionNotificationState (string) --
The state of the notification.
paginator = client.get_paginator('describe_vpc_endpoint_connections')
Creates an iterator that will paginate through responses from EC2.Client.describe_vpc_endpoint_connections().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'VpcEndpointConnections': [
{
'ServiceId': 'string',
'VpcEndpointId': 'string',
'VpcEndpointOwner': 'string',
'VpcEndpointState': 'PendingAcceptance'|'Pending'|'Available'|'Deleting'|'Deleted'|'Rejected'|'Failed'|'Expired',
'CreationTimestamp': datetime(2015, 1, 1),
'DnsEntries': [
{
'DnsName': 'string',
'HostedZoneId': 'string'
},
],
'NetworkLoadBalancerArns': [
'string',
]
},
],
}
Response Structure
(dict) --
VpcEndpointConnections (list) --
Information about one or more VPC endpoint connections.
(dict) --
Describes a VPC endpoint connection to a service.
ServiceId (string) --
The ID of the service to which the endpoint is connected.
VpcEndpointId (string) --
The ID of the VPC endpoint.
VpcEndpointOwner (string) --
The AWS account ID of the owner of the VPC endpoint.
VpcEndpointState (string) --
The state of the VPC endpoint.
CreationTimestamp (datetime) --
The date and time the VPC endpoint was created.
DnsEntries (list) --
The DNS entries for the VPC endpoint.
(dict) --
Describes a DNS entry.
DnsName (string) --
The DNS name.
HostedZoneId (string) --
The ID of the private hosted zone.
NetworkLoadBalancerArns (list) --
The Amazon Resource Names (ARNs) of the network load balancers for the service.
paginator = client.get_paginator('describe_vpc_endpoint_service_configurations')
Creates an iterator that will paginate through responses from EC2.Client.describe_vpc_endpoint_service_configurations().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
ServiceIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The IDs of one or more services.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'ServiceConfigurations': [
{
'ServiceType': [
{
'ServiceType': 'Interface'|'Gateway'
},
],
'ServiceId': 'string',
'ServiceName': 'string',
'ServiceState': 'Pending'|'Available'|'Deleting'|'Deleted'|'Failed',
'AvailabilityZones': [
'string',
],
'AcceptanceRequired': True|False,
'ManagesVpcEndpoints': True|False,
'NetworkLoadBalancerArns': [
'string',
],
'BaseEndpointDnsNames': [
'string',
],
'PrivateDnsName': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
}
Response Structure
(dict) --
ServiceConfigurations (list) --
Information about one or more services.
(dict) --
Describes a service configuration for a VPC endpoint service.
ServiceType (list) --
The type of service.
(dict) --
Describes the type of service for a VPC endpoint.
ServiceType (string) --
The type of service.
ServiceId (string) --
The ID of the service.
ServiceName (string) --
The name of the service.
ServiceState (string) --
The service state.
AvailabilityZones (list) --
In the Availability Zones in which the service is available.
AcceptanceRequired (boolean) --
Indicates whether requests from other AWS accounts to create an endpoint to the service must first be accepted.
ManagesVpcEndpoints (boolean) --
Indicates whether the service manages it's VPC endpoints. Management of the service VPC endpoints using the VPC endpoint API is restricted.
NetworkLoadBalancerArns (list) --
The Amazon Resource Names (ARNs) of the Network Load Balancers for the service.
BaseEndpointDnsNames (list) --
The DNS names for the service.
PrivateDnsName (string) --
The private DNS name for the service.
Tags (list) --
Any tags assigned to the service.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
paginator = client.get_paginator('describe_vpc_endpoint_service_permissions')
Creates an iterator that will paginate through responses from EC2.Client.describe_vpc_endpoint_service_permissions().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
ServiceId='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The ID of the service.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'AllowedPrincipals': [
{
'PrincipalType': 'All'|'Service'|'OrganizationUnit'|'Account'|'User'|'Role',
'Principal': 'string'
},
],
}
Response Structure
(dict) --
AllowedPrincipals (list) --
Information about one or more allowed principals.
(dict) --
Describes a principal.
PrincipalType (string) --
The type of principal.
Principal (string) --
The Amazon Resource Name (ARN) of the principal.
paginator = client.get_paginator('describe_vpc_endpoint_services')
Creates an iterator that will paginate through responses from EC2.Client.describe_vpc_endpoint_services().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
ServiceNames=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more service names.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'ServiceNames': [
'string',
],
'ServiceDetails': [
{
'ServiceName': 'string',
'ServiceId': 'string',
'ServiceType': [
{
'ServiceType': 'Interface'|'Gateway'
},
],
'AvailabilityZones': [
'string',
],
'Owner': 'string',
'BaseEndpointDnsNames': [
'string',
],
'PrivateDnsName': 'string',
'VpcEndpointPolicySupported': True|False,
'AcceptanceRequired': True|False,
'ManagesVpcEndpoints': True|False,
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
}
Response Structure
(dict) --
Contains the output of DescribeVpcEndpointServices.
ServiceNames (list) --
A list of supported services.
ServiceDetails (list) --
Information about the service.
(dict) --
Describes a VPC endpoint service.
ServiceName (string) --
The Amazon Resource Name (ARN) of the service.
ServiceId (string) --
The ID of the endpoint service.
ServiceType (list) --
The type of service.
(dict) --
Describes the type of service for a VPC endpoint.
ServiceType (string) --
The type of service.
AvailabilityZones (list) --
The Availability Zones in which the service is available.
Owner (string) --
The AWS account ID of the service owner.
BaseEndpointDnsNames (list) --
The DNS names for the service.
PrivateDnsName (string) --
The private DNS name for the service.
VpcEndpointPolicySupported (boolean) --
Indicates whether the service supports endpoint policies.
AcceptanceRequired (boolean) --
Indicates whether VPC endpoint connection requests to the service must be accepted by the service owner.
ManagesVpcEndpoints (boolean) --
Indicates whether the service manages it's VPC endpoints. Management of the service VPC endpoints using the VPC endpoint API is restricted.
Tags (list) --
Any tags assigned to the service.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
paginator = client.get_paginator('describe_vpc_endpoints')
Creates an iterator that will paginate through responses from EC2.Client.describe_vpc_endpoints().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
DryRun=True|False,
VpcEndpointIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more endpoint IDs.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'VpcEndpoints': [
{
'VpcEndpointId': 'string',
'VpcEndpointType': 'Interface'|'Gateway',
'VpcId': 'string',
'ServiceName': 'string',
'State': 'PendingAcceptance'|'Pending'|'Available'|'Deleting'|'Deleted'|'Rejected'|'Failed'|'Expired',
'PolicyDocument': 'string',
'RouteTableIds': [
'string',
],
'SubnetIds': [
'string',
],
'Groups': [
{
'GroupId': 'string',
'GroupName': 'string'
},
],
'PrivateDnsEnabled': True|False,
'RequesterManaged': True|False,
'NetworkInterfaceIds': [
'string',
],
'DnsEntries': [
{
'DnsName': 'string',
'HostedZoneId': 'string'
},
],
'CreationTimestamp': datetime(2015, 1, 1),
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'OwnerId': 'string'
},
],
}
Response Structure
(dict) --
Contains the output of DescribeVpcEndpoints.
VpcEndpoints (list) --
Information about the endpoints.
(dict) --
Describes a VPC endpoint.
VpcEndpointId (string) --
The ID of the VPC endpoint.
VpcEndpointType (string) --
The type of endpoint.
VpcId (string) --
The ID of the VPC to which the endpoint is associated.
ServiceName (string) --
The name of the service to which the endpoint is associated.
State (string) --
The state of the VPC endpoint.
PolicyDocument (string) --
The policy document associated with the endpoint, if applicable.
RouteTableIds (list) --
(Gateway endpoint) One or more route tables associated with the endpoint.
SubnetIds (list) --
(Interface endpoint) One or more subnets in which the endpoint is located.
Groups (list) --
(Interface endpoint) Information about the security groups associated with the network interface.
(dict) --
Describes a security group.
GroupId (string) --
The ID of the security group.
GroupName (string) --
The name of the security group.
PrivateDnsEnabled (boolean) --
(Interface endpoint) Indicates whether the VPC is associated with a private hosted zone.
RequesterManaged (boolean) --
Indicates whether the VPC endpoint is being managed by its service.
NetworkInterfaceIds (list) --
(Interface endpoint) One or more network interfaces for the endpoint.
DnsEntries (list) --
(Interface endpoint) The DNS entries for the endpoint.
(dict) --
Describes a DNS entry.
DnsName (string) --
The DNS name.
HostedZoneId (string) --
The ID of the private hosted zone.
CreationTimestamp (datetime) --
The date and time the VPC endpoint was created.
Tags (list) --
Any tags assigned to the VPC endpoint.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
OwnerId (string) --
The ID of the AWS account that owns the VPC endpoint.
paginator = client.get_paginator('describe_vpc_peering_connections')
Creates an iterator that will paginate through responses from EC2.Client.describe_vpc_peering_connections().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
VpcPeeringConnectionIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more VPC peering connection IDs.
Default: Describes all your VPC peering connections.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'VpcPeeringConnections': [
{
'AccepterVpcInfo': {
'CidrBlock': 'string',
'Ipv6CidrBlockSet': [
{
'Ipv6CidrBlock': 'string'
},
],
'CidrBlockSet': [
{
'CidrBlock': 'string'
},
],
'OwnerId': 'string',
'PeeringOptions': {
'AllowDnsResolutionFromRemoteVpc': True|False,
'AllowEgressFromLocalClassicLinkToRemoteVpc': True|False,
'AllowEgressFromLocalVpcToRemoteClassicLink': True|False
},
'VpcId': 'string',
'Region': 'string'
},
'ExpirationTime': datetime(2015, 1, 1),
'RequesterVpcInfo': {
'CidrBlock': 'string',
'Ipv6CidrBlockSet': [
{
'Ipv6CidrBlock': 'string'
},
],
'CidrBlockSet': [
{
'CidrBlock': 'string'
},
],
'OwnerId': 'string',
'PeeringOptions': {
'AllowDnsResolutionFromRemoteVpc': True|False,
'AllowEgressFromLocalClassicLinkToRemoteVpc': True|False,
'AllowEgressFromLocalVpcToRemoteClassicLink': True|False
},
'VpcId': 'string',
'Region': 'string'
},
'Status': {
'Code': 'initiating-request'|'pending-acceptance'|'active'|'deleted'|'rejected'|'failed'|'expired'|'provisioning'|'deleting',
'Message': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VpcPeeringConnectionId': 'string'
},
],
}
Response Structure
(dict) --
VpcPeeringConnections (list) --
Information about the VPC peering connections.
(dict) --
Describes a VPC peering connection.
AccepterVpcInfo (dict) --
Information about the accepter VPC. CIDR block information is only returned when describing an active VPC peering connection.
CidrBlock (string) --
The IPv4 CIDR block for the VPC.
Ipv6CidrBlockSet (list) --
The IPv6 CIDR block for the VPC.
(dict) --
Describes an IPv6 CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
CidrBlockSet (list) --
Information about the IPv4 CIDR blocks for the VPC.
(dict) --
Describes an IPv4 CIDR block.
CidrBlock (string) --
The IPv4 CIDR block.
OwnerId (string) --
The AWS account ID of the VPC owner.
PeeringOptions (dict) --
Information about the VPC peering connection options for the accepter or requester VPC.
AllowDnsResolutionFromRemoteVpc (boolean) --
Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
AllowEgressFromLocalClassicLinkToRemoteVpc (boolean) --
Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection.
AllowEgressFromLocalVpcToRemoteClassicLink (boolean) --
Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection.
VpcId (string) --
The ID of the VPC.
Region (string) --
The Region in which the VPC is located.
ExpirationTime (datetime) --
The time that an unaccepted VPC peering connection will expire.
RequesterVpcInfo (dict) --
Information about the requester VPC. CIDR block information is only returned when describing an active VPC peering connection.
CidrBlock (string) --
The IPv4 CIDR block for the VPC.
Ipv6CidrBlockSet (list) --
The IPv6 CIDR block for the VPC.
(dict) --
Describes an IPv6 CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
CidrBlockSet (list) --
Information about the IPv4 CIDR blocks for the VPC.
(dict) --
Describes an IPv4 CIDR block.
CidrBlock (string) --
The IPv4 CIDR block.
OwnerId (string) --
The AWS account ID of the VPC owner.
PeeringOptions (dict) --
Information about the VPC peering connection options for the accepter or requester VPC.
AllowDnsResolutionFromRemoteVpc (boolean) --
Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
AllowEgressFromLocalClassicLinkToRemoteVpc (boolean) --
Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection.
AllowEgressFromLocalVpcToRemoteClassicLink (boolean) --
Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection.
VpcId (string) --
The ID of the VPC.
Region (string) --
The Region in which the VPC is located.
Status (dict) --
The status of the VPC peering connection.
Code (string) --
The status of the VPC peering connection.
Message (string) --
A message that provides more information about the status, if applicable.
Tags (list) --
Any tags assigned to the resource.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
VpcPeeringConnectionId (string) --
The ID of the VPC peering connection.
paginator = client.get_paginator('describe_vpcs')
Creates an iterator that will paginate through responses from EC2.Client.describe_vpcs().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
VpcIds=[
'string',
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more VPC IDs.
Default: Describes all your VPCs.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Vpcs': [
{
'CidrBlock': 'string',
'DhcpOptionsId': 'string',
'State': 'pending'|'available',
'VpcId': 'string',
'OwnerId': 'string',
'InstanceTenancy': 'default'|'dedicated'|'host',
'Ipv6CidrBlockAssociationSet': [
{
'AssociationId': 'string',
'Ipv6CidrBlock': 'string',
'Ipv6CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
}
},
],
'CidrBlockAssociationSet': [
{
'AssociationId': 'string',
'CidrBlock': 'string',
'CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
}
},
],
'IsDefault': True|False,
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
}
Response Structure
(dict) --
Vpcs (list) --
Information about one or more VPCs.
(dict) --
Describes a VPC.
CidrBlock (string) --
The primary IPv4 CIDR block for the VPC.
DhcpOptionsId (string) --
The ID of the set of DHCP options you've associated with the VPC (or default if the default options are associated with the VPC).
State (string) --
The current state of the VPC.
VpcId (string) --
The ID of the VPC.
OwnerId (string) --
The ID of the AWS account that owns the VPC.
InstanceTenancy (string) --
The allowed tenancy of instances launched into the VPC.
Ipv6CidrBlockAssociationSet (list) --
Information about the IPv6 CIDR blocks associated with the VPC.
(dict) --
Describes an IPv6 CIDR block associated with a VPC.
AssociationId (string) --
The association ID for the IPv6 CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
Ipv6CidrBlockState (dict) --
Information about the state of the CIDR block.
State (string) --
The state of the CIDR block.
StatusMessage (string) --
A message about the status of the CIDR block, if applicable.
CidrBlockAssociationSet (list) --
Information about the IPv4 CIDR blocks associated with the VPC.
(dict) --
Describes an IPv4 CIDR block associated with a VPC.
AssociationId (string) --
The association ID for the IPv4 CIDR block.
CidrBlock (string) --
The IPv4 CIDR block.
CidrBlockState (dict) --
Information about the state of the CIDR block.
State (string) --
The state of the CIDR block.
StatusMessage (string) --
A message about the status of the CIDR block, if applicable.
IsDefault (boolean) --
Indicates whether the VPC is the default VPC.
Tags (list) --
Any tags assigned to the VPC.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
paginator = client.get_paginator('get_transit_gateway_attachment_propagations')
Creates an iterator that will paginate through responses from EC2.Client.get_transit_gateway_attachment_propagations().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
TransitGatewayAttachmentId='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The ID of the attachment.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'TransitGatewayAttachmentPropagations': [
{
'TransitGatewayRouteTableId': 'string',
'State': 'enabling'|'enabled'|'disabling'|'disabled'
},
],
}
Response Structure
(dict) --
TransitGatewayAttachmentPropagations (list) --
Information about the propagation route tables.
(dict) --
Describes a propagation route table.
TransitGatewayRouteTableId (string) --
The ID of the propagation route table.
State (string) --
The state of the propagation route table.
paginator = client.get_paginator('get_transit_gateway_route_table_associations')
Creates an iterator that will paginate through responses from EC2.Client.get_transit_gateway_route_table_associations().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
TransitGatewayRouteTableId='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The ID of the transit gateway route table.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Associations': [
{
'TransitGatewayAttachmentId': 'string',
'ResourceId': 'string',
'ResourceType': 'vpc'|'vpn'|'direct-connect-gateway',
'State': 'associating'|'associated'|'disassociating'|'disassociated'
},
],
}
Response Structure
(dict) --
Associations (list) --
Information about the associations.
(dict) --
Describes an association between a route table and a resource attachment.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
ResourceId (string) --
The ID of the resource.
ResourceType (string) --
The resource type.
State (string) --
The state of the association.
paginator = client.get_paginator('get_transit_gateway_route_table_propagations')
Creates an iterator that will paginate through responses from EC2.Client.get_transit_gateway_route_table_propagations().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
TransitGatewayRouteTableId='string',
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The ID of the transit gateway route table.
One or more filters. The possible values are:
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'TransitGatewayRouteTablePropagations': [
{
'TransitGatewayAttachmentId': 'string',
'ResourceId': 'string',
'ResourceType': 'vpc'|'vpn'|'direct-connect-gateway',
'State': 'enabling'|'enabled'|'disabling'|'disabled'
},
],
}
Response Structure
(dict) --
TransitGatewayRouteTablePropagations (list) --
Information about the route table propagations.
(dict) --
Describes a route table propagation.
TransitGatewayAttachmentId (string) --
The ID of the attachment.
ResourceId (string) --
The ID of the resource.
ResourceType (string) --
The type of resource.
State (string) --
The state of the resource.
The available waiters are:
waiter = client.get_waiter('bundle_task_complete')
Polls EC2.Client.describe_bundle_tasks() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
BundleIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
The bundle task IDs.
Default: Describes all your bundle tasks.
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('conversion_task_cancelled')
Polls EC2.Client.describe_conversion_tasks() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
ConversionTaskIds=[
'string',
],
DryRun=True|False,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
The conversion task IDs.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('conversion_task_completed')
Polls EC2.Client.describe_conversion_tasks() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
ConversionTaskIds=[
'string',
],
DryRun=True|False,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
The conversion task IDs.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('conversion_task_deleted')
Polls EC2.Client.describe_conversion_tasks() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
ConversionTaskIds=[
'string',
],
DryRun=True|False,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
The conversion task IDs.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('customer_gateway_available')
Polls EC2.Client.describe_customer_gateways() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
CustomerGatewayIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
One or more customer gateway IDs.
Default: Describes all your customer gateways.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('export_task_cancelled')
Polls EC2.Client.describe_export_tasks() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
ExportTaskIds=[
'string',
],
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
The export task IDs.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('export_task_completed')
Polls EC2.Client.describe_export_tasks() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
ExportTaskIds=[
'string',
],
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
The export task IDs.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('image_available')
Polls EC2.Client.describe_images() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
ExecutableUsers=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
ImageIds=[
'string',
],
Owners=[
'string',
],
DryRun=True|False,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
Scopes the images by users with explicit launch permissions. Specify an AWS account ID, self (the sender of the request), or all (public AMIs).
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The image IDs.
Default: Describes all images available to you.
Filters the images by the owner. Specify an AWS account ID, self (owner is the sender of the request), or an AWS owner alias (valid values are amazon | aws-marketplace | microsoft ). Omitting this option returns all images for which you have launch permissions, regardless of ownership.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('image_exists')
Polls EC2.Client.describe_images() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
ExecutableUsers=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
ImageIds=[
'string',
],
Owners=[
'string',
],
DryRun=True|False,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
Scopes the images by users with explicit launch permissions. Specify an AWS account ID, self (the sender of the request), or all (public AMIs).
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The image IDs.
Default: Describes all images available to you.
Filters the images by the owner. Specify an AWS account ID, self (owner is the sender of the request), or an AWS owner alias (valid values are amazon | aws-marketplace | microsoft ). Omitting this option returns all images for which you have launch permissions, regardless of ownership.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('instance_exists')
Polls EC2.Client.describe_instances() every 5 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
InstanceIds=[
'string',
],
DryRun=True|False,
MaxResults=123,
NextToken='string',
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The instance IDs.
Default: Describes all your instances.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 5
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('instance_running')
Polls EC2.Client.describe_instances() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
InstanceIds=[
'string',
],
DryRun=True|False,
MaxResults=123,
NextToken='string',
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The instance IDs.
Default: Describes all your instances.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('instance_status_ok')
Polls EC2.Client.describe_instance_status() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
InstanceIds=[
'string',
],
MaxResults=123,
NextToken='string',
DryRun=True|False,
IncludeAllInstances=True|False,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The instance IDs.
Default: Describes all your instances.
Constraints: Maximum 100 explicitly specified instance IDs.
When true , includes the health status for all instances. When false , includes the health status for running instances only.
Default: false
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('instance_stopped')
Polls EC2.Client.describe_instances() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
InstanceIds=[
'string',
],
DryRun=True|False,
MaxResults=123,
NextToken='string',
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The instance IDs.
Default: Describes all your instances.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('instance_terminated')
Polls EC2.Client.describe_instances() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
InstanceIds=[
'string',
],
DryRun=True|False,
MaxResults=123,
NextToken='string',
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The instance IDs.
Default: Describes all your instances.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('key_pair_exists')
Polls EC2.Client.describe_key_pairs() every 5 seconds until a successful state is reached. An error is returned after 6 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
KeyNames=[
'string',
],
DryRun=True|False,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The key pair names.
Default: Describes all your key pairs.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 5
The maximum number of attempts to be made. Default: 6
None
waiter = client.get_waiter('nat_gateway_available')
Polls EC2.Client.describe_nat_gateways() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NatGatewayIds=[
'string',
],
NextToken='string',
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more NAT gateway IDs.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('network_interface_available')
Polls EC2.Client.describe_network_interfaces() every 20 seconds until a successful state is reached. An error is returned after 10 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
NetworkInterfaceIds=[
'string',
],
NextToken='string',
MaxResults=123,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more network interface IDs.
Default: Describes all your network interfaces.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 20
The maximum number of attempts to be made. Default: 10
None
waiter = client.get_waiter('password_data_available')
Polls EC2.Client.get_password_data() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
InstanceId='string',
DryRun=True|False,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
[REQUIRED]
The ID of the Windows instance.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('snapshot_completed')
Polls EC2.Client.describe_snapshots() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string',
OwnerIds=[
'string',
],
RestorableByUserIds=[
'string',
],
SnapshotIds=[
'string',
],
DryRun=True|False,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
Describes the snapshots owned by these owners.
The IDs of the AWS accounts that can create volumes from the snapshot.
The snapshot IDs.
Default: Describes the snapshots for which you have create volume permissions.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('spot_instance_request_fulfilled')
Polls EC2.Client.describe_spot_instance_requests() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
SpotInstanceRequestIds=[
'string',
],
NextToken='string',
MaxResults=123,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more Spot Instance request IDs.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('subnet_available')
Polls EC2.Client.describe_subnets() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
SubnetIds=[
'string',
],
DryRun=True|False,
NextToken='string',
MaxResults=123,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more subnet IDs.
Default: Describes all your subnets.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('system_status_ok')
Polls EC2.Client.describe_instance_status() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
InstanceIds=[
'string',
],
MaxResults=123,
NextToken='string',
DryRun=True|False,
IncludeAllInstances=True|False,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The instance IDs.
Default: Describes all your instances.
Constraints: Maximum 100 explicitly specified instance IDs.
When true , includes the health status for all instances. When false , includes the health status for running instances only.
Default: false
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('volume_available')
Polls EC2.Client.describe_volumes() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
VolumeIds=[
'string',
],
DryRun=True|False,
MaxResults=123,
NextToken='string',
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The volume IDs.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('volume_deleted')
Polls EC2.Client.describe_volumes() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
VolumeIds=[
'string',
],
DryRun=True|False,
MaxResults=123,
NextToken='string',
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The volume IDs.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('volume_in_use')
Polls EC2.Client.describe_volumes() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
VolumeIds=[
'string',
],
DryRun=True|False,
MaxResults=123,
NextToken='string',
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The volume IDs.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('vpc_available')
Polls EC2.Client.describe_vpcs() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
VpcIds=[
'string',
],
DryRun=True|False,
NextToken='string',
MaxResults=123,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more VPC IDs.
Default: Describes all your VPCs.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('vpc_exists')
Polls EC2.Client.describe_vpcs() every 1 seconds until a successful state is reached. An error is returned after 5 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
VpcIds=[
'string',
],
DryRun=True|False,
NextToken='string',
MaxResults=123,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more VPC IDs.
Default: Describes all your VPCs.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 1
The maximum number of attempts to be made. Default: 5
None
waiter = client.get_waiter('vpc_peering_connection_deleted')
Polls EC2.Client.describe_vpc_peering_connections() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
VpcPeeringConnectionIds=[
'string',
],
NextToken='string',
MaxResults=123,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more VPC peering connection IDs.
Default: Describes all your VPC peering connections.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('vpc_peering_connection_exists')
Polls EC2.Client.describe_vpc_peering_connections() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
VpcPeeringConnectionIds=[
'string',
],
NextToken='string',
MaxResults=123,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more VPC peering connection IDs.
Default: Describes all your VPC peering connections.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('vpn_connection_available')
Polls EC2.Client.describe_vpn_connections() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
VpnConnectionIds=[
'string',
],
DryRun=True|False,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more VPN connection IDs.
Default: Describes your VPN connections.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
waiter = client.get_waiter('vpn_connection_deleted')
Polls EC2.Client.describe_vpn_connections() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
VpnConnectionIds=[
'string',
],
DryRun=True|False,
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more VPN connection IDs.
Default: Describes your VPN connections.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 15
The maximum number of attempts to be made. Default: 40
None
A resource representing Amazon Elastic Compute Cloud (EC2):
import boto3
ec2 = boto3.resource('ec2')
These are the resource's available actions:
These are the resource's available sub-resources:
These are the resource's available collections:
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.
Creates a set of DHCP options for your VPC. After creating the set, you must associate it with the VPC, causing all existing and new instances that you launch in the VPC to use this set of DHCP options. The following are the individual DHCP options you can specify. For more information about the options, see RFC 2132 .
Your VPC automatically starts out with a set of DHCP options that includes only a DNS server that we provide (AmazonProvidedDNS). If you create a set of options, and if your VPC has an internet gateway, make sure to set the domain-name-servers option either to AmazonProvidedDNS or to a domain name server of your choice. For more information, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
dhcp_options = ec2.create_dhcp_options(
DhcpConfigurations=[
{
'Key': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False
)
[REQUIRED]
A DHCP configuration option.
ec2.DhcpOptions
DhcpOptions resource
Launches the specified number of instances using an AMI for which you have permissions.
You can specify a number of options, or leave the default options. The following rules apply:
You can create a launch template , which is a resource that contains the parameters to launch an instance. When you launch an instance using RunInstances , you can specify the launch template instead of specifying the launch parameters.
To ensure faster instance launches, break up large requests into smaller batches. For example, create five separate launch requests for 100 instances each instead of one launch request for 500 instances.
An instance is ready for you to use when it's in the running state. You can check the state of your instance using DescribeInstances . You can tag instances and EBS volumes during launch, after launch, or both. For more information, see CreateTags and Tagging Your Amazon EC2 Resources .
Linux instances have access to the public key of the key pair at boot. You can use this key to provide secure access to the instance. Amazon EC2 public images use this feature to provide secure access without passwords. For more information, see Key Pairs in the Amazon Elastic Compute Cloud User Guide .
For troubleshooting, see What To Do If An Instance Immediately Terminates , and Troubleshooting Connecting to Your Instance in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
instance = ec2.create_instances(
BlockDeviceMappings=[
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'Iops': 123,
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Encrypted': True|False,
'KmsKeyId': 'string'
},
'NoDevice': 'string'
},
],
ImageId='string',
InstanceType='t1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
Ipv6AddressCount=123,
Ipv6Addresses=[
{
'Ipv6Address': 'string'
},
],
KernelId='string',
KeyName='string',
MaxCount=123,
MinCount=123,
Monitoring={
'Enabled': True|False
},
Placement={
'AvailabilityZone': 'string',
'Affinity': 'string',
'GroupName': 'string',
'PartitionNumber': 123,
'HostId': 'string',
'Tenancy': 'default'|'dedicated'|'host',
'SpreadDomain': 'string'
},
RamdiskId='string',
SecurityGroupIds=[
'string',
],
SecurityGroups=[
'string',
],
SubnetId='string',
UserData='string',
AdditionalInfo='string',
ClientToken='string',
DisableApiTermination=True|False,
DryRun=True|False,
EbsOptimized=True|False,
IamInstanceProfile={
'Arn': 'string',
'Name': 'string'
},
InstanceInitiatedShutdownBehavior='stop'|'terminate',
NetworkInterfaces=[
{
'AssociatePublicIpAddress': True|False,
'DeleteOnTermination': True|False,
'Description': 'string',
'DeviceIndex': 123,
'Groups': [
'string',
],
'Ipv6AddressCount': 123,
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'NetworkInterfaceId': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
'SecondaryPrivateIpAddressCount': 123,
'SubnetId': 'string',
'InterfaceType': 'string'
},
],
PrivateIpAddress='string',
ElasticGpuSpecification=[
{
'Type': 'string'
},
],
ElasticInferenceAccelerators=[
{
'Type': 'string'
},
],
TagSpecifications=[
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
LaunchTemplate={
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'Version': 'string'
},
InstanceMarketOptions={
'MarketType': 'spot',
'SpotOptions': {
'MaxPrice': 'string',
'SpotInstanceType': 'one-time'|'persistent',
'BlockDurationMinutes': 123,
'ValidUntil': datetime(2015, 1, 1),
'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate'
}
},
CreditSpecification={
'CpuCredits': 'string'
},
CpuOptions={
'CoreCount': 123,
'ThreadsPerCore': 123
},
CapacityReservationSpecification={
'CapacityReservationPreference': 'open'|'none',
'CapacityReservationTarget': {
'CapacityReservationId': 'string'
}
},
HibernationOptions={
'Configured': True|False
},
LicenseSpecifications=[
{
'LicenseConfigurationArn': 'string'
},
]
)
The block device mapping entries.
Describes a block device mapping.
The device name (for example, /dev/sdh or xvdh ).
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Parameters used to automatically set up EBS volumes when the instance is launched.
Indicates whether the EBS volume is deleted on instance termination.
The number of I/O operations per second (IOPS) that the volume supports. For io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
The ID of the snapshot.
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Constraints: 1-16384 for General Purpose SSD (gp2 ), 4-16384 for Provisioned IOPS SSD (io1 ), 500-16384 for Throughput Optimized HDD (st1 ), 500-16384 for Cold HDD (sc1 ), and 1-1024 for Magnetic (standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
The volume type. If you set the type to io1 , you must also set the Iops property.
Default: standard
Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
In no case can you remove encryption from an encrypted volume.
Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is encrypted.
This parameter is only supported on BlockDeviceMapping objects called by RunInstances , RequestSpotFleet , and RequestSpotInstances .
Suppresses the specified device included in the block device mapping of the AMI.
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide .
Default: m1.small
[EC2-VPC] The number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.
You cannot specify this option and the network interfaces option in the same request.
[EC2-VPC] The IPv6 addresses from the range of the subnet to associate with the primary network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.
You cannot specify this option and the network interfaces option in the same request.
Describes an IPv6 address.
The IPv6 address.
The ID of the kernel.
Warning
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB in the Amazon Elastic Compute Cloud User Guide .
The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair .
Warning
If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.
[REQUIRED]
The maximum number of instances to launch. If you specify more instances than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches the largest possible number of instances above MinCount .
Constraints: Between 1 and the maximum number you're allowed for the specified instance type. For more information about the default limits, and how to request an increase, see How many instances can I run in Amazon EC2 in the Amazon EC2 FAQ.
[REQUIRED]
The minimum number of instances to launch. If you specify a minimum that is more instances than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches no instances.
Constraints: Between 1 and the maximum number you're allowed for the specified instance type. For more information about the default limits, and how to request an increase, see How many instances can I run in Amazon EC2 in the Amazon EC2 General FAQ.
Specifies whether detailed monitoring is enabled for the instance.
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
The placement for the instance.
The Availability Zone of the instance.
If not specified, an Availability Zone will be automatically chosen for you based on the load balancing criteria for the Region.
The affinity setting for the instance on the Dedicated Host. This parameter is not supported for the ImportInstance command.
The name of the placement group the instance is in.
The number of the partition the instance is in. Valid only if the placement group strategy is set to partition .
The ID of the Dedicated Host on which the instance resides. This parameter is not supported for the ImportInstance command.
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for the ImportInstance command.
Reserved for future use.
The ID of the RAM disk to select. Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, go to the AWS Resource Center and search for the kernel ID.
Warning
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB in the Amazon Elastic Compute Cloud User Guide .
The IDs of the security groups. You can create a security group using CreateSecurityGroup .
If you specify a network interface, you must specify any security groups as part of the network interface.
[EC2-Classic, default VPC] The names of the security groups. For a nondefault VPC, you must use security group IDs instead.
If you specify a network interface, you must specify any security groups as part of the network interface.
Default: Amazon EC2 uses the default security group.
[EC2-VPC] The ID of the subnet to launch the instance into.
If you specify a network interface, you must specify any subnets as part of the network interface.
The user data to make available to the instance. For more information, see Running Commands on Your Linux Instance at Launch (Linux) and Adding User Data (Windows). If you are using a command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text. User data is limited to 16 KB.
This value will be base64 encoded automatically. Do not base64 encode this value prior to performing the operation.
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency .
Constraints: Maximum 64 ASCII characters
If you set this parameter to true , you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. To change this attribute after launch, use ModifyInstanceAttribute . Alternatively, if you set InstanceInitiatedShutdownBehavior to terminate , you can terminate the instance by running the shutdown command from the instance.
Default: false
Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.
Default: false
The IAM instance profile.
The Amazon Resource Name (ARN) of the instance profile.
The name of the instance profile.
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
Default: stop
The network interfaces to associate with the instance. If you specify a network interface, you must specify any security groups and subnets as part of the network interface.
Describes a network interface.
Indicates whether to assign a public IPv4 address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is true .
If set to true , the interface is deleted when the instance is terminated. You can specify true only if creating a new network interface when launching an instance.
The description of the network interface. Applies only if creating a network interface when launching an instance.
The position of the network interface in the attachment order. A primary network interface has a device index of 0.
If you specify a network interface when launching an instance, you must specify the device index.
The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.
A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.
One or more IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.
Describes an IPv6 address.
The IPv6 address.
The ID of the network interface.
The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance. You cannot specify this option if you're launching more than one instance in a RunInstances request.
One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you're launching more than one instance in a RunInstances request.
Describes a secondary private IPv4 address for a network interface.
Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.
The private IPv4 addresses.
The number of secondary private IPv4 addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you're launching more than one instance in a RunInstances request.
The ID of the subnet associated with the network string. Applies only if creating a network interface when launching an instance.
The type of network interface. To create an Elastic Fabric Adapter (EFA), specify efa . For more information, see Elastic Fabric Adapter in the Amazon Elastic Compute Cloud User Guide .
If you are not creating an EFA, specify interface or omit this parameter.
Valid values: interface | efa
[EC2-VPC] The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.
Only one private IP address can be designated as primary. You can't specify this option if you've specified the option to designate a private IP address as the primary IP address in a network interface specification. You cannot specify this option if you're launching more than one instance in the request.
You cannot specify this option and the network interfaces option in the same request.
An elastic GPU to associate with the instance. An Elastic GPU is a GPU resource that you can attach to your Windows instance to accelerate the graphics performance of your applications. For more information, see Amazon EC2 Elastic GPUs in the Amazon Elastic Compute Cloud User Guide .
A specification for an Elastic Graphics accelerator.
The type of Elastic Graphics accelerator.
An elastic inference accelerator to associate with the instance. Elastic inference accelerators are a resource you can attach to your Amazon EC2 instances to accelerate your Deep Learning (DL) inference workloads.
Describes an elastic inference accelerator.
The type of elastic inference accelerator. The possible values are eia1.small , eia1.medium , and eia1.large .
The tags to apply to the resources during launch. You can only tag instances and volumes on launch. The specified tags are applied to all instances or volumes that are created during launch. To tag a resource after it has been created, see CreateTags .
The tags to apply to a resource when the resource is being created.
The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
The launch template to use to launch the instances. Any parameters that you specify in RunInstances override the same parameters in the launch template. You can specify either the name or ID of a launch template, but not both.
The ID of the launch template.
The name of the launch template.
The version number of the launch template.
Default: The default version for the launch template.
The market (purchasing) option for the instances.
For RunInstances , persistent Spot Instance requests are only supported when InstanceInterruptionBehavior is set to either hibernate or stop .
The market type.
The options for Spot Instances.
The maximum hourly price you're willing to pay for the Spot Instances. The default is the On-Demand price.
The Spot Instance request type. For RunInstances , persistent Spot Instance requests are only supported when InstanceInterruptionBehavior is set to either hibernate or stop .
The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).
The end date of the request. For a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached. The default end date is 7 days from the current date.
The behavior when a Spot Instance is interrupted. The default is terminate .
The credit option for CPU usage of the T2 or T3 instance. Valid values are standard and unlimited . To change this attribute after launch, use ModifyInstanceCreditSpecification . For more information, see Burstable Performance Instances in the Amazon Elastic Compute Cloud User Guide .
Default: standard (T2 instances) or unlimited (T3 instances)
The credit option for CPU usage of a T2 or T3 instance. Valid values are standard and unlimited .
The CPU options for the instance. For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide .
The number of CPU cores for the instance.
The number of threads per CPU core. To disable Intel Hyper-Threading Technology for the instance, specify a value of 1 . Otherwise, specify the default value of 2 .
Information about the Capacity Reservation targeting option. If you do not specify this parameter, the instance's Capacity Reservation preference defaults to open , which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
Information about the target Capacity Reservation.
The ID of the Capacity Reservation.
Indicates whether an instance is enabled for hibernation. For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
If you set this parameter to true , your instance is enabled for hibernation.
Default: false
The license configurations.
Describes a license configuration.
The Amazon Resource Name (ARN) of the license configuration.
list(ec2.Instance)
A list of Instance resources
Creates an internet gateway for use with a VPC. After creating the internet gateway, you attach it to a VPC using AttachInternetGateway .
For more information about your VPC and internet gateway, see the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
internet_gateway = ec2.create_internet_gateway(
DryRun=True|False
)
Creates a 2048-bit RSA key pair with the specified name. Amazon EC2 stores the public key and displays the private key for you to save to a file. The private key is returned as an unencrypted PEM encoded PKCS#1 private key. If a key with the specified name already exists, Amazon EC2 returns an error.
You can have up to five thousand key pairs per Region.
The key pair returned to you is available only in the Region in which you create it. If you prefer, you can create your own key pair using a third-party tool and upload it to any Region using ImportKeyPair .
For more information, see Key Pairs in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
key_pair = ec2.create_key_pair(
KeyName='string',
DryRun=True|False
)
[REQUIRED]
A unique name for the key pair.
Constraints: Up to 255 ASCII characters
ec2.KeyPair
KeyPair resource
Creates a network ACL in a VPC. Network ACLs provide an optional layer of security (in addition to security groups) for the instances in your VPC.
For more information, see Network ACLs in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
network_acl = ec2.create_network_acl(
DryRun=True|False,
VpcId='string'
)
[REQUIRED]
The ID of the VPC.
ec2.NetworkAcl
NetworkAcl resource
Creates a network interface in the specified subnet.
For more information about network interfaces, see Elastic Network Interfaces in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
network_interface = ec2.create_network_interface(
Description='string',
DryRun=True|False,
Groups=[
'string',
],
Ipv6AddressCount=123,
Ipv6Addresses=[
{
'Ipv6Address': 'string'
},
],
PrivateIpAddress='string',
PrivateIpAddresses=[
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
SecondaryPrivateIpAddressCount=123,
InterfaceType='efa',
SubnetId='string'
)
The IDs of one or more security groups.
One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. You can't use this option if you're specifying a number of IPv6 addresses.
Describes an IPv6 address.
The IPv6 address.
One or more private IPv4 addresses.
Describes a secondary private IPv4 address for a network interface.
Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.
The private IPv4 addresses.
The number of secondary private IPv4 addresses to assign to a network interface. When you specify a number of secondary IPv4 addresses, Amazon EC2 selects these IP addresses within the subnet's IPv4 CIDR range. You can't specify this option and specify more than one private IP address using privateIpAddresses .
The number of IP addresses you can assign to a network interface varies by instance type. For more information, see IP Addresses Per ENI Per Instance Type in the Amazon Virtual Private Cloud User Guide .
[REQUIRED]
The ID of the subnet to associate with the network interface.
ec2.NetworkInterface
NetworkInterface resource
Creates a placement group in which to launch instances. The strategy of the placement group determines how the instances are organized within the group.
A cluster placement group is a logical grouping of instances within a single Availability Zone that benefit from low network latency, high network throughput. A spread placement group places instances on distinct hardware. A partition placement group places groups of instances in different partitions, where instances in one partition do not share the same hardware with instances in another partition.
For more information, see Placement Groups in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
placement_group = ec2.create_placement_group(
DryRun=True|False,
GroupName='string',
Strategy='cluster'|'spread'|'partition',
PartitionCount=123
)
A name for the placement group. Must be unique within the scope of your account for the Region.
Constraints: Up to 255 ASCII characters
ec2.PlacementGroup
PlacementGroup resource
Creates a route table for the specified VPC. After you create a route table, you can add routes and associate the table with a subnet.
For more information, see Route Tables in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
route_table = ec2.create_route_table(
DryRun=True|False,
VpcId='string'
)
[REQUIRED]
The ID of the VPC.
ec2.RouteTable
RouteTable resource
Creates a security group.
A security group acts as a virtual firewall for your instance to control inbound and outbound traffic. For more information, see Amazon EC2 Security Groups in the Amazon Elastic Compute Cloud User Guide and Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide .
When you create a security group, you specify a friendly name of your choice. You can have a security group for use in EC2-Classic with the same name as a security group for use in a VPC. However, you can't have two security groups for use in EC2-Classic with the same name or two security groups for use in a VPC with the same name.
You have a default security group for use in EC2-Classic and a default security group for use in your VPC. If you don't specify a security group when you launch an instance, the instance is launched into the appropriate default security group. A default security group includes a default rule that grants instances unrestricted network access to each other.
You can add or remove rules from your security groups using AuthorizeSecurityGroupIngress , AuthorizeSecurityGroupEgress , RevokeSecurityGroupIngress , and RevokeSecurityGroupEgress .
For more information about VPC security group limits, see Amazon VPC Limits .
See also: AWS API Documentation
Request Syntax
security_group = ec2.create_security_group(
Description='string',
GroupName='string',
VpcId='string',
DryRun=True|False
)
[REQUIRED]
A description for the security group. This is informational only.
Constraints: Up to 255 characters in length
Constraints for EC2-Classic: ASCII characters
Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*
[REQUIRED]
The name of the security group.
Constraints: Up to 255 characters in length. Cannot start with sg- .
Constraints for EC2-Classic: ASCII characters
Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*
ec2.SecurityGroup
SecurityGroup resource
Creates a snapshot of an EBS volume and stores it in Amazon S3. You can use snapshots for backups, to make copies of EBS volumes, and to save data before shutting down an instance.
When a snapshot is created, any AWS Marketplace product codes that are associated with the source volume are propagated to the snapshot.
You can take a snapshot of an attached volume that is in use. However, snapshots only capture data that has been written to your EBS volume at the time the snapshot command is issued; this may exclude any data that has been cached by any applications or the operating system. If you can pause any file systems on the volume long enough to take a snapshot, your snapshot should be complete. However, if you cannot pause all file writes to the volume, you should unmount the volume from within the instance, issue the snapshot command, and then remount the volume to ensure a consistent and complete snapshot. You may remount and use your volume while the snapshot status is pending .
To create a snapshot for EBS volumes that serve as root devices, you should stop the instance before taking the snapshot.
Snapshots that are taken from encrypted volumes are automatically encrypted. Volumes that are created from encrypted snapshots are also automatically encrypted. Your encrypted volumes and any associated snapshots always remain protected.
You can tag your snapshots during creation. For more information, see Tagging Your Amazon EC2 Resources in the Amazon Elastic Compute Cloud User Guide .
For more information, see Amazon Elastic Block Store and Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
snapshot = ec2.create_snapshot(
Description='string',
VolumeId='string',
TagSpecifications=[
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
DryRun=True|False
)
[REQUIRED]
The ID of the EBS volume.
The tags to apply to the snapshot during creation.
The tags to apply to a resource when the resource is being created.
The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
ec2.Snapshot
Snapshot resource
Creates a subnet in an existing VPC.
When you create each subnet, you provide the VPC ID and IPv4 CIDR block for the subnet. After you create a subnet, you can't change its CIDR block. The size of the subnet's IPv4 CIDR block can be the same as a VPC's IPv4 CIDR block, or a subset of a VPC's IPv4 CIDR block. If you create more than one subnet in a VPC, the subnets' CIDR blocks must not overlap. The smallest IPv4 subnet (and VPC) you can create uses a /28 netmask (16 IPv4 addresses), and the largest uses a /16 netmask (65,536 IPv4 addresses).
If you've associated an IPv6 CIDR block with your VPC, you can create a subnet with an IPv6 CIDR block that uses a /64 prefix length.
Warning
AWS reserves both the first four and the last IPv4 address in each subnet's CIDR block. They're not available for use.
If you add more than one subnet to a VPC, they're set up in a star topology with a logical router in the middle.
If you launch an instance in a VPC using an Amazon EBS-backed AMI, the IP address doesn't change if you stop and restart the instance (unlike a similar instance launched outside a VPC, which gets a new IP address when restarted). It's therefore possible to have a subnet with no running instances (they're all stopped), but no remaining IP addresses available.
For more information about subnets, see Your VPC and Subnets in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
subnet = ec2.create_subnet(
AvailabilityZone='string',
AvailabilityZoneId='string',
CidrBlock='string',
Ipv6CidrBlock='string',
VpcId='string',
DryRun=True|False
)
The Availability Zone for the subnet.
Default: AWS selects one for you. If you create more than one subnet in your VPC, we may not necessarily select a different zone for each subnet.
[REQUIRED]
The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24 .
[REQUIRED]
The ID of the VPC.
ec2.Subnet
Subnet resource
Adds or overwrites the specified tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide . For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = ec2.create_tags(
DryRun=True|False,
Resources=[
'string',
],
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The IDs of the resources, separated by spaces.
Constraints: Up to 1000 resource IDs. We recommend breaking up this request into smaller batches.
[REQUIRED]
The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
None
Creates an EBS volume that can be attached to an instance in the same Availability Zone. The volume is created in the regional endpoint that you send the HTTP request to. For more information see Regions and Endpoints .
You can create a new empty volume or restore a volume from an EBS snapshot. Any AWS Marketplace product codes from the snapshot are propagated to the volume.
You can create encrypted volumes. Encrypted volumes must be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are also automatically encrypted. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
You can tag your volumes during creation. For more information, see Tagging Your Amazon EC2 Resources in the Amazon Elastic Compute Cloud User Guide .
For more information, see Creating an Amazon EBS Volume in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
volume = ec2.create_volume(
AvailabilityZone='string',
Encrypted=True|False,
Iops=123,
KmsKeyId='string',
Size=123,
SnapshotId='string',
VolumeType='standard'|'io1'|'gp2'|'sc1'|'st1',
DryRun=True|False,
TagSpecifications=[
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
]
)
[REQUIRED]
The Availability Zone in which to create the volume.
Specifies whether the volume should be encrypted. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Encryption by Default in the Amazon Elastic Compute Cloud User Guide .
Encrypted Amazon EBS volumes must be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
The number of I/O operations per second (IOPS) to provision for the volume, with a maximum ratio of 50 IOPS/GiB. Range is 100 to 64,000 IOPS for volumes in most Regions. Maximum IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
This parameter is valid only for Provisioned IOPS SSD (io1) volumes.
The identifier of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use for Amazon EBS encryption. If this parameter is not specified, your AWS managed CMK for EBS is used. If KmsKeyId is specified, the encrypted state must be true .
You can specify the CMK using any of the following:
AWS authenticates the CMK asynchronously. Therefore, if you specify an ID, alias, or ARN that is not valid, the action can appear to complete, but eventually fails.
The size of the volume, in GiBs.
Constraints: 1-16,384 for gp2 , 4-16,384 for io1 , 500-16,384 for st1 , 500-16,384 for sc1 , and 1-1,024 for standard . If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Note
At least one of Size or SnapshotId is required.
The snapshot from which to create the volume.
Note
At least one of Size or SnapshotId are required.
The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.
Defaults: If no volume type is specified, the default is standard in us-east-1, eu-west-1, eu-central-1, us-west-2, us-west-1, sa-east-1, ap-northeast-1, ap-northeast-2, ap-southeast-1, ap-southeast-2, ap-south-1, us-gov-west-1, and cn-north-1. In all other Regions, EBS defaults to gp2 .
The tags to apply to the volume during creation.
The tags to apply to a resource when the resource is being created.
The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
ec2.Volume
Volume resource
Creates a VPC with the specified IPv4 CIDR block. The smallest VPC you can create uses a /28 netmask (16 IPv4 addresses), and the largest uses a /16 netmask (65,536 IPv4 addresses). For more information about how large to make your VPC, see Your VPC and Subnets in the Amazon Virtual Private Cloud User Guide .
You can optionally request an Amazon-provided IPv6 CIDR block for the VPC. The IPv6 CIDR block uses a /56 prefix length, and is allocated from Amazon's pool of IPv6 addresses. You cannot choose the IPv6 range for your VPC.
By default, each instance you launch in the VPC has the default DHCP options, which include only a default DNS server that we provide (AmazonProvidedDNS). For more information, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide .
You can specify the instance tenancy value for the VPC when you create it. You can't change this value for the VPC after you create it. For more information, see Dedicated Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
vpc = ec2.create_vpc(
CidrBlock='string',
AmazonProvidedIpv6CidrBlock=True|False,
DryRun=True|False,
InstanceTenancy='default'|'dedicated'|'host'
)
[REQUIRED]
The IPv4 network range for the VPC, in CIDR notation. For example, 10.0.0.0/16 .
The tenancy options for instances launched into the VPC. For default , instances are launched with shared tenancy by default. You can launch instances with any tenancy into a shared tenancy VPC. For dedicated , instances are launched as dedicated tenancy instances by default. You can only launch instances with a tenancy of dedicated or host into a dedicated tenancy VPC.
Important: The host value cannot be used with this parameter. Use the default or dedicated values only.
Default: default
ec2.Vpc
Vpc resource
Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection. The accepter VPC can belong to another AWS account and can be in a different Region to the requester VPC. The requester VPC and accepter VPC cannot have overlapping CIDR blocks.
Note
Limitations and rules apply to a VPC peering connection. For more information, see the limitations section in the VPC Peering Guide .
The owner of the accepter VPC must accept the peering request to activate the peering connection. The VPC peering connection request expires after 7 days, after which it cannot be accepted or rejected.
If you create a VPC peering connection request between VPCs with overlapping CIDR blocks, the VPC peering connection has a status of failed .
See also: AWS API Documentation
Request Syntax
vpc_peering_connection = ec2.create_vpc_peering_connection(
DryRun=True|False,
PeerOwnerId='string',
PeerVpcId='string',
VpcId='string',
PeerRegion='string'
)
The AWS account ID of the owner of the accepter VPC.
Default: Your AWS account ID
The Region code for the accepter VPC, if the accepter VPC is located in a Region other than the Region in which you make the request.
Default: The Region in which you make the request.
ec2.VpcPeeringConnection
VpcPeeringConnection resource
Disassociates a subnet from a route table.
After you perform this action, the subnet no longer uses the routes in the route table. Instead, it uses the routes in the VPC's main route table. For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = ec2.disassociate_route_table(
AssociationId='string',
DryRun=True|False
)
[REQUIRED]
The association ID representing the current association between the route table and subnet.
None
Returns a list of all the available sub-resources for this Resource.
Imports the public key from an RSA key pair that you created with a third-party tool. Compare this with CreateKeyPair , in which AWS creates the key pair and gives the keys to you (AWS keeps a copy of the public key). With ImportKeyPair, you create the key pair and give AWS just the public key. The private key is never transferred between you and AWS.
For more information about key pairs, see Key Pairs in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
key_pair_info = ec2.import_key_pair(
DryRun=True|False,
KeyName='string',
PublicKeyMaterial=b'bytes'
)
[REQUIRED]
A unique name for the key pair.
[REQUIRED]
The public key. For API calls, the text must be base64-encoded. For command line tools, base64 encoding is performed for you.
ec2.KeyPairInfo
KeyPairInfo resource
Registers an AMI. When you're creating an AMI, this is the final step you must complete before you can launch an instance from the AMI. For more information about creating AMIs, see Creating Your Own AMIs in the Amazon Elastic Compute Cloud User Guide .
Note
For Amazon EBS-backed instances, CreateImage creates and registers the AMI in a single request, so you don't have to register the AMI yourself.
You can also use RegisterImage to create an Amazon EBS-backed Linux AMI from a snapshot of a root device volume. You specify the snapshot using the block device mapping. For more information, see Launching a Linux Instance from a Backup in the Amazon Elastic Compute Cloud User Guide .
You can't register an image where a secondary (non-root) snapshot has AWS Marketplace product codes.
Some Linux distributions, such as Red Hat Enterprise Linux (RHEL) and SUSE Linux Enterprise Server (SLES), use the EC2 billing product code associated with an AMI to verify the subscription status for package updates. Creating an AMI from an EBS snapshot does not maintain this billing code, and instances launched from such an AMI are not able to connect to package update infrastructure. If you purchase a Reserved Instance offering for one of these Linux distributions and launch instances using an AMI that does not contain the required billing code, your Reserved Instance is not applied to these instances.
To create an AMI for operating systems that require a billing code, see CreateImage .
If needed, you can deregister an AMI at any time. Any modifications you make to an AMI backed by an instance store volume invalidates its registration. If you make changes to an image, deregister the previous image and register the new image.
See also: AWS API Documentation
Request Syntax
image = ec2.register_image(
ImageLocation='string',
Architecture='i386'|'x86_64'|'arm64',
BlockDeviceMappings=[
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'Iops': 123,
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Encrypted': True|False,
'KmsKeyId': 'string'
},
'NoDevice': 'string'
},
],
Description='string',
DryRun=True|False,
EnaSupport=True|False,
KernelId='string',
Name='string',
BillingProducts=[
'string',
],
RamdiskId='string',
RootDeviceName='string',
SriovNetSupport='string',
VirtualizationType='string'
)
The architecture of the AMI.
Default: For Amazon EBS-backed AMIs, i386 . For instance store-backed AMIs, the architecture specified in the manifest file.
The block device mapping entries.
Describes a block device mapping.
The device name (for example, /dev/sdh or xvdh ).
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Parameters used to automatically set up EBS volumes when the instance is launched.
Indicates whether the EBS volume is deleted on instance termination.
The number of I/O operations per second (IOPS) that the volume supports. For io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
The ID of the snapshot.
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Constraints: 1-16384 for General Purpose SSD (gp2 ), 4-16384 for Provisioned IOPS SSD (io1 ), 500-16384 for Throughput Optimized HDD (st1 ), 500-16384 for Cold HDD (sc1 ), and 1-1024 for Magnetic (standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
The volume type. If you set the type to io1 , you must also set the Iops property.
Default: standard
Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
In no case can you remove encryption from an encrypted volume.
Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is encrypted.
This parameter is only supported on BlockDeviceMapping objects called by RunInstances , RequestSpotFleet , and RequestSpotInstances .
Suppresses the specified device included in the block device mapping of the AMI.
Set to true to enable enhanced networking with ENA for the AMI and any instances that you launch from the AMI.
This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable.
[REQUIRED]
A name for your AMI.
Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)
The billing product codes. Your account must be authorized to specify billing product codes. Otherwise, you can use the AWS Marketplace to bill for the use of an AMI.
Set to simple to enable enhanced networking with the Intel 82599 Virtual Function interface for the AMI and any instances that you launch from the AMI.
There is no way to disable sriovNetSupport at this time.
This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable.
The type of virtualization (hvm | paravirtual ).
Default: paravirtual
ec2.Image
Image resource
Sub-resources
Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide.
Creates a ClassicAddress resource.:
classic_address = ec2.ClassicAddress('public_ip')
Creates a DhcpOptions resource.:
dhcp_options = ec2.DhcpOptions('id')
Creates a Image resource.:
image = ec2.Image('id')
Creates a Instance resource.:
instance = ec2.Instance('id')
Creates a InternetGateway resource.:
internet_gateway = ec2.InternetGateway('id')
Creates a KeyPairInfo resource.:
key_pair_info = ec2.KeyPair('name')
Creates a NetworkAcl resource.:
network_acl = ec2.NetworkAcl('id')
Creates a NetworkInterface resource.:
network_interface = ec2.NetworkInterface('id')
Creates a NetworkInterfaceAssociation resource.:
network_interface_association = ec2.NetworkInterfaceAssociation('id')
Creates a PlacementGroup resource.:
placement_group = ec2.PlacementGroup('name')
Creates a Route resource.:
route = ec2.Route('route_table_id','destination_cidr_block')
A Route resource
Creates a RouteTable resource.:
route_table = ec2.RouteTable('id')
Creates a RouteTableAssociation resource.:
route_table_association = ec2.RouteTableAssociation('id')
Creates a SecurityGroup resource.:
security_group = ec2.SecurityGroup('id')
Creates a Snapshot resource.:
snapshot = ec2.Snapshot('id')
Creates a Subnet resource.:
subnet = ec2.Subnet('id')
Creates a Tag resource.:
tag = ec2.Tag('resource_id','key','value')
A Tag resource
Creates a Volume resource.:
volume = ec2.Volume('id')
Creates a Vpc resource.:
vpc = ec2.Vpc('id')
Creates a VpcAddress resource.:
vpc_address = ec2.VpcAddress('allocation_id')
Creates a VpcPeeringConnection resource.:
vpc_peering_connection = ec2.VpcPeeringConnection('id')
Collections
Collections provide an interface to iterate over and manipulate groups of resources. For more information about collections refer to the Resources Introduction Guide.
A collection of ClassicAddress resources
Creates an iterable of all ClassicAddress resources in the collection.
See also: AWS API Documentation
Request Syntax
classic_address_iterator = ec2.classic_addresses.all()
Creates an iterable of all ClassicAddress resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
classic_address_iterator = ec2.classic_addresses.filter(
PublicIps=[
'string',
],
AllocationIds=[
'string',
],
DryRun=True|False
)
One or more Elastic IP addresses.
Default: Describes all your Elastic IP addresses.
[EC2-VPC] Information about the allocation IDs.
list(ec2.ClassicAddress)
A list of ClassicAddress resources
Creates an iterable up to a specified amount of ClassicAddress resources in the collection.
See also: AWS API Documentation
Request Syntax
classic_address_iterator = ec2.classic_addresses.limit(
count=123
)
Creates an iterable of all ClassicAddress resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
classic_address_iterator = ec2.classic_addresses.page_size(
count=123
)
A collection of DhcpOptions resources
Creates an iterable of all DhcpOptions resources in the collection.
See also: AWS API Documentation
Request Syntax
dhcp_options_iterator = ec2.dhcp_options_sets.all()
Creates an iterable of all DhcpOptions resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
dhcp_options_iterator = ec2.dhcp_options_sets.filter(
DhcpOptionsIds=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
NextToken='string',
MaxResults=123
)
The IDs of one or more DHCP options sets.
Default: Describes all your DHCP options sets.
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
list(ec2.DhcpOptions)
A list of DhcpOptions resources
Creates an iterable up to a specified amount of DhcpOptions resources in the collection.
See also: AWS API Documentation
Request Syntax
dhcp_options_iterator = ec2.dhcp_options_sets.limit(
count=123
)
Creates an iterable of all DhcpOptions resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
dhcp_options_iterator = ec2.dhcp_options_sets.page_size(
count=123
)
A collection of Image resources
Creates an iterable of all Image resources in the collection.
See also: AWS API Documentation
Request Syntax
image_iterator = ec2.images.all()
Creates an iterable of all Image resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
image_iterator = ec2.images.filter(
ExecutableUsers=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
ImageIds=[
'string',
],
Owners=[
'string',
],
DryRun=True|False
)
Scopes the images by users with explicit launch permissions. Specify an AWS account ID, self (the sender of the request), or all (public AMIs).
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The image IDs.
Default: Describes all images available to you.
Filters the images by the owner. Specify an AWS account ID, self (owner is the sender of the request), or an AWS owner alias (valid values are amazon | aws-marketplace | microsoft ). Omitting this option returns all images for which you have launch permissions, regardless of ownership.
list(ec2.Image)
A list of Image resources
Creates an iterable up to a specified amount of Image resources in the collection.
See also: AWS API Documentation
Request Syntax
image_iterator = ec2.images.limit(
count=123
)
Creates an iterable of all Image resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
image_iterator = ec2.images.page_size(
count=123
)
A collection of Instance resources
Creates an iterable of all Instance resources in the collection.
See also: AWS API Documentation
Request Syntax
instance_iterator = ec2.instances.all()
Adds or overwrites the specified tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide . For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = ec2.instances.create_tags(
DryRun=True|False,
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
None
Creates an iterable of all Instance resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
instance_iterator = ec2.instances.filter(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
InstanceIds=[
'string',
],
DryRun=True|False,
MaxResults=123,
NextToken='string'
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The instance IDs.
Default: Describes all your instances.
list(ec2.Instance)
A list of Instance resources
Creates an iterable up to a specified amount of Instance resources in the collection.
See also: AWS API Documentation
Request Syntax
instance_iterator = ec2.instances.limit(
count=123
)
Enables detailed monitoring for a running instance. Otherwise, basic monitoring is enabled. For more information, see Monitoring Your Instances and Volumes in the Amazon Elastic Compute Cloud User Guide .
To disable detailed monitoring, see .
See also: AWS API Documentation
Request Syntax
response = ec2.instances.monitor(
DryRun=True|False
)
{
'InstanceMonitorings': [
{
'InstanceId': 'string',
'Monitoring': {
'State': 'disabled'|'disabling'|'enabled'|'pending'
}
},
]
}
Response Structure
The monitoring information.
Describes the monitoring of an instance.
The ID of the instance.
The monitoring for the instance.
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
Creates an iterable of all Instance resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
instance_iterator = ec2.instances.page_size(
count=123
)
Requests a reboot of the specified instances. This operation is asynchronous; it only queues a request to reboot the specified instances. The operation succeeds if the instances are valid and belong to you. Requests to reboot terminated instances are ignored.
If an instance does not cleanly shut down within four minutes, Amazon EC2 performs a hard reboot.
For more information about troubleshooting, see Getting Console Output and Rebooting Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = ec2.instances.reboot(
DryRun=True|False
)
Starts an Amazon EBS-backed instance that you've previously stopped.
Instances that use Amazon EBS volumes as their root devices can be quickly stopped and started. When an instance is stopped, the compute resources are released and you are not billed for instance usage. However, your root partition Amazon EBS volume remains and continues to persist your data, and you are charged for Amazon EBS volume usage. You can restart your instance at any time. Every time you start your Windows instance, Amazon EC2 charges you for a full instance hour. If you stop and restart your Windows instance, a new instance hour begins and Amazon EC2 charges you for another full instance hour even if you are still within the same 60-minute period when it was stopped. Every time you start your Linux instance, Amazon EC2 charges a one-minute minimum for instance usage, and thereafter charges per second for instance usage.
Before stopping an instance, make sure it is in a state from which it can be restarted. Stopping an instance does not preserve data stored in RAM.
Performing this operation on an instance that uses an instance store as its root device returns an error.
For more information, see Stopping Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = ec2.instances.start(
AdditionalInfo='string',
DryRun=True|False
)
dict
Response Syntax
{
'StartingInstances': [
{
'CurrentState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceId': 'string',
'PreviousState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
}
},
]
}
Response Structure
(dict) --
StartingInstances (list) --
Information about the started instances.
(dict) --
Describes an instance state change.
CurrentState (dict) --
The current state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
InstanceId (string) --
The ID of the instance.
PreviousState (dict) --
The previous state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
Stops an Amazon EBS-backed instance.
You can use the Stop action to hibernate an instance if the instance is enabled for hibernation and it meets the hibernation prerequisites . For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
We don't charge usage for a stopped instance, or data transfer fees; however, your root partition Amazon EBS volume remains and continues to persist your data, and you are charged for Amazon EBS volume usage. Every time you start your Windows instance, Amazon EC2 charges you for a full instance hour. If you stop and restart your Windows instance, a new instance hour begins and Amazon EC2 charges you for another full instance hour even if you are still within the same 60-minute period when it was stopped. Every time you start your Linux instance, Amazon EC2 charges a one-minute minimum for instance usage, and thereafter charges per second for instance usage.
You can't start, stop, or hibernate Spot Instances, and you can't stop or hibernate instance store-backed instances. For information about using hibernation for Spot Instances, see Hibernating Interrupted Spot Instances in the Amazon Elastic Compute Cloud User Guide .
When you stop or hibernate an instance, we shut it down. You can restart your instance at any time. Before stopping or hibernating an instance, make sure it is in a state from which it can be restarted. Stopping an instance does not preserve data stored in RAM, but hibernating an instance does preserve data stored in RAM. If an instance cannot hibernate successfully, a normal shutdown occurs.
Stopping and hibernating an instance is different to rebooting or terminating it. For example, when you stop or hibernate an instance, the root device and any other devices attached to the instance persist. When you terminate an instance, the root device and any other devices attached during the instance launch are automatically deleted. For more information about the differences between rebooting, stopping, hibernating, and terminating instances, see Instance Lifecycle in the Amazon Elastic Compute Cloud User Guide .
When you stop an instance, we attempt to shut it down forcibly after a short while. If your instance appears stuck in the stopping state after a period of time, there may be an issue with the underlying host computer. For more information, see Troubleshooting Stopping Your Instance in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = ec2.instances.stop(
Hibernate=True|False,
DryRun=True|False,
Force=True|False
)
Hibernates the instance if the instance was enabled for hibernation at launch. If the instance cannot hibernate successfully, a normal shutdown occurs. For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
Default: false
Forces the instances to stop. The instances do not have an opportunity to flush file system caches or file system metadata. If you use this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances.
Default: false
dict
Response Syntax
{
'StoppingInstances': [
{
'CurrentState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceId': 'string',
'PreviousState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
}
},
]
}
Response Structure
(dict) --
StoppingInstances (list) --
Information about the stopped instances.
(dict) --
Describes an instance state change.
CurrentState (dict) --
The current state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
InstanceId (string) --
The ID of the instance.
PreviousState (dict) --
The previous state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
Shuts down the specified instances. This operation is idempotent; if you terminate an instance more than once, each call succeeds.
If you specify multiple instances and the request fails (for example, because of a single incorrect instance ID), none of the instances are terminated.
Terminated instances remain visible after termination (for approximately one hour).
By default, Amazon EC2 deletes all EBS volumes that were attached when the instance launched. Volumes attached after instance launch continue running.
You can stop, start, and terminate EBS-backed instances. You can only terminate instance store-backed instances. What happens to an instance differs if you stop it or terminate it. For example, when you stop an instance, the root device and any other devices attached to the instance persist. When you terminate an instance, any attached EBS volumes with the DeleteOnTermination block device mapping parameter set to true are automatically deleted. For more information about the differences between stopping and terminating instances, see Instance Lifecycle in the Amazon Elastic Compute Cloud User Guide .
For more information about troubleshooting, see Troubleshooting Terminating Your Instance in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = ec2.instances.terminate(
DryRun=True|False
)
{
'TerminatingInstances': [
{
'CurrentState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceId': 'string',
'PreviousState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
}
},
]
}
Response Structure
Information about the terminated instances.
Describes an instance state change.
The current state of the instance.
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
The current state of the instance.
The ID of the instance.
The previous state of the instance.
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
The current state of the instance.
Disables detailed monitoring for a running instance. For more information, see Monitoring Your Instances and Volumes in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = ec2.instances.unmonitor(
DryRun=True|False
)
{
'InstanceMonitorings': [
{
'InstanceId': 'string',
'Monitoring': {
'State': 'disabled'|'disabling'|'enabled'|'pending'
}
},
]
}
Response Structure
The monitoring information.
Describes the monitoring of an instance.
The ID of the instance.
The monitoring for the instance.
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
A collection of InternetGateway resources
Creates an iterable of all InternetGateway resources in the collection.
See also: AWS API Documentation
Request Syntax
internet_gateway_iterator = ec2.internet_gateways.all()
Creates an iterable of all InternetGateway resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
internet_gateway_iterator = ec2.internet_gateways.filter(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
InternetGatewayIds=[
'string',
],
NextToken='string',
MaxResults=123
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more internet gateway IDs.
Default: Describes all your internet gateways.
list(ec2.InternetGateway)
A list of InternetGateway resources
Creates an iterable up to a specified amount of InternetGateway resources in the collection.
See also: AWS API Documentation
Request Syntax
internet_gateway_iterator = ec2.internet_gateways.limit(
count=123
)
Creates an iterable of all InternetGateway resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
internet_gateway_iterator = ec2.internet_gateways.page_size(
count=123
)
A collection of KeyPairInfo resources
Creates an iterable of all KeyPairInfo resources in the collection.
See also: AWS API Documentation
Request Syntax
key_pair_info_iterator = ec2.key_pairs.all()
Creates an iterable of all KeyPairInfo resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
key_pair_info_iterator = ec2.key_pairs.filter(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
KeyNames=[
'string',
],
DryRun=True|False
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The key pair names.
Default: Describes all your key pairs.
list(ec2.KeyPairInfo)
A list of KeyPairInfo resources
Creates an iterable up to a specified amount of KeyPairInfo resources in the collection.
See also: AWS API Documentation
Request Syntax
key_pair_info_iterator = ec2.key_pairs.limit(
count=123
)
Creates an iterable of all KeyPairInfo resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
key_pair_info_iterator = ec2.key_pairs.page_size(
count=123
)
A collection of NetworkAcl resources
Creates an iterable of all NetworkAcl resources in the collection.
See also: AWS API Documentation
Request Syntax
network_acl_iterator = ec2.network_acls.all()
Creates an iterable of all NetworkAcl resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
network_acl_iterator = ec2.network_acls.filter(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
NetworkAclIds=[
'string',
],
NextToken='string',
MaxResults=123
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more network ACL IDs.
Default: Describes all your network ACLs.
list(ec2.NetworkAcl)
A list of NetworkAcl resources
Creates an iterable up to a specified amount of NetworkAcl resources in the collection.
See also: AWS API Documentation
Request Syntax
network_acl_iterator = ec2.network_acls.limit(
count=123
)
Creates an iterable of all NetworkAcl resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
network_acl_iterator = ec2.network_acls.page_size(
count=123
)
A collection of NetworkInterface resources
Creates an iterable of all NetworkInterface resources in the collection.
See also: AWS API Documentation
Request Syntax
network_interface_iterator = ec2.network_interfaces.all()
Creates an iterable of all NetworkInterface resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
network_interface_iterator = ec2.network_interfaces.filter(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
NetworkInterfaceIds=[
'string',
],
NextToken='string',
MaxResults=123
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more network interface IDs.
Default: Describes all your network interfaces.
list(ec2.NetworkInterface)
A list of NetworkInterface resources
Creates an iterable up to a specified amount of NetworkInterface resources in the collection.
See also: AWS API Documentation
Request Syntax
network_interface_iterator = ec2.network_interfaces.limit(
count=123
)
Creates an iterable of all NetworkInterface resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
network_interface_iterator = ec2.network_interfaces.page_size(
count=123
)
A collection of PlacementGroup resources
Creates an iterable of all PlacementGroup resources in the collection.
See also: AWS API Documentation
Request Syntax
placement_group_iterator = ec2.placement_groups.all()
Creates an iterable of all PlacementGroup resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
placement_group_iterator = ec2.placement_groups.filter(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
GroupNames=[
'string',
]
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The names of the placement groups.
Default: Describes all your placement groups, or only those otherwise specified.
list(ec2.PlacementGroup)
A list of PlacementGroup resources
Creates an iterable up to a specified amount of PlacementGroup resources in the collection.
See also: AWS API Documentation
Request Syntax
placement_group_iterator = ec2.placement_groups.limit(
count=123
)
Creates an iterable of all PlacementGroup resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
placement_group_iterator = ec2.placement_groups.page_size(
count=123
)
A collection of RouteTable resources
Creates an iterable of all RouteTable resources in the collection.
See also: AWS API Documentation
Request Syntax
route_table_iterator = ec2.route_tables.all()
Creates an iterable of all RouteTable resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
route_table_iterator = ec2.route_tables.filter(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
RouteTableIds=[
'string',
],
NextToken='string',
MaxResults=123
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more route table IDs.
Default: Describes all your route tables.
list(ec2.RouteTable)
A list of RouteTable resources
Creates an iterable up to a specified amount of RouteTable resources in the collection.
See also: AWS API Documentation
Request Syntax
route_table_iterator = ec2.route_tables.limit(
count=123
)
Creates an iterable of all RouteTable resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
route_table_iterator = ec2.route_tables.page_size(
count=123
)
A collection of SecurityGroup resources
Creates an iterable of all SecurityGroup resources in the collection.
See also: AWS API Documentation
Request Syntax
security_group_iterator = ec2.security_groups.all()
Creates an iterable of all SecurityGroup resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
security_group_iterator = ec2.security_groups.filter(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
GroupIds=[
'string',
],
GroupNames=[
'string',
],
DryRun=True|False,
NextToken='string',
MaxResults=123
)
The filters. If using multiple filters for rules, the results include security groups for which any combination of rules - not necessarily a single rule - match all filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The IDs of the security groups. Required for security groups in a nondefault VPC.
Default: Describes all your security groups.
[EC2-Classic and default VPC only] The names of the security groups. You can specify either the security group name or the security group ID. For security groups in a nondefault VPC, use the group-name filter to describe security groups by name.
Default: Describes all your security groups.
list(ec2.SecurityGroup)
A list of SecurityGroup resources
Creates an iterable up to a specified amount of SecurityGroup resources in the collection.
See also: AWS API Documentation
Request Syntax
security_group_iterator = ec2.security_groups.limit(
count=123
)
Creates an iterable of all SecurityGroup resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
security_group_iterator = ec2.security_groups.page_size(
count=123
)
A collection of Snapshot resources
Creates an iterable of all Snapshot resources in the collection.
See also: AWS API Documentation
Request Syntax
snapshot_iterator = ec2.snapshots.all()
Creates an iterable of all Snapshot resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
snapshot_iterator = ec2.snapshots.filter(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string',
OwnerIds=[
'string',
],
RestorableByUserIds=[
'string',
],
SnapshotIds=[
'string',
],
DryRun=True|False
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
Describes the snapshots owned by these owners.
The IDs of the AWS accounts that can create volumes from the snapshot.
The snapshot IDs.
Default: Describes the snapshots for which you have create volume permissions.
list(ec2.Snapshot)
A list of Snapshot resources
Creates an iterable up to a specified amount of Snapshot resources in the collection.
See also: AWS API Documentation
Request Syntax
snapshot_iterator = ec2.snapshots.limit(
count=123
)
Creates an iterable of all Snapshot resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
snapshot_iterator = ec2.snapshots.page_size(
count=123
)
A collection of Subnet resources
Creates an iterable of all Subnet resources in the collection.
See also: AWS API Documentation
Request Syntax
subnet_iterator = ec2.subnets.all()
Creates an iterable of all Subnet resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
subnet_iterator = ec2.subnets.filter(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
SubnetIds=[
'string',
],
DryRun=True|False,
NextToken='string',
MaxResults=123
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more subnet IDs.
Default: Describes all your subnets.
list(ec2.Subnet)
A list of Subnet resources
Creates an iterable up to a specified amount of Subnet resources in the collection.
See also: AWS API Documentation
Request Syntax
subnet_iterator = ec2.subnets.limit(
count=123
)
Creates an iterable of all Subnet resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
subnet_iterator = ec2.subnets.page_size(
count=123
)
A collection of Volume resources
Creates an iterable of all Volume resources in the collection.
See also: AWS API Documentation
Request Syntax
volume_iterator = ec2.volumes.all()
Creates an iterable of all Volume resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
volume_iterator = ec2.volumes.filter(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
VolumeIds=[
'string',
],
DryRun=True|False,
MaxResults=123,
NextToken='string'
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
The volume IDs.
list(ec2.Volume)
A list of Volume resources
Creates an iterable up to a specified amount of Volume resources in the collection.
See also: AWS API Documentation
Request Syntax
volume_iterator = ec2.volumes.limit(
count=123
)
Creates an iterable of all Volume resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
volume_iterator = ec2.volumes.page_size(
count=123
)
A collection of VpcAddress resources
Creates an iterable of all VpcAddress resources in the collection.
See also: AWS API Documentation
Request Syntax
vpc_address_iterator = ec2.vpc_addresses.all()
Creates an iterable of all VpcAddress resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
vpc_address_iterator = ec2.vpc_addresses.filter(
PublicIps=[
'string',
],
AllocationIds=[
'string',
],
DryRun=True|False
)
One or more Elastic IP addresses.
Default: Describes all your Elastic IP addresses.
[EC2-VPC] Information about the allocation IDs.
list(ec2.VpcAddress)
A list of VpcAddress resources
Creates an iterable up to a specified amount of VpcAddress resources in the collection.
See also: AWS API Documentation
Request Syntax
vpc_address_iterator = ec2.vpc_addresses.limit(
count=123
)
Creates an iterable of all VpcAddress resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
vpc_address_iterator = ec2.vpc_addresses.page_size(
count=123
)
A collection of VpcPeeringConnection resources
Creates an iterable of all VpcPeeringConnection resources in the collection.
See also: AWS API Documentation
Request Syntax
vpc_peering_connection_iterator = ec2.vpc_peering_connections.all()
Creates an iterable of all VpcPeeringConnection resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
vpc_peering_connection_iterator = ec2.vpc_peering_connections.filter(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
VpcPeeringConnectionIds=[
'string',
],
NextToken='string',
MaxResults=123
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more VPC peering connection IDs.
Default: Describes all your VPC peering connections.
list(ec2.VpcPeeringConnection)
A list of VpcPeeringConnection resources
Creates an iterable up to a specified amount of VpcPeeringConnection resources in the collection.
See also: AWS API Documentation
Request Syntax
vpc_peering_connection_iterator = ec2.vpc_peering_connections.limit(
count=123
)
Creates an iterable of all VpcPeeringConnection resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
vpc_peering_connection_iterator = ec2.vpc_peering_connections.page_size(
count=123
)
A collection of Vpc resources
Creates an iterable of all Vpc resources in the collection.
See also: AWS API Documentation
Request Syntax
vpc_iterator = ec2.vpcs.all()
Creates an iterable of all Vpc resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
vpc_iterator = ec2.vpcs.filter(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
VpcIds=[
'string',
],
DryRun=True|False,
NextToken='string',
MaxResults=123
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
One or more VPC IDs.
Default: Describes all your VPCs.
list(ec2.Vpc)
A list of Vpc resources
Creates an iterable up to a specified amount of Vpc resources in the collection.
See also: AWS API Documentation
Request Syntax
vpc_iterator = ec2.vpcs.limit(
count=123
)
Creates an iterable of all Vpc resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
vpc_iterator = ec2.vpcs.page_size(
count=123
)
A resource representing an Amazon Elastic Compute Cloud (EC2) ClassicAddress:
import boto3
ec2 = boto3.resource('ec2')
classic_address = ec2.ClassicAddress('public_ip')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The ClassicAddress's public_ip identifier. This must be set.
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.
(string) --
The ID representing the allocation of the address for use with EC2-VPC.
(string) --
The ID representing the association of the address with an instance in a VPC.
(string) --
Indicates whether this Elastic IP address is for use with instances in EC2-Classic (standard ) or instances in a VPC (vpc ).
(string) --
The ID of the instance that the address is associated with (if any).
(string) --
The ID of the network interface.
(string) --
The ID of the AWS account that owns the network interface.
(string) --
The private IP address associated with the Elastic IP address.
(string) --
The ID of an address pool.
(list) --
Any tags assigned to the Elastic IP address.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
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.
Associates an Elastic IP address with an instance or a network interface. Before you can use an Elastic IP address, you must allocate it to your account.
An Elastic IP address is for use in either the EC2-Classic platform or in a VPC. For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide .
[EC2-Classic, VPC in an EC2-VPC-only account] If the Elastic IP address is already associated with a different instance, it is disassociated from that instance and associated with the specified instance. If you associate an Elastic IP address with an instance that has an existing Elastic IP address, the existing address is disassociated from the instance, but remains allocated to your account.
[VPC in an EC2-Classic account] If you don't specify a private IP address, the Elastic IP address is associated with the primary IP address. If the Elastic IP address is already associated with a different instance or a network interface, you get an error unless you allow reassociation. You cannot associate an Elastic IP address with an instance or network interface that has an existing Elastic IP address.
Warning
This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error, and you may be charged for each time the Elastic IP address is remapped to the same instance. For more information, see the Elastic IP Addresses section of Amazon EC2 Pricing .
See also: AWS API Documentation
Request Syntax
response = classic_address.associate(
AllocationId='string',
InstanceId='string',
AllowReassociation=True|False,
DryRun=True|False,
NetworkInterfaceId='string',
PrivateIpAddress='string'
)
[EC2-VPC] The ID of the network interface. If the instance has more than one network interface, you must specify a network interface ID.
For EC2-VPC, you can specify either the instance ID or the network interface ID, but not both.
dict
Response Syntax
{
'AssociationId': 'string'
}
Response Structure
(dict) --
AssociationId (string) --
[EC2-VPC] The ID that represents the association of the Elastic IP address with an instance.
Disassociates an Elastic IP address from the instance or network interface it's associated with.
An Elastic IP address is for use in either the EC2-Classic platform or in a VPC. For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide .
This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error.
See also: AWS API Documentation
Request Syntax
response = classic_address.disassociate(
AssociationId='string',
DryRun=True|False
)
None
Returns a list of all the available sub-resources for this Resource.
Calls EC2.Client.describe_addresses() to update the attributes of the ClassicAddress resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
classic_address.load()
Releases the specified Elastic IP address.
[EC2-Classic, default VPC] Releasing an Elastic IP address automatically disassociates it from any instance that it's associated with. To disassociate an Elastic IP address without releasing it, use DisassociateAddress .
[Nondefault VPC] You must use DisassociateAddress to disassociate the Elastic IP address before you can release it. Otherwise, Amazon EC2 returns an error (InvalidIPAddress.InUse ).
After releasing an Elastic IP address, it is released to the IP address pool. Be sure to update your DNS records and any servers or devices that communicate with the address. If you attempt to release an Elastic IP address that you already released, you'll get an AuthFailure error if the address is already allocated to another AWS account.
[EC2-VPC] After you release an Elastic IP address for use in a VPC, you might be able to recover it. For more information, see AllocateAddress .
See also: AWS API Documentation
Request Syntax
response = classic_address.release(
AllocationId='string',
DryRun=True|False
)
None
Calls EC2.Client.describe_addresses() to update the attributes of the ClassicAddress resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
classic_address.reload()
A resource representing an Amazon Elastic Compute Cloud (EC2) DhcpOptions:
import boto3
ec2 = boto3.resource('ec2')
dhcp_options = ec2.DhcpOptions('id')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The DhcpOptions's id identifier. This must be set.
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.
(list) --
One or more DHCP options in the set.
(dict) --
Describes a DHCP configuration option.
Key (string) --
The name of a DHCP option.
Values (list) --
One or more values for the DHCP option.
(dict) --
Describes a value for a resource attribute that is a String.
Value (string) --
The attribute value. The value is case-sensitive.
(string) --
The ID of the set of DHCP options.
(string) --
The ID of the AWS account that owns the DHCP options set.
(list) --
Any tags assigned to the DHCP options set.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
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.
Associates a set of DHCP options (that you've previously created) with the specified VPC, or associates no DHCP options with the VPC.
After you associate the options with the VPC, any existing instances and all new instances that you launch in that VPC use the options. You don't need to restart or relaunch the instances. They automatically pick up the changes within a few hours, depending on how frequently the instance renews its DHCP lease. You can explicitly renew the lease using the operating system on the instance.
For more information, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = dhcp_options.associate_with_vpc(
VpcId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the VPC.
None
Adds or overwrites the specified tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide . For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
tag = dhcp_options.create_tags(
DryRun=True|False,
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
list(ec2.Tag)
A list of Tag resources
Deletes the specified set of DHCP options. You must disassociate the set of DHCP options before you can delete it. You can disassociate the set of DHCP options by associating either a new set of options or the default set of options with the VPC.
See also: AWS API Documentation
Request Syntax
response = dhcp_options.delete(
DryRun=True|False
)
Returns a list of all the available sub-resources for this Resource.
Calls EC2.Client.describe_dhcp_options() to update the attributes of the DhcpOptions resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
dhcp_options.load()
Calls EC2.Client.describe_dhcp_options() to update the attributes of the DhcpOptions resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
dhcp_options.reload()
A resource representing an Amazon Elastic Compute Cloud (EC2) Image:
import boto3
ec2 = boto3.resource('ec2')
image = ec2.Image('id')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
These are the resource's available waiters:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The Image's id identifier. This must be set.
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.
(string) --
The architecture of the image.
(list) --
Any block device mapping entries.
(dict) --
Describes a block device mapping.
DeviceName (string) --
The device name (for example, /dev/sdh or xvdh ).
VirtualName (string) --
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Ebs (dict) --
Parameters used to automatically set up EBS volumes when the instance is launched.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports. For io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
SnapshotId (string) --
The ID of the snapshot.
VolumeSize (integer) --
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Constraints: 1-16384 for General Purpose SSD (gp2 ), 4-16384 for Provisioned IOPS SSD (io1 ), 500-16384 for Throughput Optimized HDD (st1 ), 500-16384 for Cold HDD (sc1 ), and 1-1024 for Magnetic (standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
VolumeType (string) --
The volume type. If you set the type to io1 , you must also set the Iops property.
Default: standard
Encrypted (boolean) --
Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
In no case can you remove encryption from an encrypted volume.
Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
KmsKeyId (string) --
Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is encrypted.
This parameter is only supported on BlockDeviceMapping objects called by RunInstances , RequestSpotFleet , and RequestSpotInstances .
NoDevice (string) --
Suppresses the specified device included in the block device mapping of the AMI.
(string) --
The date and time the image was created.
(string) --
The description of the AMI that was provided during image creation.
(boolean) --
Specifies whether enhanced networking with ENA is enabled.
(string) --
The hypervisor type of the image.
(string) --
The ID of the AMI.
(string) --
The location of the AMI.
(string) --
The AWS account alias (for example, amazon , self ) or the AWS account ID of the AMI owner.
(string) --
The type of image.
(string) --
The kernel associated with the image, if any. Only applicable for machine images.
(string) --
The name of the AMI that was provided during image creation.
(string) --
The AWS account ID of the image owner.
(string) --
This value is set for Windows AMIs; otherwise, it is blank.
(list) --
Any product codes associated with the AMI.
(dict) --
Describes a product code.
ProductCodeId (string) --
The product code.
ProductCodeType (string) --
The type of product code.
(boolean) --
Indicates whether the image has public launch permissions. The value is true if this image has public launch permissions or false if it has only implicit and explicit launch permissions.
(string) --
The RAM disk associated with the image, if any. Only applicable for machine images.
(string) --
The device name of the root device volume (for example, /dev/sda1 ).
(string) --
The type of root device used by the AMI. The AMI can use an EBS volume or an instance store volume.
(string) --
Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
(string) --
The current state of the AMI. If the state is available , the image is successfully registered and can be used to launch an instance.
(dict) --
The reason for the state change.
Code (string) --
The reason code for the state change.
Message (string) --
The message for the state change.
(list) --
Any tags assigned to the image.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
(string) --
The type of virtualization of the AMI.
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.
Adds or overwrites the specified tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide . For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
tag = image.create_tags(
DryRun=True|False,
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
list(ec2.Tag)
A list of Tag resources
Deregisters the specified AMI. After you deregister an AMI, it can't be used to launch new instances; however, it doesn't affect any instances that you've already launched from the AMI. You'll continue to incur usage costs for those instances until you terminate them.
When you deregister an Amazon EBS-backed AMI, it doesn't affect the snapshot that was created for the root volume of the instance during the AMI creation process. When you deregister an instance store-backed AMI, it doesn't affect the files that you uploaded to Amazon S3 when you created the AMI.
See also: AWS API Documentation
Request Syntax
response = image.deregister(
DryRun=True|False
)
Describes the specified attribute of the specified AMI. You can specify only one attribute at a time.
See also: AWS API Documentation
Request Syntax
response = image.describe_attribute(
Attribute='description'|'kernel'|'ramdisk'|'launchPermission'|'productCodes'|'blockDeviceMapping'|'sriovNetSupport',
DryRun=True|False
)
[REQUIRED]
The AMI attribute.
Note : Depending on your account privileges, the blockDeviceMapping attribute may return a Client.AuthFailure error. If this happens, use DescribeImages to get information about the block device mapping for the AMI.
dict
Response Syntax
{
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'Iops': 123,
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Encrypted': True|False,
'KmsKeyId': 'string'
},
'NoDevice': 'string'
},
],
'ImageId': 'string',
'LaunchPermissions': [
{
'Group': 'all',
'UserId': 'string'
},
],
'ProductCodes': [
{
'ProductCodeId': 'string',
'ProductCodeType': 'devpay'|'marketplace'
},
],
'Description': {
'Value': 'string'
},
'KernelId': {
'Value': 'string'
},
'RamdiskId': {
'Value': 'string'
},
'SriovNetSupport': {
'Value': 'string'
}
}
Response Structure
(dict) --
Describes an image attribute.
BlockDeviceMappings (list) --
The block device mapping entries.
(dict) --
Describes a block device mapping.
DeviceName (string) --
The device name (for example, /dev/sdh or xvdh ).
VirtualName (string) --
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Ebs (dict) --
Parameters used to automatically set up EBS volumes when the instance is launched.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports. For io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
SnapshotId (string) --
The ID of the snapshot.
VolumeSize (integer) --
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Constraints: 1-16384 for General Purpose SSD (gp2 ), 4-16384 for Provisioned IOPS SSD (io1 ), 500-16384 for Throughput Optimized HDD (st1 ), 500-16384 for Cold HDD (sc1 ), and 1-1024 for Magnetic (standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
VolumeType (string) --
The volume type. If you set the type to io1 , you must also set the Iops property.
Default: standard
Encrypted (boolean) --
Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
In no case can you remove encryption from an encrypted volume.
Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
KmsKeyId (string) --
Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is encrypted.
This parameter is only supported on BlockDeviceMapping objects called by RunInstances , RequestSpotFleet , and RequestSpotInstances .
NoDevice (string) --
Suppresses the specified device included in the block device mapping of the AMI.
ImageId (string) --
The ID of the AMI.
LaunchPermissions (list) --
The launch permissions.
(dict) --
Describes a launch permission.
Group (string) --
The name of the group.
UserId (string) --
The AWS account ID.
ProductCodes (list) --
The product codes.
(dict) --
Describes a product code.
ProductCodeId (string) --
The product code.
ProductCodeType (string) --
The type of product code.
Description (dict) --
A description for the AMI.
Value (string) --
The attribute value. The value is case-sensitive.
KernelId (dict) --
The kernel ID.
Value (string) --
The attribute value. The value is case-sensitive.
RamdiskId (dict) --
The RAM disk ID.
Value (string) --
The attribute value. The value is case-sensitive.
SriovNetSupport (dict) --
Indicates whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
Value (string) --
The attribute value. The value is case-sensitive.
Returns a list of all the available sub-resources for this Resource.
Calls EC2.Client.describe_images() to update the attributes of the Image resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
image.load()
Modifies the specified attribute of the specified AMI. You can specify only one attribute at a time. You can use the Attribute parameter to specify the attribute or one of the following parameters: Description , LaunchPermission , or ProductCode .
AWS Marketplace product codes cannot be modified. Images with an AWS Marketplace product code cannot be made public.
To enable the SriovNetSupport enhanced networking attribute of an image, enable SriovNetSupport on an instance and create an AMI from the instance.
See also: AWS API Documentation
Request Syntax
response = image.modify_attribute(
Attribute='string',
Description={
'Value': 'string'
},
LaunchPermission={
'Add': [
{
'Group': 'all',
'UserId': 'string'
},
],
'Remove': [
{
'Group': 'all',
'UserId': 'string'
},
]
},
OperationType='add'|'remove',
ProductCodes=[
'string',
],
UserGroups=[
'string',
],
UserIds=[
'string',
],
Value='string',
DryRun=True|False
)
A new description for the AMI.
The attribute value. The value is case-sensitive.
A new launch permission for the AMI.
The AWS account ID to add to the list of launch permissions for the AMI.
Describes a launch permission.
The name of the group.
The AWS account ID.
The AWS account ID to remove from the list of launch permissions for the AMI.
Describes a launch permission.
The name of the group.
The AWS account ID.
The DevPay product codes. After you add a product code to an AMI, it can't be removed.
The user groups. This parameter can be used only when the Attribute parameter is launchPermission .
The AWS account IDs. This parameter can be used only when the Attribute parameter is launchPermission .
None
Calls EC2.Client.describe_images() to update the attributes of the Image resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
image.reload()
Resets an attribute of an AMI to its default value.
Note
The productCodes attribute can't be reset.
See also: AWS API Documentation
Request Syntax
response = image.reset_attribute(
Attribute='launchPermission',
DryRun=True|False
)
[REQUIRED]
The attribute to reset (currently you can only reset the launch permission attribute).
None
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.
Waits until this Image is exists. This method calls EC2.Waiter.image_exists.wait() which polls. EC2.Client.describe_images() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
image.wait_until_exists(
ExecutableUsers=[
'string',
],
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
Owners=[
'string',
],
DryRun=True|False
)
Scopes the images by users with explicit launch permissions. Specify an AWS account ID, self (the sender of the request), or all (public AMIs).
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
Filters the images by the owner. Specify an AWS account ID, self (owner is the sender of the request), or an AWS owner alias (valid values are amazon | aws-marketplace | microsoft ). Omitting this option returns all images for which you have launch permissions, regardless of ownership.
None
A resource representing an Amazon Elastic Compute Cloud (EC2) Instance:
import boto3
ec2 = boto3.resource('ec2')
instance = ec2.Instance('id')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available references:
These are the resource's available actions:
These are the resource's available collections:
These are the resource's available waiters:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The Instance's id identifier. This must be set.
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.
(integer) --
The AMI launch index, which can be used to find this instance in the launch group.
(string) --
The architecture of the image.
(list) --
Any block device mapping entries for the instance.
(dict) --
Describes a block device mapping.
DeviceName (string) --
The device name (for example, /dev/sdh or xvdh ).
Ebs (dict) --
Parameters used to automatically set up EBS volumes when the instance is launched.
AttachTime (datetime) --
The time stamp when the attachment initiated.
DeleteOnTermination (boolean) --
Indicates whether the volume is deleted on instance termination.
Status (string) --
The attachment state.
VolumeId (string) --
The ID of the EBS volume.
(string) --
The ID of the Capacity Reservation.
(dict) --
Information about the Capacity Reservation targeting option.
CapacityReservationPreference (string) --
Describes the instance's Capacity Reservation preferences. Possible preferences include:
CapacityReservationTarget (dict) --
Information about the targeted Capacity Reservation.
CapacityReservationId (string) --
The ID of the Capacity Reservation.
(string) --
The idempotency token you provided when you launched the instance, if applicable.
(dict) --
The CPU options for the instance.
CoreCount (integer) --
The number of CPU cores for the instance.
ThreadsPerCore (integer) --
The number of threads per CPU core.
(boolean) --
Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.
(list) --
The Elastic GPU associated with the instance.
(dict) --
Describes the association between an instance and an Elastic Graphics accelerator.
ElasticGpuId (string) --
The ID of the Elastic Graphics accelerator.
ElasticGpuAssociationId (string) --
The ID of the association.
ElasticGpuAssociationState (string) --
The state of the association between the instance and the Elastic Graphics accelerator.
ElasticGpuAssociationTime (string) --
The time the Elastic Graphics accelerator was associated with the instance.
(list) --
The elastic inference accelerator associated with the instance.
(dict) --
Describes the association between an instance and an elastic inference accelerator.
ElasticInferenceAcceleratorArn (string) --
The Amazon Resource Name (ARN) of the elastic inference accelerator.
ElasticInferenceAcceleratorAssociationId (string) --
The ID of the association.
ElasticInferenceAcceleratorAssociationState (string) --
The state of the elastic inference accelerator.
ElasticInferenceAcceleratorAssociationTime (datetime) --
The time at which the elastic inference accelerator is associated with an instance.
(boolean) --
Specifies whether enhanced networking with ENA is enabled.
(dict) --
Indicates whether the instance is enabled for hibernation.
Configured (boolean) --
If this parameter is set to true , your instance is enabled for hibernation; otherwise, it is not enabled for hibernation.
(string) --
The hypervisor type of the instance.
(dict) --
The IAM instance profile associated with the instance, if applicable.
Arn (string) --
The Amazon Resource Name (ARN) of the instance profile.
Id (string) --
The ID of the instance profile.
(string) --
The ID of the AMI used to launch the instance.
(string) --
The ID of the instance.
(string) --
Indicates whether this is a Spot Instance or a Scheduled Instance.
(string) --
The instance type.
(string) --
The kernel associated with this instance, if applicable.
(string) --
The name of the key pair, if this instance was launched with an associated key pair.
(datetime) --
The time the instance was launched.
(list) --
The license configurations.
(dict) --
Describes a license configuration.
LicenseConfigurationArn (string) --
The Amazon Resource Name (ARN) of the license configuration.
(dict) --
The monitoring for the instance.
State (string) --
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
(list) --
[EC2-VPC] The network interfaces for the instance.
(dict) --
Describes a network interface.
Association (dict) --
The association information for an Elastic IPv4 associated with the network interface.
IpOwnerId (string) --
The ID of the owner of the Elastic IP address.
PublicDnsName (string) --
The public DNS name.
PublicIp (string) --
The public IP address or Elastic IP address bound to the network interface.
Attachment (dict) --
The network interface attachment.
AttachTime (datetime) --
The time stamp when the attachment initiated.
AttachmentId (string) --
The ID of the network interface attachment.
DeleteOnTermination (boolean) --
Indicates whether the network interface is deleted when the instance is terminated.
DeviceIndex (integer) --
The index of the device on the instance for the network interface attachment.
Status (string) --
The attachment state.
Description (string) --
The description.
Groups (list) --
One or more security groups.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
Ipv6Addresses (list) --
One or more IPv6 addresses associated with the network interface.
(dict) --
Describes an IPv6 address.
Ipv6Address (string) --
The IPv6 address.
MacAddress (string) --
The MAC address.
NetworkInterfaceId (string) --
The ID of the network interface.
OwnerId (string) --
The ID of the AWS account that created the network interface.
PrivateDnsName (string) --
The private DNS name.
PrivateIpAddress (string) --
The IPv4 address of the network interface within the subnet.
PrivateIpAddresses (list) --
One or more private IPv4 addresses associated with the network interface.
(dict) --
Describes a private IPv4 address.
Association (dict) --
The association information for an Elastic IP address for the network interface.
IpOwnerId (string) --
The ID of the owner of the Elastic IP address.
PublicDnsName (string) --
The public DNS name.
PublicIp (string) --
The public IP address or Elastic IP address bound to the network interface.
Primary (boolean) --
Indicates whether this IPv4 address is the primary private IP address of the network interface.
PrivateDnsName (string) --
The private IPv4 DNS name.
PrivateIpAddress (string) --
The private IPv4 address of the network interface.
SourceDestCheck (boolean) --
Indicates whether to validate network traffic to or from this network interface.
Status (string) --
The status of the network interface.
SubnetId (string) --
The ID of the subnet.
VpcId (string) --
The ID of the VPC.
InterfaceType (string) --
Describes the type of network interface.
Valid values: interface | efa
(dict) --
The location where the instance launched, if applicable.
AvailabilityZone (string) --
The Availability Zone of the instance.
If not specified, an Availability Zone will be automatically chosen for you based on the load balancing criteria for the Region.
Affinity (string) --
The affinity setting for the instance on the Dedicated Host. This parameter is not supported for the ImportInstance command.
GroupName (string) --
The name of the placement group the instance is in.
PartitionNumber (integer) --
The number of the partition the instance is in. Valid only if the placement group strategy is set to partition .
HostId (string) --
The ID of the Dedicated Host on which the instance resides. This parameter is not supported for the ImportInstance command.
Tenancy (string) --
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for the ImportInstance command.
SpreadDomain (string) --
Reserved for future use.
(string) --
The value is Windows for Windows instances; otherwise blank.
(string) --
(IPv4 only) The private DNS hostname name assigned to the instance. This DNS hostname can only be used inside the Amazon EC2 network. This name is not available until the instance enters the running state.
[EC2-VPC] The Amazon-provided DNS server resolves Amazon-provided private DNS hostnames if you've enabled DNS resolution and DNS hostnames in your VPC. If you are not using the Amazon-provided DNS server in your VPC, your custom domain name servers must resolve the hostname as appropriate.
(string) --
The private IPv4 address assigned to the instance.
(list) --
The product codes attached to this instance, if applicable.
(dict) --
Describes a product code.
ProductCodeId (string) --
The product code.
ProductCodeType (string) --
The type of product code.
(string) --
(IPv4 only) The public DNS name assigned to the instance. This name is not available until the instance enters the running state. For EC2-VPC, this name is only available if you've enabled DNS hostnames for your VPC.
(string) --
The public IPv4 address assigned to the instance, if applicable.
(string) --
The RAM disk associated with this instance, if applicable.
(string) --
The device name of the root device volume (for example, /dev/sda1 ).
(string) --
The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
(list) --
The security groups for the instance.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
(boolean) --
Specifies whether to enable an instance launched in a VPC to perform NAT. This controls whether source/destination checking is enabled on the instance. A value of true means that checking is enabled, and false means that checking is disabled. The value must be false for the instance to perform NAT. For more information, see NAT Instances in the Amazon Virtual Private Cloud User Guide .
(string) --
If the request is a Spot Instance request, the ID of the request.
(string) --
Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
(dict) --
The current state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
(dict) --
The reason for the most recent state transition.
Code (string) --
The reason code for the state change.
Message (string) --
The message for the state change.
(string) --
The reason for the most recent state transition. This might be an empty string.
(string) --
[EC2-VPC] The ID of the subnet in which the instance is running.
(list) --
Any tags assigned to the instance.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
(string) --
The virtualization type of the instance.
(string) --
[EC2-VPC] The ID of the VPC in which the instance is running.
References
References are related resource instances that have a belongs-to relationship. For more information about references refer to the Resources Introduction Guide.
(ClassicAddress) The related classic_address if set, otherwise None.
(Image) The related image if set, otherwise None.
(KeyPairInfo) The related key_pair if set, otherwise None.
(NetworkInterface) The related network_interfaces if set, otherwise None.
(PlacementGroup) The related placement_group if set, otherwise None.
(Subnet) The related subnet if set, otherwise None.
(Vpc) The related vpc if set, otherwise None.
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.
Links an EC2-Classic instance to a ClassicLink-enabled VPC through one or more of the VPC's security groups. You cannot link an EC2-Classic instance to more than one VPC at a time. You can only link an instance that's in the running state. An instance is automatically unlinked from a VPC when it's stopped - you can link it to the VPC again when you restart it.
After you've linked an instance, you cannot change the VPC security groups that are associated with it. To change the security groups, you must first unlink the instance, and then link it again.
Linking your instance to a VPC is sometimes referred to as attaching your instance.
See also: AWS API Documentation
Request Syntax
response = instance.attach_classic_link_vpc(
DryRun=True|False,
Groups=[
'string',
],
VpcId='string'
)
[REQUIRED]
The ID of one or more of the VPC's security groups. You cannot specify security groups from a different VPC.
[REQUIRED]
The ID of a ClassicLink-enabled VPC.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Attaches an EBS volume to a running or stopped instance and exposes it to the instance with the specified device name.
Encrypted EBS volumes must be attached to instances that support Amazon EBS encryption. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
After you attach an EBS volume, you must make it available. For more information, see Making an EBS Volume Available For Use .
If a volume has an AWS Marketplace product code:
For more information, see Attaching Amazon EBS Volumes in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = instance.attach_volume(
Device='string',
VolumeId='string',
DryRun=True|False
)
[REQUIRED]
The device name (for example, /dev/sdh or xvdh ).
[REQUIRED]
The ID of the EBS volume. The volume and instance must be within the same Availability Zone.
dict
Response Syntax
{
'AttachTime': datetime(2015, 1, 1),
'Device': 'string',
'InstanceId': 'string',
'State': 'attaching'|'attached'|'detaching'|'detached'|'busy',
'VolumeId': 'string',
'DeleteOnTermination': True|False
}
Response Structure
(dict) --
Describes volume attachment details.
AttachTime (datetime) --
The time stamp when the attachment initiated.
Device (string) --
The device name.
InstanceId (string) --
The ID of the instance.
State (string) --
The attachment state of the volume.
VolumeId (string) --
The ID of the volume.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
Gets the console output for the specified instance. For Linux instances, the instance console output displays the exact console output that would normally be displayed on a physical monitor attached to a computer. For Windows instances, the instance console output includes the last three system event log errors.
By default, the console output returns buffered information that was posted shortly after an instance transition state (start, stop, reboot, or terminate). This information is available for at least one hour after the most recent post. Only the most recent 64 KB of console output is available.
You can optionally retrieve the latest serial console output at any time during the instance lifecycle. This option is supported on instance types that use the Nitro hypervisor.
For more information, see Instance Console Output in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = instance.console_output(
DryRun=True|False,
Latest=True|False
)
When enabled, retrieves the latest console output for the instance.
Default: disabled (false )
dict
Response Syntax
{
'InstanceId': 'string',
'Output': 'string',
'Timestamp': datetime(2015, 1, 1)
}
Response Structure
(dict) --
InstanceId (string) --
The ID of the instance.
Output (string) --
The console output, base64-encoded. If you are using a command line tool, the tool decodes the output for you.
Timestamp (datetime) --
The time at which the output was last updated.
Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is either running or stopped.
If you customized your instance with instance store volumes or EBS volumes in addition to the root device volume, the new AMI contains block device mapping information for those volumes. When you launch an instance from this new AMI, the instance automatically launches with those additional volumes.
For more information, see Creating Amazon EBS-Backed Linux AMIs in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
image = instance.create_image(
BlockDeviceMappings=[
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'Iops': 123,
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Encrypted': True|False,
'KmsKeyId': 'string'
},
'NoDevice': 'string'
},
],
Description='string',
DryRun=True|False,
Name='string',
NoReboot=True|False
)
The block device mappings. This parameter cannot be used to modify the encryption status of existing volumes or snapshots. To create an AMI with encrypted snapshots, use the CopyImage action.
Describes a block device mapping.
The device name (for example, /dev/sdh or xvdh ).
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Parameters used to automatically set up EBS volumes when the instance is launched.
Indicates whether the EBS volume is deleted on instance termination.
The number of I/O operations per second (IOPS) that the volume supports. For io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
The ID of the snapshot.
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Constraints: 1-16384 for General Purpose SSD (gp2 ), 4-16384 for Provisioned IOPS SSD (io1 ), 500-16384 for Throughput Optimized HDD (st1 ), 500-16384 for Cold HDD (sc1 ), and 1-1024 for Magnetic (standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
The volume type. If you set the type to io1 , you must also set the Iops property.
Default: standard
Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
In no case can you remove encryption from an encrypted volume.
Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is encrypted.
This parameter is only supported on BlockDeviceMapping objects called by RunInstances , RequestSpotFleet , and RequestSpotInstances .
Suppresses the specified device included in the block device mapping of the AMI.
[REQUIRED]
A name for the new image.
Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)
ec2.Image
Image resource
Adds or overwrites the specified tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide . For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
tag = instance.create_tags(
DryRun=True|False,
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
list(ec2.Tag)
A list of Tag resources
Deletes the specified set of tags from the specified set of resources.
To list the current tags, use DescribeTags . For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = instance.delete_tags(
DryRun=True|False,
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
The tags to delete. Specify a tag key and an optional tag value to delete specific tags. If you specify a tag key without a tag value, we delete any tag with this key regardless of its value. If you specify a tag key with an empty string as the tag value, we delete the tag only if its value is an empty string.
If you omit this parameter, we delete all user-defined tags for the specified resources. We do not delete AWS-generated tags (tags that have the aws: prefix).
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
None
Describes the specified attribute of the specified instance. You can specify only one attribute at a time. Valid attribute values are: instanceType | kernel | ramdisk | userData | disableApiTermination | instanceInitiatedShutdownBehavior | rootDeviceName | blockDeviceMapping | productCodes | sourceDestCheck | groupSet | ebsOptimized | sriovNetSupport
See also: AWS API Documentation
Request Syntax
response = instance.describe_attribute(
Attribute='instanceType'|'kernel'|'ramdisk'|'userData'|'disableApiTermination'|'instanceInitiatedShutdownBehavior'|'rootDeviceName'|'blockDeviceMapping'|'productCodes'|'sourceDestCheck'|'groupSet'|'ebsOptimized'|'sriovNetSupport'|'enaSupport',
DryRun=True|False,
)
[REQUIRED]
The instance attribute.
Note: The enaSupport attribute is not supported at this time.
dict
Response Syntax
{
'Groups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'BlockDeviceMappings': [
{
'DeviceName': 'string',
'Ebs': {
'AttachTime': datetime(2015, 1, 1),
'DeleteOnTermination': True|False,
'Status': 'attaching'|'attached'|'detaching'|'detached',
'VolumeId': 'string'
}
},
],
'DisableApiTermination': {
'Value': True|False
},
'EnaSupport': {
'Value': True|False
},
'EbsOptimized': {
'Value': True|False
},
'InstanceId': 'string',
'InstanceInitiatedShutdownBehavior': {
'Value': 'string'
},
'InstanceType': {
'Value': 'string'
},
'KernelId': {
'Value': 'string'
},
'ProductCodes': [
{
'ProductCodeId': 'string',
'ProductCodeType': 'devpay'|'marketplace'
},
],
'RamdiskId': {
'Value': 'string'
},
'RootDeviceName': {
'Value': 'string'
},
'SourceDestCheck': {
'Value': True|False
},
'SriovNetSupport': {
'Value': 'string'
},
'UserData': {
'Value': 'string'
}
}
Response Structure
(dict) --
Describes an instance attribute.
Groups (list) --
The security groups associated with the instance.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
BlockDeviceMappings (list) --
The block device mapping of the instance.
(dict) --
Describes a block device mapping.
DeviceName (string) --
The device name (for example, /dev/sdh or xvdh ).
Ebs (dict) --
Parameters used to automatically set up EBS volumes when the instance is launched.
AttachTime (datetime) --
The time stamp when the attachment initiated.
DeleteOnTermination (boolean) --
Indicates whether the volume is deleted on instance termination.
Status (string) --
The attachment state.
VolumeId (string) --
The ID of the EBS volume.
DisableApiTermination (dict) --
If the value is true , you can't terminate the instance through the Amazon EC2 console, CLI, or API; otherwise, you can.
Value (boolean) --
The attribute value. The valid values are true or false .
EnaSupport (dict) --
Indicates whether enhanced networking with ENA is enabled.
Value (boolean) --
The attribute value. The valid values are true or false .
EbsOptimized (dict) --
Indicates whether the instance is optimized for Amazon EBS I/O.
Value (boolean) --
The attribute value. The valid values are true or false .
InstanceId (string) --
The ID of the instance.
InstanceInitiatedShutdownBehavior (dict) --
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
Value (string) --
The attribute value. The value is case-sensitive.
InstanceType (dict) --
The instance type.
Value (string) --
The attribute value. The value is case-sensitive.
KernelId (dict) --
The kernel ID.
Value (string) --
The attribute value. The value is case-sensitive.
ProductCodes (list) --
A list of product codes.
(dict) --
Describes a product code.
ProductCodeId (string) --
The product code.
ProductCodeType (string) --
The type of product code.
RamdiskId (dict) --
The RAM disk ID.
Value (string) --
The attribute value. The value is case-sensitive.
RootDeviceName (dict) --
The device name of the root device volume (for example, /dev/sda1 ).
Value (string) --
The attribute value. The value is case-sensitive.
SourceDestCheck (dict) --
Indicates whether source/destination checking is enabled. A value of true means that checking is enabled, and false means that checking is disabled. This value must be false for a NAT instance to perform NAT.
Value (boolean) --
The attribute value. The valid values are true or false .
SriovNetSupport (dict) --
Indicates whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
Value (string) --
The attribute value. The value is case-sensitive.
UserData (dict) --
The user data.
Value (string) --
The attribute value. The value is case-sensitive.
Unlinks (detaches) a linked EC2-Classic instance from a VPC. After the instance has been unlinked, the VPC security groups are no longer associated with it. An instance is automatically unlinked from a VPC when it's stopped.
See also: AWS API Documentation
Request Syntax
response = instance.detach_classic_link_vpc(
DryRun=True|False,
VpcId='string'
)
[REQUIRED]
The ID of the VPC to which the instance is linked.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Detaches an EBS volume from an instance. Make sure to unmount any file systems on the device within your operating system before detaching the volume. Failure to do so can result in the volume becoming stuck in the busy state while detaching. If this happens, detachment can be delayed indefinitely until you unmount the volume, force detachment, reboot the instance, or all three. If an EBS volume is the root device of an instance, it can't be detached while the instance is running. To detach the root volume, stop the instance first.
When a volume with an AWS Marketplace product code is detached from an instance, the product code is no longer associated with the instance.
For more information, see Detaching an Amazon EBS Volume in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = instance.detach_volume(
Device='string',
Force=True|False,
VolumeId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the volume.
dict
Response Syntax
{
'AttachTime': datetime(2015, 1, 1),
'Device': 'string',
'InstanceId': 'string',
'State': 'attaching'|'attached'|'detaching'|'detached'|'busy',
'VolumeId': 'string',
'DeleteOnTermination': True|False
}
Response Structure
(dict) --
Describes volume attachment details.
AttachTime (datetime) --
The time stamp when the attachment initiated.
Device (string) --
The device name.
InstanceId (string) --
The ID of the instance.
State (string) --
The attachment state of the volume.
VolumeId (string) --
The ID of the volume.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
Returns a list of all the available sub-resources for this Resource.
Calls EC2.Client.describe_instances() to update the attributes of the Instance resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
instance.load()
Modifies the specified attribute of the specified instance. You can specify only one attribute at a time.
Note: Using this action to change the security groups associated with an elastic network interface (ENI) attached to an instance in a VPC can result in an error if the instance has more than one ENI. To change the security groups associated with an ENI attached to an instance that has multiple ENIs, we recommend that you use the ModifyNetworkInterfaceAttribute action.
To modify some attributes, the instance must be stopped. For more information, see Modifying Attributes of a Stopped Instance in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = instance.modify_attribute(
SourceDestCheck={
'Value': True|False
},
Attribute='instanceType'|'kernel'|'ramdisk'|'userData'|'disableApiTermination'|'instanceInitiatedShutdownBehavior'|'rootDeviceName'|'blockDeviceMapping'|'productCodes'|'sourceDestCheck'|'groupSet'|'ebsOptimized'|'sriovNetSupport'|'enaSupport',
BlockDeviceMappings=[
{
'DeviceName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'VolumeId': 'string'
},
'NoDevice': 'string',
'VirtualName': 'string'
},
],
DisableApiTermination={
'Value': True|False
},
DryRun=True|False,
EbsOptimized={
'Value': True|False
},
EnaSupport={
'Value': True|False
},
Groups=[
'string',
],
InstanceInitiatedShutdownBehavior={
'Value': 'string'
},
InstanceType={
'Value': 'string'
},
Kernel={
'Value': 'string'
},
Ramdisk={
'Value': 'string'
},
SriovNetSupport={
'Value': 'string'
},
UserData={
'Value': b'bytes'
},
Value='string'
)
Specifies whether source/destination checking is enabled. A value of true means that checking is enabled, and false means that checking is disabled. This value must be false for a NAT instance to perform NAT.
The attribute value. The valid values are true or false .
Modifies the DeleteOnTermination attribute for volumes that are currently attached. The volume must be owned by the caller. If no value is specified for DeleteOnTermination , the default is true and the volume is deleted when the instance is terminated.
To add instance store volumes to an Amazon EBS-backed instance, you must add them when you launch the instance. For more information, see Updating the Block Device Mapping when Launching an Instance in the Amazon Elastic Compute Cloud User Guide .
Describes a block device mapping entry.
The device name (for example, /dev/sdh or xvdh ).
Parameters used to automatically set up EBS volumes when the instance is launched.
Indicates whether the volume is deleted on instance termination.
The ID of the EBS volume.
suppress the specified device included in the block device mapping.
The virtual device name.
If the value is true , you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. You cannot use this parameter for Spot Instances.
The attribute value. The valid values are true or false .
Specifies whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.
The attribute value. The valid values are true or false .
Set to true to enable enhanced networking with ENA for the instance.
This option is supported only for HVM instances. Specifying this option with a PV instance can make it unreachable.
The attribute value. The valid values are true or false .
[EC2-VPC] Changes the security groups of the instance. You must specify at least one security group, even if it's just the default security group for the VPC. You must specify the security group ID, not the security group name.
Specifies whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
The attribute value. The value is case-sensitive.
Changes the instance type to the specified value. For more information, see Instance Types . If the instance type is not valid, the error returned is InvalidInstanceAttributeValue .
The attribute value. The value is case-sensitive.
Changes the instance's kernel to the specified value. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB .
The attribute value. The value is case-sensitive.
Changes the instance's RAM disk to the specified value. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB .
The attribute value. The value is case-sensitive.
Set to simple to enable enhanced networking with the Intel 82599 Virtual Function interface for the instance.
There is no way to disable enhanced networking with the Intel 82599 Virtual Function interface at this time.
This option is supported only for HVM instances. Specifying this option with a PV instance can make it unreachable.
The attribute value. The value is case-sensitive.
Changes the instance's user data to the specified value. If you are using an AWS SDK or command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text.
None
Enables detailed monitoring for a running instance. Otherwise, basic monitoring is enabled. For more information, see Monitoring Your Instances and Volumes in the Amazon Elastic Compute Cloud User Guide .
To disable detailed monitoring, see .
See also: AWS API Documentation
Request Syntax
response = instance.monitor(
DryRun=True|False
)
{
'InstanceMonitorings': [
{
'InstanceId': 'string',
'Monitoring': {
'State': 'disabled'|'disabling'|'enabled'|'pending'
}
},
]
}
Response Structure
The monitoring information.
Describes the monitoring of an instance.
The ID of the instance.
The monitoring for the instance.
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
Retrieves the encrypted administrator password for a running Windows instance.
The Windows password is generated at boot by the EC2Config service or EC2Launch scripts (Windows Server 2016 and later). This usually only happens the first time an instance is launched. For more information, see EC2Config and EC2Launch in the Amazon Elastic Compute Cloud User Guide.
For the EC2Config service, the password is not generated for rebundled AMIs unless Ec2SetPassword is enabled before bundling.
The password is encrypted using the key pair that you specified when you launched the instance. You must provide the corresponding key pair file.
When you launch an instance, password generation and encryption may take a few minutes. If you try to retrieve the password before it's available, the output returns an empty string. We recommend that you wait up to 15 minutes after launching an instance before trying to retrieve the generated password.
See also: AWS API Documentation
Request Syntax
response = instance.password_data(
DryRun=True|False
)
{
'InstanceId': 'string',
'PasswordData': 'string',
'Timestamp': datetime(2015, 1, 1)
}
Response Structure
The ID of the Windows instance.
The password of the instance. Returns an empty string if the password is not available.
The time the data was last updated.
Requests a reboot of the specified instances. This operation is asynchronous; it only queues a request to reboot the specified instances. The operation succeeds if the instances are valid and belong to you. Requests to reboot terminated instances are ignored.
If an instance does not cleanly shut down within four minutes, Amazon EC2 performs a hard reboot.
For more information about troubleshooting, see Getting Console Output and Rebooting Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = instance.reboot(
DryRun=True|False
)
Calls EC2.Client.describe_instances() to update the attributes of the Instance resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
instance.reload()
Submits feedback about the status of an instance. The instance must be in the running state. If your experience with the instance differs from the instance status returned by DescribeInstanceStatus , use ReportInstanceStatus to report your experience with the instance. Amazon EC2 collects this information to improve the accuracy of status checks.
Use of this action does not change the value returned by DescribeInstanceStatus .
See also: AWS API Documentation
Request Syntax
response = instance.report_status(
Description='string',
DryRun=True|False,
EndTime=datetime(2015, 1, 1),
ReasonCodes=[
'instance-stuck-in-state'|'unresponsive'|'not-accepting-credentials'|'password-not-available'|'performance-network'|'performance-instance-store'|'performance-ebs-volume'|'performance-other'|'other',
],
StartTime=datetime(2015, 1, 1),
Status='ok'|'impaired'
)
[REQUIRED]
The reason codes that describe the health state of your instance.
[REQUIRED]
The status of all instances listed.
None
Resets an attribute of an instance to its default value. To reset the kernel or ramdisk , the instance must be in a stopped state. To reset the sourceDestCheck , the instance can be either running or stopped.
The sourceDestCheck attribute controls whether source/destination checking is enabled. The default value is true , which means checking is enabled. This value must be false for a NAT instance to perform NAT. For more information, see NAT Instances in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = instance.reset_attribute(
Attribute='instanceType'|'kernel'|'ramdisk'|'userData'|'disableApiTermination'|'instanceInitiatedShutdownBehavior'|'rootDeviceName'|'blockDeviceMapping'|'productCodes'|'sourceDestCheck'|'groupSet'|'ebsOptimized'|'sriovNetSupport'|'enaSupport',
DryRun=True|False,
)
[REQUIRED]
The attribute to reset.
Warning
You can only reset the following attributes: kernel | ramdisk | sourceDestCheck . To change an instance attribute, use ModifyInstanceAttribute .
None
Resets an attribute of an instance to its default value. To reset the kernel or ramdisk , the instance must be in a stopped state. To reset the sourceDestCheck , the instance can be either running or stopped.
The sourceDestCheck attribute controls whether source/destination checking is enabled. The default value is true , which means checking is enabled. This value must be false for a NAT instance to perform NAT. For more information, see NAT Instances in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = instance.reset_kernel(
DryRun=True|False,
)
Resets an attribute of an instance to its default value. To reset the kernel or ramdisk , the instance must be in a stopped state. To reset the sourceDestCheck , the instance can be either running or stopped.
The sourceDestCheck attribute controls whether source/destination checking is enabled. The default value is true , which means checking is enabled. This value must be false for a NAT instance to perform NAT. For more information, see NAT Instances in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = instance.reset_ramdisk(
DryRun=True|False,
)
Resets an attribute of an instance to its default value. To reset the kernel or ramdisk , the instance must be in a stopped state. To reset the sourceDestCheck , the instance can be either running or stopped.
The sourceDestCheck attribute controls whether source/destination checking is enabled. The default value is true , which means checking is enabled. This value must be false for a NAT instance to perform NAT. For more information, see NAT Instances in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = instance.reset_source_dest_check(
DryRun=True|False,
)
Starts an Amazon EBS-backed instance that you've previously stopped.
Instances that use Amazon EBS volumes as their root devices can be quickly stopped and started. When an instance is stopped, the compute resources are released and you are not billed for instance usage. However, your root partition Amazon EBS volume remains and continues to persist your data, and you are charged for Amazon EBS volume usage. You can restart your instance at any time. Every time you start your Windows instance, Amazon EC2 charges you for a full instance hour. If you stop and restart your Windows instance, a new instance hour begins and Amazon EC2 charges you for another full instance hour even if you are still within the same 60-minute period when it was stopped. Every time you start your Linux instance, Amazon EC2 charges a one-minute minimum for instance usage, and thereafter charges per second for instance usage.
Before stopping an instance, make sure it is in a state from which it can be restarted. Stopping an instance does not preserve data stored in RAM.
Performing this operation on an instance that uses an instance store as its root device returns an error.
For more information, see Stopping Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = instance.start(
AdditionalInfo='string',
DryRun=True|False
)
dict
Response Syntax
{
'StartingInstances': [
{
'CurrentState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceId': 'string',
'PreviousState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
}
},
]
}
Response Structure
(dict) --
StartingInstances (list) --
Information about the started instances.
(dict) --
Describes an instance state change.
CurrentState (dict) --
The current state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
InstanceId (string) --
The ID of the instance.
PreviousState (dict) --
The previous state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
Stops an Amazon EBS-backed instance.
You can use the Stop action to hibernate an instance if the instance is enabled for hibernation and it meets the hibernation prerequisites . For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
We don't charge usage for a stopped instance, or data transfer fees; however, your root partition Amazon EBS volume remains and continues to persist your data, and you are charged for Amazon EBS volume usage. Every time you start your Windows instance, Amazon EC2 charges you for a full instance hour. If you stop and restart your Windows instance, a new instance hour begins and Amazon EC2 charges you for another full instance hour even if you are still within the same 60-minute period when it was stopped. Every time you start your Linux instance, Amazon EC2 charges a one-minute minimum for instance usage, and thereafter charges per second for instance usage.
You can't start, stop, or hibernate Spot Instances, and you can't stop or hibernate instance store-backed instances. For information about using hibernation for Spot Instances, see Hibernating Interrupted Spot Instances in the Amazon Elastic Compute Cloud User Guide .
When you stop or hibernate an instance, we shut it down. You can restart your instance at any time. Before stopping or hibernating an instance, make sure it is in a state from which it can be restarted. Stopping an instance does not preserve data stored in RAM, but hibernating an instance does preserve data stored in RAM. If an instance cannot hibernate successfully, a normal shutdown occurs.
Stopping and hibernating an instance is different to rebooting or terminating it. For example, when you stop or hibernate an instance, the root device and any other devices attached to the instance persist. When you terminate an instance, the root device and any other devices attached during the instance launch are automatically deleted. For more information about the differences between rebooting, stopping, hibernating, and terminating instances, see Instance Lifecycle in the Amazon Elastic Compute Cloud User Guide .
When you stop an instance, we attempt to shut it down forcibly after a short while. If your instance appears stuck in the stopping state after a period of time, there may be an issue with the underlying host computer. For more information, see Troubleshooting Stopping Your Instance in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = instance.stop(
Hibernate=True|False,
DryRun=True|False,
Force=True|False
)
Hibernates the instance if the instance was enabled for hibernation at launch. If the instance cannot hibernate successfully, a normal shutdown occurs. For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
Default: false
Forces the instances to stop. The instances do not have an opportunity to flush file system caches or file system metadata. If you use this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances.
Default: false
dict
Response Syntax
{
'StoppingInstances': [
{
'CurrentState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceId': 'string',
'PreviousState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
}
},
]
}
Response Structure
(dict) --
StoppingInstances (list) --
Information about the stopped instances.
(dict) --
Describes an instance state change.
CurrentState (dict) --
The current state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
InstanceId (string) --
The ID of the instance.
PreviousState (dict) --
The previous state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
Shuts down the specified instances. This operation is idempotent; if you terminate an instance more than once, each call succeeds.
If you specify multiple instances and the request fails (for example, because of a single incorrect instance ID), none of the instances are terminated.
Terminated instances remain visible after termination (for approximately one hour).
By default, Amazon EC2 deletes all EBS volumes that were attached when the instance launched. Volumes attached after instance launch continue running.
You can stop, start, and terminate EBS-backed instances. You can only terminate instance store-backed instances. What happens to an instance differs if you stop it or terminate it. For example, when you stop an instance, the root device and any other devices attached to the instance persist. When you terminate an instance, any attached EBS volumes with the DeleteOnTermination block device mapping parameter set to true are automatically deleted. For more information about the differences between stopping and terminating instances, see Instance Lifecycle in the Amazon Elastic Compute Cloud User Guide .
For more information about troubleshooting, see Troubleshooting Terminating Your Instance in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = instance.terminate(
DryRun=True|False
)
{
'TerminatingInstances': [
{
'CurrentState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceId': 'string',
'PreviousState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
}
},
]
}
Response Structure
Information about the terminated instances.
Describes an instance state change.
The current state of the instance.
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
The current state of the instance.
The ID of the instance.
The previous state of the instance.
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
The current state of the instance.
Disables detailed monitoring for a running instance. For more information, see Monitoring Your Instances and Volumes in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = instance.unmonitor(
DryRun=True|False
)
{
'InstanceMonitorings': [
{
'InstanceId': 'string',
'Monitoring': {
'State': 'disabled'|'disabling'|'enabled'|'pending'
}
},
]
}
Response Structure
The monitoring information.
Describes the monitoring of an instance.
The ID of the instance.
The monitoring for the instance.
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
Collections
Collections provide an interface to iterate over and manipulate groups of resources. For more information about collections refer to the Resources Introduction Guide.
A collection of Volume resources
Creates an iterable of all Volume resources in the collection.
See also: AWS API Documentation
Request Syntax
volume_iterator = instance.volumes.all()
Creates an iterable of all Volume resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
volume_iterator = instance.volumes.filter(
VolumeIds=[
'string',
],
DryRun=True|False,
MaxResults=123,
NextToken='string'
)
The volume IDs.
list(ec2.Volume)
A list of Volume resources
Creates an iterable up to a specified amount of Volume resources in the collection.
See also: AWS API Documentation
Request Syntax
volume_iterator = instance.volumes.limit(
count=123
)
Creates an iterable of all Volume resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
volume_iterator = instance.volumes.page_size(
count=123
)
A collection of VpcAddress resources
Creates an iterable of all VpcAddress resources in the collection.
See also: AWS API Documentation
Request Syntax
vpc_address_iterator = instance.vpc_addresses.all()
Creates an iterable of all VpcAddress resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
vpc_address_iterator = instance.vpc_addresses.filter(
PublicIps=[
'string',
],
AllocationIds=[
'string',
],
DryRun=True|False
)
One or more Elastic IP addresses.
Default: Describes all your Elastic IP addresses.
[EC2-VPC] Information about the allocation IDs.
list(ec2.VpcAddress)
A list of VpcAddress resources
Creates an iterable up to a specified amount of VpcAddress resources in the collection.
See also: AWS API Documentation
Request Syntax
vpc_address_iterator = instance.vpc_addresses.limit(
count=123
)
Creates an iterable of all VpcAddress resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
vpc_address_iterator = instance.vpc_addresses.page_size(
count=123
)
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.
Waits until this Instance is exists. This method calls EC2.Waiter.instance_exists.wait() which polls. EC2.Client.describe_instances() every 5 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
instance.wait_until_exists(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
MaxResults=123,
NextToken='string'
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
None
Waits until this Instance is running. This method calls EC2.Waiter.instance_running.wait() which polls. EC2.Client.describe_instances() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
instance.wait_until_running(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
MaxResults=123,
NextToken='string'
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
None
Waits until this Instance is stopped. This method calls EC2.Waiter.instance_stopped.wait() which polls. EC2.Client.describe_instances() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
instance.wait_until_stopped(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
MaxResults=123,
NextToken='string'
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
None
Waits until this Instance is terminated. This method calls EC2.Waiter.instance_terminated.wait() which polls. EC2.Client.describe_instances() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
instance.wait_until_terminated(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
MaxResults=123,
NextToken='string'
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
None
A resource representing an Amazon Elastic Compute Cloud (EC2) InternetGateway:
import boto3
ec2 = boto3.resource('ec2')
internet_gateway = ec2.InternetGateway('id')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The InternetGateway's id identifier. This must be set.
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.
(list) --
Any VPCs attached to the internet gateway.
(dict) --
Describes the attachment of a VPC to an internet gateway or an egress-only internet gateway.
State (string) --
The current state of the attachment. For an internet gateway, the state is available when attached to a VPC; otherwise, this value is not returned.
VpcId (string) --
The ID of the VPC.
(string) --
The ID of the internet gateway.
(string) --
The ID of the AWS account that owns the internet gateway.
(list) --
Any tags assigned to the internet gateway.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
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.
Attaches an internet gateway to a VPC, enabling connectivity between the internet and the VPC. For more information about your VPC and internet gateway, see the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = internet_gateway.attach_to_vpc(
DryRun=True|False,
VpcId='string'
)
[REQUIRED]
The ID of the VPC.
None
Adds or overwrites the specified tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide . For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
tag = internet_gateway.create_tags(
DryRun=True|False,
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
list(ec2.Tag)
A list of Tag resources
Deletes the specified internet gateway. You must detach the internet gateway from the VPC before you can delete it.
See also: AWS API Documentation
Request Syntax
response = internet_gateway.delete(
DryRun=True|False,
)
Detaches an internet gateway from a VPC, disabling connectivity between the internet and the VPC. The VPC must not contain any running instances with Elastic IP addresses or public IPv4 addresses.
See also: AWS API Documentation
Request Syntax
response = internet_gateway.detach_from_vpc(
DryRun=True|False,
VpcId='string'
)
[REQUIRED]
The ID of the VPC.
None
Returns a list of all the available sub-resources for this Resource.
Calls EC2.Client.describe_internet_gateways() to update the attributes of the InternetGateway resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
internet_gateway.load()
Calls EC2.Client.describe_internet_gateways() to update the attributes of the InternetGateway resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
internet_gateway.reload()
A resource representing an Amazon Elastic Compute Cloud (EC2) KeyPair:
import boto3
ec2 = boto3.resource('ec2')
key_pair = ec2.KeyPair('name')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The KeyPair's name identifier. This must be set.
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.
(string) --
The SHA-1 digest of the DER encoded private key.
(string) --
An unencrypted PEM encoded RSA private key.
(string) --
The name of the key pair.
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.
Deletes the specified key pair, by removing the public key from Amazon EC2.
See also: AWS API Documentation
Request Syntax
response = key_pair.delete(
DryRun=True|False
)
Returns a list of all the available sub-resources for this Resource.
A resource representing an Amazon Elastic Compute Cloud (EC2) KeyPairInfo:
import boto3
ec2 = boto3.resource('ec2')
key_pair_info = ec2.KeyPairInfo('name')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The KeyPairInfo's name identifier. This must be set.
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.
(string) --
If you used CreateKeyPair to create the key pair, this is the SHA-1 digest of the DER encoded private key. If you used ImportKeyPair to provide AWS the public key, this is the MD5 public key fingerprint as specified in section 4 of RFC4716.
(string) --
The name of the key pair.
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.
Deletes the specified key pair, by removing the public key from Amazon EC2.
See also: AWS API Documentation
Request Syntax
response = key_pair_info.delete(
DryRun=True|False
)
Returns a list of all the available sub-resources for this Resource.
Calls EC2.Client.describe_key_pairs() to update the attributes of the KeyPairInfo resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
key_pair_info.load()
Calls EC2.Client.describe_key_pairs() to update the attributes of the KeyPairInfo resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
key_pair_info.reload()
A resource representing an Amazon Elastic Compute Cloud (EC2) NetworkAcl:
import boto3
ec2 = boto3.resource('ec2')
network_acl = ec2.NetworkAcl('id')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available references:
These are the resource's available actions:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The NetworkAcl's id identifier. This must be set.
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.
(list) --
Any associations between the network ACL and one or more subnets
(dict) --
Describes an association between a network ACL and a subnet.
NetworkAclAssociationId (string) --
The ID of the association between a network ACL and a subnet.
NetworkAclId (string) --
The ID of the network ACL.
SubnetId (string) --
The ID of the subnet.
(list) --
One or more entries (rules) in the network ACL.
(dict) --
Describes an entry in a network ACL.
CidrBlock (string) --
The IPv4 network range to allow or deny, in CIDR notation.
Egress (boolean) --
Indicates whether the rule is an egress rule (applied to traffic leaving the subnet).
IcmpTypeCode (dict) --
ICMP protocol: The ICMP type and code.
Code (integer) --
The ICMP code. A value of -1 means all codes for the specified ICMP type.
Type (integer) --
The ICMP type. A value of -1 means all types.
Ipv6CidrBlock (string) --
The IPv6 network range to allow or deny, in CIDR notation.
PortRange (dict) --
TCP or UDP protocols: The range of ports the rule applies to.
From (integer) --
The first port in the range.
To (integer) --
The last port in the range.
Protocol (string) --
The protocol number. A value of "-1" means all protocols.
RuleAction (string) --
Indicates whether to allow or deny the traffic that matches the rule.
RuleNumber (integer) --
The rule number for the entry. ACL entries are processed in ascending order by rule number.
(boolean) --
Indicates whether this is the default network ACL for the VPC.
(string) --
The ID of the network ACL.
(string) --
The ID of the AWS account that owns the network ACL.
(list) --
Any tags assigned to the network ACL.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
(string) --
The ID of the VPC for the network ACL.
References
References are related resource instances that have a belongs-to relationship. For more information about references refer to the Resources Introduction Guide.
(Vpc) The related vpc if set, otherwise None.
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.
Creates an entry (a rule) in a network ACL with the specified rule number. Each network ACL has a set of numbered ingress rules and a separate set of numbered egress rules. When determining whether a packet should be allowed in or out of a subnet associated with the ACL, we process the entries in the ACL according to the rule numbers, in ascending order. Each network ACL has a set of ingress rules and a separate set of egress rules.
We recommend that you leave room between the rule numbers (for example, 100, 110, 120, ...), and not number them one right after the other (for example, 101, 102, 103, ...). This makes it easier to add a rule between existing ones without having to renumber the rules.
After you add an entry, you can't modify it; you must either replace it, or create an entry and delete the old one.
For more information about network ACLs, see Network ACLs in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = network_acl.create_entry(
CidrBlock='string',
DryRun=True|False,
Egress=True|False,
IcmpTypeCode={
'Code': 123,
'Type': 123
},
Ipv6CidrBlock='string',
PortRange={
'From': 123,
'To': 123
},
Protocol='string',
RuleAction='allow'|'deny',
RuleNumber=123
)
[REQUIRED]
Indicates whether this is an egress rule (rule is applied to traffic leaving the subnet).
ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol 1 (ICMP) or protocol 58 (ICMPv6) with an IPv6 CIDR block.
The ICMP code. A value of -1 means all codes for the specified ICMP type.
The ICMP type. A value of -1 means all types.
TCP or UDP protocols: The range of ports the rule applies to. Required if specifying protocol 6 (TCP) or 17 (UDP).
The first port in the range.
The last port in the range.
[REQUIRED]
The protocol number. A value of "-1" means all protocols. If you specify "-1" or a protocol number other than "6" (TCP), "17" (UDP), or "1" (ICMP), traffic on all ports is allowed, regardless of any ports or ICMP types or codes that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR block, traffic for all ICMP types and codes allowed, regardless of any that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv6 CIDR block, you must specify an ICMP type and code.
[REQUIRED]
Indicates whether to allow or deny the traffic that matches the rule.
[REQUIRED]
The rule number for the entry (for example, 100). ACL entries are processed in ascending order by rule number.
Constraints: Positive integer from 1 to 32766. The range 32767 to 65535 is reserved for internal use.
None
Adds or overwrites the specified tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide . For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
tag = network_acl.create_tags(
DryRun=True|False,
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
list(ec2.Tag)
A list of Tag resources
Deletes the specified network ACL. You can't delete the ACL if it's associated with any subnets. You can't delete the default network ACL.
See also: AWS API Documentation
Request Syntax
response = network_acl.delete(
DryRun=True|False,
)
Deletes the specified ingress or egress entry (rule) from the specified network ACL.
See also: AWS API Documentation
Request Syntax
response = network_acl.delete_entry(
DryRun=True|False,
Egress=True|False,
RuleNumber=123
)
[REQUIRED]
Indicates whether the rule is an egress rule.
[REQUIRED]
The rule number of the entry to delete.
None
Returns a list of all the available sub-resources for this Resource.
Calls EC2.Client.describe_network_acls() to update the attributes of the NetworkAcl resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
network_acl.load()
Calls EC2.Client.describe_network_acls() to update the attributes of the NetworkAcl resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
network_acl.reload()
Changes which network ACL a subnet is associated with. By default when you create a subnet, it's automatically associated with the default network ACL. For more information, see Network ACLs in the Amazon Virtual Private Cloud User Guide .
This is an idempotent operation.
See also: AWS API Documentation
Request Syntax
response = network_acl.replace_association(
AssociationId='string',
DryRun=True|False,
)
[REQUIRED]
The ID of the current association between the original network ACL and the subnet.
dict
Response Syntax
{
'NewAssociationId': 'string'
}
Response Structure
(dict) --
NewAssociationId (string) --
The ID of the new association.
Replaces an entry (rule) in a network ACL. For more information, see Network ACLs in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = network_acl.replace_entry(
CidrBlock='string',
DryRun=True|False,
Egress=True|False,
IcmpTypeCode={
'Code': 123,
'Type': 123
},
Ipv6CidrBlock='string',
PortRange={
'From': 123,
'To': 123
},
Protocol='string',
RuleAction='allow'|'deny',
RuleNumber=123
)
[REQUIRED]
Indicates whether to replace the egress rule.
Default: If no value is specified, we replace the ingress rule.
ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol 1 (ICMP) or protocol 58 (ICMPv6) with an IPv6 CIDR block.
The ICMP code. A value of -1 means all codes for the specified ICMP type.
The ICMP type. A value of -1 means all types.
TCP or UDP protocols: The range of ports the rule applies to. Required if specifying protocol 6 (TCP) or 17 (UDP).
The first port in the range.
The last port in the range.
[REQUIRED]
The protocol number. A value of "-1" means all protocols. If you specify "-1" or a protocol number other than "6" (TCP), "17" (UDP), or "1" (ICMP), traffic on all ports is allowed, regardless of any ports or ICMP types or codes that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR block, traffic for all ICMP types and codes allowed, regardless of any that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv6 CIDR block, you must specify an ICMP type and code.
[REQUIRED]
Indicates whether to allow or deny the traffic that matches the rule.
[REQUIRED]
The rule number of the entry to replace.
None
A resource representing an Amazon Elastic Compute Cloud (EC2) NetworkInterface:
import boto3
ec2 = boto3.resource('ec2')
network_interface = ec2.NetworkInterface('id')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available references:
These are the resource's available actions:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The NetworkInterface's id identifier. This must be set.
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.
(dict) --
The association information for an Elastic IP address (IPv4) associated with the network interface.
AllocationId (string) --
The allocation ID.
AssociationId (string) --
The association ID.
IpOwnerId (string) --
The ID of the Elastic IP address owner.
PublicDnsName (string) --
The public DNS name.
PublicIp (string) --
The address of the Elastic IP address bound to the network interface.
(dict) --
The network interface attachment.
AttachTime (datetime) --
The timestamp indicating when the attachment initiated.
AttachmentId (string) --
The ID of the network interface attachment.
DeleteOnTermination (boolean) --
Indicates whether the network interface is deleted when the instance is terminated.
DeviceIndex (integer) --
The device index of the network interface attachment on the instance.
InstanceId (string) --
The ID of the instance.
InstanceOwnerId (string) --
The AWS account ID of the owner of the instance.
Status (string) --
The attachment state.
(string) --
The Availability Zone.
(string) --
A description.
(list) --
Any security groups for the network interface.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
(string) --
The type of network interface.
(list) --
The IPv6 addresses associated with the network interface.
(dict) --
Describes an IPv6 address associated with a network interface.
Ipv6Address (string) --
The IPv6 address.
(string) --
The MAC address.
(string) --
The ID of the network interface.
(string) --
The AWS account ID of the owner of the network interface.
(string) --
The private DNS name.
(string) --
The IPv4 address of the network interface within the subnet.
(list) --
The private IPv4 addresses associated with the network interface.
(dict) --
Describes the private IPv4 address of a network interface.
Association (dict) --
The association information for an Elastic IP address (IPv4) associated with the network interface.
AllocationId (string) --
The allocation ID.
AssociationId (string) --
The association ID.
IpOwnerId (string) --
The ID of the Elastic IP address owner.
PublicDnsName (string) --
The public DNS name.
PublicIp (string) --
The address of the Elastic IP address bound to the network interface.
Primary (boolean) --
Indicates whether this IPv4 address is the primary private IPv4 address of the network interface.
PrivateDnsName (string) --
The private DNS name.
PrivateIpAddress (string) --
The private IPv4 address.
(string) --
The ID of the entity that launched the instance on your behalf (for example, AWS Management Console or Auto Scaling).
(boolean) --
Indicates whether the network interface is being managed by AWS.
(boolean) --
Indicates whether traffic to or from the instance is validated.
(string) --
The status of the network interface.
(string) --
The ID of the subnet.
(list) --
Any tags assigned to the network interface.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
(string) --
The ID of the VPC.
References
References are related resource instances that have a belongs-to relationship. For more information about references refer to the Resources Introduction Guide.
(NetworkInterfaceAssociation) The related association if set, otherwise None.
(Subnet) The related subnet if set, otherwise None.
(Vpc) The related vpc if set, otherwise None.
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.
Assigns one or more secondary private IP addresses to the specified network interface.
You can specify one or more specific secondary IP addresses, or you can specify the number of secondary IP addresses to be automatically assigned within the subnet's CIDR block range. The number of secondary IP addresses that you can assign to an instance varies by instance type. For information about instance types, see Instance Types in the Amazon Elastic Compute Cloud User Guide . For more information about Elastic IP addresses, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide .
When you move a secondary private IP address to another network interface, any Elastic IP address that is associated with the IP address is also moved.
Remapping an IP address is an asynchronous operation. When you move an IP address from one network interface to another, check network/interfaces/macs/mac/local-ipv4s in the instance metadata to confirm that the remapping is complete.
See also: AWS API Documentation
Request Syntax
response = network_interface.assign_private_ip_addresses(
AllowReassignment=True|False,
PrivateIpAddresses=[
'string',
],
SecondaryPrivateIpAddressCount=123
)
One or more IP addresses to be assigned as a secondary private IP address to the network interface. You can't specify this parameter when also specifying a number of secondary IP addresses.
If you don't specify an IP address, Amazon EC2 automatically selects an IP address within the subnet range.
dict
Response Syntax
{
'NetworkInterfaceId': 'string',
'AssignedPrivateIpAddresses': [
{
'PrivateIpAddress': 'string'
},
]
}
Response Structure
(dict) --
NetworkInterfaceId (string) --
The ID of the network interface.
AssignedPrivateIpAddresses (list) --
The private IP addresses assigned to the network interface.
(dict) --
Describes the private IP addresses assigned to a network interface.
PrivateIpAddress (string) --
The private IP address assigned to the network interface.
Attaches a network interface to an instance.
See also: AWS API Documentation
Request Syntax
response = network_interface.attach(
DeviceIndex=123,
DryRun=True|False,
InstanceId='string',
)
[REQUIRED]
The index of the device for the network interface attachment.
[REQUIRED]
The ID of the instance.
dict
Response Syntax
{
'AttachmentId': 'string'
}
Response Structure
(dict) --
Contains the output of AttachNetworkInterface.
AttachmentId (string) --
The ID of the network interface attachment.
Adds or overwrites the specified tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide . For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
tag = network_interface.create_tags(
DryRun=True|False,
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
list(ec2.Tag)
A list of Tag resources
Deletes the specified network interface. You must detach the network interface before you can delete it.
See also: AWS API Documentation
Request Syntax
response = network_interface.delete(
DryRun=True|False,
)
Describes a network interface attribute. You can specify only one attribute at a time.
See also: AWS API Documentation
Request Syntax
response = network_interface.describe_attribute(
Attribute='description'|'groupSet'|'sourceDestCheck'|'attachment',
DryRun=True|False,
)
dict
Response Syntax
{
'Attachment': {
'AttachTime': datetime(2015, 1, 1),
'AttachmentId': 'string',
'DeleteOnTermination': True|False,
'DeviceIndex': 123,
'InstanceId': 'string',
'InstanceOwnerId': 'string',
'Status': 'attaching'|'attached'|'detaching'|'detached'
},
'Description': {
'Value': 'string'
},
'Groups': [
{
'GroupName': 'string',
'GroupId': 'string'
},
],
'NetworkInterfaceId': 'string',
'SourceDestCheck': {
'Value': True|False
}
}
Response Structure
(dict) --
Contains the output of DescribeNetworkInterfaceAttribute.
Attachment (dict) --
The attachment (if any) of the network interface.
AttachTime (datetime) --
The timestamp indicating when the attachment initiated.
AttachmentId (string) --
The ID of the network interface attachment.
DeleteOnTermination (boolean) --
Indicates whether the network interface is deleted when the instance is terminated.
DeviceIndex (integer) --
The device index of the network interface attachment on the instance.
InstanceId (string) --
The ID of the instance.
InstanceOwnerId (string) --
The AWS account ID of the owner of the instance.
Status (string) --
The attachment state.
Description (dict) --
The description of the network interface.
Value (string) --
The attribute value. The value is case-sensitive.
Groups (list) --
The security groups associated with the network interface.
(dict) --
Describes a security group.
GroupName (string) --
The name of the security group.
GroupId (string) --
The ID of the security group.
NetworkInterfaceId (string) --
The ID of the network interface.
SourceDestCheck (dict) --
Indicates whether source/destination checking is enabled.
Value (boolean) --
The attribute value. The valid values are true or false .
Detaches a network interface from an instance.
See also: AWS API Documentation
Request Syntax
response = network_interface.detach(
DryRun=True|False,
Force=True|False
)
None
Returns a list of all the available sub-resources for this Resource.
Calls EC2.Client.describe_network_interfaces() to update the attributes of the NetworkInterface resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
network_interface.load()
Modifies the specified network interface attribute. You can specify only one attribute at a time. You can use this action to attach and detach security groups from an existing EC2 instance.
See also: AWS API Documentation
Request Syntax
response = network_interface.modify_attribute(
Attachment={
'AttachmentId': 'string',
'DeleteOnTermination': True|False
},
Description={
'Value': 'string'
},
DryRun=True|False,
Groups=[
'string',
],
SourceDestCheck={
'Value': True|False
}
)
Information about the interface attachment. If modifying the 'delete on termination' attribute, you must specify the ID of the interface attachment.
The ID of the network interface attachment.
Indicates whether the network interface is deleted when the instance is terminated.
A description for the network interface.
The attribute value. The value is case-sensitive.
Changes the security groups for the network interface. The new set of groups you specify replaces the current set. You must specify at least one group, even if it's just the default security group in the VPC. You must specify the ID of the security group, not the name.
Indicates whether source/destination checking is enabled. A value of true means checking is enabled, and false means checking is disabled. This value must be false for a NAT instance to perform NAT. For more information, see NAT Instances in the Amazon Virtual Private Cloud User Guide .
The attribute value. The valid values are true or false .
None
Calls EC2.Client.describe_network_interfaces() to update the attributes of the NetworkInterface resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
network_interface.reload()
Resets a network interface attribute. You can specify only one attribute at a time.
See also: AWS API Documentation
Request Syntax
response = network_interface.reset_attribute(
DryRun=True|False,
SourceDestCheck='string'
)
None
Unassigns one or more secondary private IP addresses from a network interface.
See also: AWS API Documentation
Request Syntax
response = network_interface.unassign_private_ip_addresses(
PrivateIpAddresses=[
'string',
]
)
[REQUIRED]
The secondary private IP addresses to unassign from the network interface. You can specify this option multiple times to unassign more than one IP address.
A resource representing an Amazon Elastic Compute Cloud (EC2) NetworkInterfaceAssociation:
import boto3
ec2 = boto3.resource('ec2')
network_interface_association = ec2.NetworkInterfaceAssociation('id')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available references:
These are the resource's available actions:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The NetworkInterfaceAssociation's id identifier. This must be set.
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.
(string) --
The ID of the owner of the Elastic IP address.
(string) --
The public DNS name.
(string) --
The public IP address or Elastic IP address bound to the network interface.
References
References are related resource instances that have a belongs-to relationship. For more information about references refer to the Resources Introduction Guide.
(VpcAddress) The related address if set, otherwise None.
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.
Disassociates an Elastic IP address from the instance or network interface it's associated with.
An Elastic IP address is for use in either the EC2-Classic platform or in a VPC. For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide .
This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error.
See also: AWS API Documentation
Request Syntax
response = network_interface_association.delete(
PublicIp='string',
DryRun=True|False
)
None
Returns a list of all the available sub-resources for this Resource.
Calls EC2.Client.describe_network_interfaces() to update the attributes of the NetworkInterfaceAssociation resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
network_interface_association.load()
Calls EC2.Client.describe_network_interfaces() to update the attributes of the NetworkInterfaceAssociation resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
network_interface_association.reload()
A resource representing an Amazon Elastic Compute Cloud (EC2) PlacementGroup:
import boto3
ec2 = boto3.resource('ec2')
placement_group = ec2.PlacementGroup('name')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
These are the resource's available collections:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The PlacementGroup's name identifier. This must be set.
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.
(string) --
The name of the placement group.
(integer) --
The number of partitions. Valid only if strategy is set to partition .
(string) --
The state of the placement group.
(string) --
The placement strategy.
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.
Deletes the specified placement group. You must terminate all instances in the placement group before you can delete the placement group. For more information, see Placement Groups in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = placement_group.delete(
DryRun=True|False,
)
Returns a list of all the available sub-resources for this Resource.
Calls EC2.Client.describe_placement_groups() to update the attributes of the PlacementGroup resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
placement_group.load()
Calls EC2.Client.describe_placement_groups() to update the attributes of the PlacementGroup resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
placement_group.reload()
Collections
Collections provide an interface to iterate over and manipulate groups of resources. For more information about collections refer to the Resources Introduction Guide.
A collection of Instance resources
Creates an iterable of all Instance resources in the collection.
See also: AWS API Documentation
Request Syntax
instance_iterator = placement_group.instances.all()
Adds or overwrites the specified tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide . For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = placement_group.instances.create_tags(
DryRun=True|False,
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
None
Creates an iterable of all Instance resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
instance_iterator = placement_group.instances.filter(
InstanceIds=[
'string',
],
DryRun=True|False,
MaxResults=123,
NextToken='string'
)
The instance IDs.
Default: Describes all your instances.
list(ec2.Instance)
A list of Instance resources
Creates an iterable up to a specified amount of Instance resources in the collection.
See also: AWS API Documentation
Request Syntax
instance_iterator = placement_group.instances.limit(
count=123
)
Enables detailed monitoring for a running instance. Otherwise, basic monitoring is enabled. For more information, see Monitoring Your Instances and Volumes in the Amazon Elastic Compute Cloud User Guide .
To disable detailed monitoring, see .
See also: AWS API Documentation
Request Syntax
response = placement_group.instances.monitor(
DryRun=True|False
)
{
'InstanceMonitorings': [
{
'InstanceId': 'string',
'Monitoring': {
'State': 'disabled'|'disabling'|'enabled'|'pending'
}
},
]
}
Response Structure
The monitoring information.
Describes the monitoring of an instance.
The ID of the instance.
The monitoring for the instance.
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
Creates an iterable of all Instance resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
instance_iterator = placement_group.instances.page_size(
count=123
)
Requests a reboot of the specified instances. This operation is asynchronous; it only queues a request to reboot the specified instances. The operation succeeds if the instances are valid and belong to you. Requests to reboot terminated instances are ignored.
If an instance does not cleanly shut down within four minutes, Amazon EC2 performs a hard reboot.
For more information about troubleshooting, see Getting Console Output and Rebooting Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = placement_group.instances.reboot(
DryRun=True|False
)
Starts an Amazon EBS-backed instance that you've previously stopped.
Instances that use Amazon EBS volumes as their root devices can be quickly stopped and started. When an instance is stopped, the compute resources are released and you are not billed for instance usage. However, your root partition Amazon EBS volume remains and continues to persist your data, and you are charged for Amazon EBS volume usage. You can restart your instance at any time. Every time you start your Windows instance, Amazon EC2 charges you for a full instance hour. If you stop and restart your Windows instance, a new instance hour begins and Amazon EC2 charges you for another full instance hour even if you are still within the same 60-minute period when it was stopped. Every time you start your Linux instance, Amazon EC2 charges a one-minute minimum for instance usage, and thereafter charges per second for instance usage.
Before stopping an instance, make sure it is in a state from which it can be restarted. Stopping an instance does not preserve data stored in RAM.
Performing this operation on an instance that uses an instance store as its root device returns an error.
For more information, see Stopping Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = placement_group.instances.start(
AdditionalInfo='string',
DryRun=True|False
)
dict
Response Syntax
{
'StartingInstances': [
{
'CurrentState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceId': 'string',
'PreviousState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
}
},
]
}
Response Structure
(dict) --
StartingInstances (list) --
Information about the started instances.
(dict) --
Describes an instance state change.
CurrentState (dict) --
The current state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
InstanceId (string) --
The ID of the instance.
PreviousState (dict) --
The previous state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
Stops an Amazon EBS-backed instance.
You can use the Stop action to hibernate an instance if the instance is enabled for hibernation and it meets the hibernation prerequisites . For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
We don't charge usage for a stopped instance, or data transfer fees; however, your root partition Amazon EBS volume remains and continues to persist your data, and you are charged for Amazon EBS volume usage. Every time you start your Windows instance, Amazon EC2 charges you for a full instance hour. If you stop and restart your Windows instance, a new instance hour begins and Amazon EC2 charges you for another full instance hour even if you are still within the same 60-minute period when it was stopped. Every time you start your Linux instance, Amazon EC2 charges a one-minute minimum for instance usage, and thereafter charges per second for instance usage.
You can't start, stop, or hibernate Spot Instances, and you can't stop or hibernate instance store-backed instances. For information about using hibernation for Spot Instances, see Hibernating Interrupted Spot Instances in the Amazon Elastic Compute Cloud User Guide .
When you stop or hibernate an instance, we shut it down. You can restart your instance at any time. Before stopping or hibernating an instance, make sure it is in a state from which it can be restarted. Stopping an instance does not preserve data stored in RAM, but hibernating an instance does preserve data stored in RAM. If an instance cannot hibernate successfully, a normal shutdown occurs.
Stopping and hibernating an instance is different to rebooting or terminating it. For example, when you stop or hibernate an instance, the root device and any other devices attached to the instance persist. When you terminate an instance, the root device and any other devices attached during the instance launch are automatically deleted. For more information about the differences between rebooting, stopping, hibernating, and terminating instances, see Instance Lifecycle in the Amazon Elastic Compute Cloud User Guide .
When you stop an instance, we attempt to shut it down forcibly after a short while. If your instance appears stuck in the stopping state after a period of time, there may be an issue with the underlying host computer. For more information, see Troubleshooting Stopping Your Instance in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = placement_group.instances.stop(
Hibernate=True|False,
DryRun=True|False,
Force=True|False
)
Hibernates the instance if the instance was enabled for hibernation at launch. If the instance cannot hibernate successfully, a normal shutdown occurs. For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
Default: false
Forces the instances to stop. The instances do not have an opportunity to flush file system caches or file system metadata. If you use this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances.
Default: false
dict
Response Syntax
{
'StoppingInstances': [
{
'CurrentState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceId': 'string',
'PreviousState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
}
},
]
}
Response Structure
(dict) --
StoppingInstances (list) --
Information about the stopped instances.
(dict) --
Describes an instance state change.
CurrentState (dict) --
The current state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
InstanceId (string) --
The ID of the instance.
PreviousState (dict) --
The previous state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
Shuts down the specified instances. This operation is idempotent; if you terminate an instance more than once, each call succeeds.
If you specify multiple instances and the request fails (for example, because of a single incorrect instance ID), none of the instances are terminated.
Terminated instances remain visible after termination (for approximately one hour).
By default, Amazon EC2 deletes all EBS volumes that were attached when the instance launched. Volumes attached after instance launch continue running.
You can stop, start, and terminate EBS-backed instances. You can only terminate instance store-backed instances. What happens to an instance differs if you stop it or terminate it. For example, when you stop an instance, the root device and any other devices attached to the instance persist. When you terminate an instance, any attached EBS volumes with the DeleteOnTermination block device mapping parameter set to true are automatically deleted. For more information about the differences between stopping and terminating instances, see Instance Lifecycle in the Amazon Elastic Compute Cloud User Guide .
For more information about troubleshooting, see Troubleshooting Terminating Your Instance in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = placement_group.instances.terminate(
DryRun=True|False
)
{
'TerminatingInstances': [
{
'CurrentState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceId': 'string',
'PreviousState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
}
},
]
}
Response Structure
Information about the terminated instances.
Describes an instance state change.
The current state of the instance.
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
The current state of the instance.
The ID of the instance.
The previous state of the instance.
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
The current state of the instance.
Disables detailed monitoring for a running instance. For more information, see Monitoring Your Instances and Volumes in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = placement_group.instances.unmonitor(
DryRun=True|False
)
{
'InstanceMonitorings': [
{
'InstanceId': 'string',
'Monitoring': {
'State': 'disabled'|'disabling'|'enabled'|'pending'
}
},
]
}
Response Structure
The monitoring information.
Describes the monitoring of an instance.
The ID of the instance.
The monitoring for the instance.
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
A resource representing an Amazon Elastic Compute Cloud (EC2) Route:
import boto3
ec2 = boto3.resource('ec2')
route = ec2.Route('route_table_id','destination_cidr_block')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
These are the resource's available sub-resources:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The Route's route_table_id identifier. This must be set.
(string) The Route's destination_cidr_block identifier. This must be set.
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.
(string) --
The IPv6 CIDR block used for the destination match.
(string) --
The prefix of the AWS service.
(string) --
The ID of the egress-only internet gateway.
(string) --
The ID of a gateway attached to your VPC.
(string) --
The ID of a NAT instance in your VPC.
(string) --
The AWS account ID of the owner of the instance.
(string) --
The ID of a NAT gateway.
(string) --
The ID of the network interface.
(string) --
Describes how the route was created.
(string) --
The state of the route. The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, or the specified NAT instance has been terminated).
(string) --
The ID of a transit gateway.
(string) --
The ID of a VPC peering connection.
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.
Deletes the specified route from the specified route table.
See also: AWS API Documentation
Request Syntax
response = route.delete(
DestinationIpv6CidrBlock='string',
DryRun=True|False,
)
None
Returns a list of all the available sub-resources for this Resource.
Replaces an existing route within a route table in a VPC. You must provide only one of the following: internet gateway or virtual private gateway, NAT instance, NAT gateway, VPC peering connection, network interface, or egress-only internet gateway.
For more information, see Route Tables in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = route.replace(
DestinationIpv6CidrBlock='string',
DryRun=True|False,
EgressOnlyInternetGatewayId='string',
GatewayId='string',
InstanceId='string',
NatGatewayId='string',
TransitGatewayId='string',
NetworkInterfaceId='string',
VpcPeeringConnectionId='string'
)
None
Sub-resources
Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide.
Creates a RouteTable resource.:
route_table = route.RouteTable()
A resource representing an Amazon Elastic Compute Cloud (EC2) RouteTable:
import boto3
ec2 = boto3.resource('ec2')
route_table = ec2.RouteTable('id')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available references:
These are the resource's available actions:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The RouteTable's id identifier. This must be set.
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.
(list) --
The associations between the route table and one or more subnets.
(dict) --
Describes an association between a route table and a subnet.
Main (boolean) --
Indicates whether this is the main route table.
RouteTableAssociationId (string) --
The ID of the association between a route table and a subnet.
RouteTableId (string) --
The ID of the route table.
SubnetId (string) --
The ID of the subnet. A subnet ID is not returned for an implicit association.
(string) --
The ID of the AWS account that owns the route table.
(list) --
Any virtual private gateway (VGW) propagating routes.
(dict) --
Describes a virtual private gateway propagating route.
GatewayId (string) --
The ID of the virtual private gateway.
(string) --
The ID of the route table.
(list) --
The routes in the route table.
(dict) --
Describes a route in a route table.
DestinationCidrBlock (string) --
The IPv4 CIDR block used for the destination match.
DestinationIpv6CidrBlock (string) --
The IPv6 CIDR block used for the destination match.
DestinationPrefixListId (string) --
The prefix of the AWS service.
EgressOnlyInternetGatewayId (string) --
The ID of the egress-only internet gateway.
GatewayId (string) --
The ID of a gateway attached to your VPC.
InstanceId (string) --
The ID of a NAT instance in your VPC.
InstanceOwnerId (string) --
The AWS account ID of the owner of the instance.
NatGatewayId (string) --
The ID of a NAT gateway.
TransitGatewayId (string) --
The ID of a transit gateway.
NetworkInterfaceId (string) --
The ID of the network interface.
Origin (string) --
Describes how the route was created.
State (string) --
The state of the route. The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, or the specified NAT instance has been terminated).
VpcPeeringConnectionId (string) --
The ID of a VPC peering connection.
(list) --
Any tags assigned to the route table.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
(string) --
The ID of the VPC.
References
References are related resource instances that have a belongs-to relationship. For more information about references refer to the Resources Introduction Guide.
(RouteTableAssociation) The related associations if set, otherwise None.
(Route) The related routes if set, otherwise None.
(Vpc) The related vpc if set, otherwise None.
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.
Associates a subnet with a route table. The subnet and route table must be in the same VPC. This association causes traffic originating from the subnet to be routed according to the routes in the route table. The action returns an association ID, which you need in order to disassociate the route table from the subnet later. A route table can be associated with multiple subnets.
For more information, see Route Tables in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
route_table_association = route_table.associate_with_subnet(
DryRun=True|False,
SubnetId='string'
)
[REQUIRED]
The ID of the subnet.
ec2.RouteTableAssociation
RouteTableAssociation resource
Creates a route in a route table within a VPC.
You must specify one of the following targets: internet gateway or virtual private gateway, NAT instance, NAT gateway, VPC peering connection, network interface, or egress-only internet gateway.
When determining how to route traffic, we use the route with the most specific match. For example, traffic is destined for the IPv4 address 192.0.2.3 , and the route table includes the following two IPv4 routes:
Both routes apply to the traffic destined for 192.0.2.3 . However, the second route in the list covers a smaller number of IP addresses and is therefore more specific, so we use that route to determine where to target the traffic.
For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
route = route_table.create_route(
DestinationCidrBlock='string',
DestinationIpv6CidrBlock='string',
DryRun=True|False,
EgressOnlyInternetGatewayId='string',
GatewayId='string',
InstanceId='string',
NatGatewayId='string',
TransitGatewayId='string',
NetworkInterfaceId='string',
VpcPeeringConnectionId='string'
)
ec2.Route
Route resource
Adds or overwrites the specified tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide . For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
tag = route_table.create_tags(
DryRun=True|False,
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
list(ec2.Tag)
A list of Tag resources
Deletes the specified route table. You must disassociate the route table from any subnets before you can delete it. You can't delete the main route table.
See also: AWS API Documentation
Request Syntax
response = route_table.delete(
DryRun=True|False,
)
Returns a list of all the available sub-resources for this Resource.
Calls EC2.Client.describe_route_tables() to update the attributes of the RouteTable resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
route_table.load()
Calls EC2.Client.describe_route_tables() to update the attributes of the RouteTable resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
route_table.reload()
A resource representing an Amazon Elastic Compute Cloud (EC2) RouteTableAssociation:
import boto3
ec2 = boto3.resource('ec2')
route_table_association = ec2.RouteTableAssociation('id')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available references:
These are the resource's available actions:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The RouteTableAssociation's id identifier. This must be set.
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.
(boolean) --
Indicates whether this is the main route table.
(string) --
The ID of the association between a route table and a subnet.
(string) --
The ID of the route table.
(string) --
The ID of the subnet. A subnet ID is not returned for an implicit association.
References
References are related resource instances that have a belongs-to relationship. For more information about references refer to the Resources Introduction Guide.
(RouteTable) The related route_table if set, otherwise None.
(Subnet) The related subnet if set, otherwise None.
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.
Disassociates a subnet from a route table.
After you perform this action, the subnet no longer uses the routes in the route table. Instead, it uses the routes in the VPC's main route table. For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = route_table_association.delete(
DryRun=True|False
)
Returns a list of all the available sub-resources for this Resource.
Changes the route table associated with a given subnet in a VPC. After the operation completes, the subnet uses the routes in the new route table it's associated with. For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide .
You can also use ReplaceRouteTableAssociation to change which table is the main route table in the VPC. You just specify the main route table's association ID and the route table to be the new main route table.
See also: AWS API Documentation
Request Syntax
route_table_association = route_table_association.replace_subnet(
DryRun=True|False,
RouteTableId='string'
)
[REQUIRED]
The ID of the new route table to associate with the subnet.
ec2.RouteTableAssociation
RouteTableAssociation resource
A resource representing an Amazon Elastic Compute Cloud (EC2) SecurityGroup:
import boto3
ec2 = boto3.resource('ec2')
security_group = ec2.SecurityGroup('id')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The SecurityGroup's id identifier. This must be set.
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.
(string) --
A description of the security group.
(string) --
The ID of the security group.
(string) --
The name of the security group.
(list) --
The inbound rules associated with the security group.
(dict) --
Describes a set of permissions for a security group rule.
FromPort (integer) --
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
IpProtocol (string) --
The IP protocol name (tcp , udp , icmp , icmpv6 ) or number (see Protocol Numbers ).
[VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp , udp , icmp , or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp , udp , and icmp , you must specify a port range. For icmpv6 , the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
IpRanges (list) --
The IPv4 ranges.
(dict) --
Describes an IPv4 range.
CidrIp (string) --
The IPv4 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv4 address, use the /32 prefix length.
Description (string) --
A description for the security group rule that references this IPv4 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
Ipv6Ranges (list) --
[VPC only] The IPv6 ranges.
(dict) --
[EC2-VPC only] Describes an IPv6 range.
CidrIpv6 (string) --
The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv6 address, use the /128 prefix length.
Description (string) --
A description for the security group rule that references this IPv6 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
PrefixListIds (list) --
[VPC only] The prefix list IDs for an AWS service. With outbound rules, this is the AWS service to access through a VPC endpoint from instances associated with the security group.
(dict) --
Describes a prefix list ID.
Description (string) --
A description for the security group rule that references this prefix list ID.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
PrefixListId (string) --
The ID of the prefix.
ToPort (integer) --
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
UserIdGroupPairs (list) --
The security group and AWS account ID pairs.
(dict) --
Describes a security group and AWS account ID pair.
Description (string) --
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
GroupId (string) --
The ID of the security group.
GroupName (string) --
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
PeeringStatus (string) --
The status of a VPC peering connection, if applicable.
UserId (string) --
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
VpcId (string) --
The ID of the VPC for the referenced security group, if applicable.
VpcPeeringConnectionId (string) --
The ID of the VPC peering connection, if applicable.
(list) --
[VPC only] The outbound rules associated with the security group.
(dict) --
Describes a set of permissions for a security group rule.
FromPort (integer) --
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
IpProtocol (string) --
The IP protocol name (tcp , udp , icmp , icmpv6 ) or number (see Protocol Numbers ).
[VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp , udp , icmp , or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp , udp , and icmp , you must specify a port range. For icmpv6 , the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
IpRanges (list) --
The IPv4 ranges.
(dict) --
Describes an IPv4 range.
CidrIp (string) --
The IPv4 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv4 address, use the /32 prefix length.
Description (string) --
A description for the security group rule that references this IPv4 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
Ipv6Ranges (list) --
[VPC only] The IPv6 ranges.
(dict) --
[EC2-VPC only] Describes an IPv6 range.
CidrIpv6 (string) --
The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv6 address, use the /128 prefix length.
Description (string) --
A description for the security group rule that references this IPv6 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
PrefixListIds (list) --
[VPC only] The prefix list IDs for an AWS service. With outbound rules, this is the AWS service to access through a VPC endpoint from instances associated with the security group.
(dict) --
Describes a prefix list ID.
Description (string) --
A description for the security group rule that references this prefix list ID.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
PrefixListId (string) --
The ID of the prefix.
ToPort (integer) --
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
UserIdGroupPairs (list) --
The security group and AWS account ID pairs.
(dict) --
Describes a security group and AWS account ID pair.
Description (string) --
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
GroupId (string) --
The ID of the security group.
GroupName (string) --
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
PeeringStatus (string) --
The status of a VPC peering connection, if applicable.
UserId (string) --
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
VpcId (string) --
The ID of the VPC for the referenced security group, if applicable.
VpcPeeringConnectionId (string) --
The ID of the VPC peering connection, if applicable.
(string) --
The AWS account ID of the owner of the security group.
(list) --
Any tags assigned to the security group.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
(string) --
[VPC only] The ID of the VPC for the security group.
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.
[VPC only] Adds the specified egress rules to a security group for use with a VPC.
An outbound rule permits instances to send traffic to the specified IPv4 or IPv6 CIDR address ranges, or to the instances associated with the specified destination security groups.
You specify a protocol for each rule (for example, TCP). For the TCP and UDP protocols, you must also specify the destination port or port range. For the ICMP protocol, you must also specify the ICMP type and code. You can use -1 for the type or code to mean all types or all codes.
Rule changes are propagated to affected instances as quickly as possible. However, a small delay might occur.
For more information about VPC security group limits, see Amazon VPC Limits .
See also: AWS API Documentation
Request Syntax
response = security_group.authorize_egress(
DryRun=True|False,
IpPermissions=[
{
'FromPort': 123,
'IpProtocol': 'string',
'IpRanges': [
{
'CidrIp': 'string',
'Description': 'string'
},
],
'Ipv6Ranges': [
{
'CidrIpv6': 'string',
'Description': 'string'
},
],
'PrefixListIds': [
{
'Description': 'string',
'PrefixListId': 'string'
},
],
'ToPort': 123,
'UserIdGroupPairs': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'PeeringStatus': 'string',
'UserId': 'string',
'VpcId': 'string',
'VpcPeeringConnectionId': 'string'
},
]
},
],
CidrIp='string',
FromPort=123,
IpProtocol='string',
ToPort=123,
SourceSecurityGroupName='string',
SourceSecurityGroupOwnerId='string'
)
The sets of IP permissions. You can't specify a destination security group and a CIDR IP address range in the same set of permissions.
Describes a set of permissions for a security group rule.
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The IP protocol name (tcp , udp , icmp , icmpv6 ) or number (see Protocol Numbers ).
[VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp , udp , icmp , or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp , udp , and icmp , you must specify a port range. For icmpv6 , the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
The IPv4 ranges.
Describes an IPv4 range.
The IPv4 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv4 address, use the /32 prefix length.
A description for the security group rule that references this IPv4 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The IPv6 ranges.
[EC2-VPC only] Describes an IPv6 range.
The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv6 address, use the /128 prefix length.
A description for the security group rule that references this IPv6 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The prefix list IDs for an AWS service. With outbound rules, this is the AWS service to access through a VPC endpoint from instances associated with the security group.
Describes a prefix list ID.
A description for the security group rule that references this prefix list ID.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the prefix.
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The security group and AWS account ID pairs.
Describes a security group and AWS account ID pair.
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the security group.
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
The status of a VPC peering connection, if applicable.
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
The ID of the VPC for the referenced security group, if applicable.
The ID of the VPC peering connection, if applicable.
None
Adds the specified ingress rules to a security group.
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 CIDR address ranges, or from the instances associated with the specified destination security groups.
You specify a protocol for each rule (for example, TCP). For TCP and UDP, you must also specify the destination port or port range. For ICMP/ICMPv6, you must also specify the ICMP/ICMPv6 type and code. You can use -1 to mean all types or all codes.
Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay might occur.
For more information about VPC security group limits, see Amazon VPC Limits .
See also: AWS API Documentation
Request Syntax
response = security_group.authorize_ingress(
CidrIp='string',
FromPort=123,
GroupName='string',
IpPermissions=[
{
'FromPort': 123,
'IpProtocol': 'string',
'IpRanges': [
{
'CidrIp': 'string',
'Description': 'string'
},
],
'Ipv6Ranges': [
{
'CidrIpv6': 'string',
'Description': 'string'
},
],
'PrefixListIds': [
{
'Description': 'string',
'PrefixListId': 'string'
},
],
'ToPort': 123,
'UserIdGroupPairs': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'PeeringStatus': 'string',
'UserId': 'string',
'VpcId': 'string',
'VpcPeeringConnectionId': 'string'
},
]
},
],
IpProtocol='string',
SourceSecurityGroupName='string',
SourceSecurityGroupOwnerId='string',
ToPort=123,
DryRun=True|False
)
The IPv4 address range, in CIDR format. You can't specify this parameter when specifying a source security group. To specify an IPv6 address range, use a set of IP permissions.
Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.
The start of port range for the TCP and UDP protocols, or an ICMP type number. For the ICMP type number, use -1 to specify all types. If you specify all ICMP types, you must specify all codes.
Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.
The sets of IP permissions.
Describes a set of permissions for a security group rule.
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The IP protocol name (tcp , udp , icmp , icmpv6 ) or number (see Protocol Numbers ).
[VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp , udp , icmp , or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp , udp , and icmp , you must specify a port range. For icmpv6 , the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
The IPv4 ranges.
Describes an IPv4 range.
The IPv4 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv4 address, use the /32 prefix length.
A description for the security group rule that references this IPv4 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The IPv6 ranges.
[EC2-VPC only] Describes an IPv6 range.
The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv6 address, use the /128 prefix length.
A description for the security group rule that references this IPv6 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The prefix list IDs for an AWS service. With outbound rules, this is the AWS service to access through a VPC endpoint from instances associated with the security group.
Describes a prefix list ID.
A description for the security group rule that references this prefix list ID.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the prefix.
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The security group and AWS account ID pairs.
Describes a security group and AWS account ID pair.
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the security group.
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
The status of a VPC peering connection, if applicable.
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
The ID of the VPC for the referenced security group, if applicable.
The ID of the VPC peering connection, if applicable.
The IP protocol name (tcp , udp , icmp ) or number (see Protocol Numbers ). To specify icmpv6 , use a set of IP permissions.
[VPC only] Use -1 to specify all protocols. If you specify -1 or a protocol other than tcp , udp , or icmp , traffic on all ports is allowed, regardless of any ports you specify.
Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.
The end of port range for the TCP and UDP protocols, or an ICMP code number. For the ICMP code number, use -1 to specify all codes. If you specify all ICMP types, you must specify all codes.
Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.
None
Adds or overwrites the specified tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide . For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
tag = security_group.create_tags(
DryRun=True|False,
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
list(ec2.Tag)
A list of Tag resources
Deletes a security group.
If you attempt to delete a security group that is associated with an instance, or is referenced by another security group, the operation fails with InvalidGroup.InUse in EC2-Classic or DependencyViolation in EC2-VPC.
See also: AWS API Documentation
Request Syntax
response = security_group.delete(
GroupName='string',
DryRun=True|False
)
None
Returns a list of all the available sub-resources for this Resource.
Calls EC2.Client.describe_security_groups() to update the attributes of the SecurityGroup resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
security_group.load()
Calls EC2.Client.describe_security_groups() to update the attributes of the SecurityGroup resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
security_group.reload()
[VPC only] Removes the specified egress rules from a security group for EC2-VPC. This action doesn't apply to security groups for use in EC2-Classic. To remove a rule, the values that you specify (for example, ports) must match the existing rule's values exactly.
Each rule consists of the protocol and the IPv4 or IPv6 CIDR range or source security group. For the TCP and UDP protocols, you must also specify the destination port or range of ports. For the ICMP protocol, you must also specify the ICMP type and code. If the security group rule has a description, you do not have to specify the description to revoke the rule.
Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay might occur.
See also: AWS API Documentation
Request Syntax
response = security_group.revoke_egress(
DryRun=True|False,
IpPermissions=[
{
'FromPort': 123,
'IpProtocol': 'string',
'IpRanges': [
{
'CidrIp': 'string',
'Description': 'string'
},
],
'Ipv6Ranges': [
{
'CidrIpv6': 'string',
'Description': 'string'
},
],
'PrefixListIds': [
{
'Description': 'string',
'PrefixListId': 'string'
},
],
'ToPort': 123,
'UserIdGroupPairs': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'PeeringStatus': 'string',
'UserId': 'string',
'VpcId': 'string',
'VpcPeeringConnectionId': 'string'
},
]
},
],
CidrIp='string',
FromPort=123,
IpProtocol='string',
ToPort=123,
SourceSecurityGroupName='string',
SourceSecurityGroupOwnerId='string'
)
The sets of IP permissions. You can't specify a destination security group and a CIDR IP address range in the same set of permissions.
Describes a set of permissions for a security group rule.
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The IP protocol name (tcp , udp , icmp , icmpv6 ) or number (see Protocol Numbers ).
[VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp , udp , icmp , or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp , udp , and icmp , you must specify a port range. For icmpv6 , the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
The IPv4 ranges.
Describes an IPv4 range.
The IPv4 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv4 address, use the /32 prefix length.
A description for the security group rule that references this IPv4 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The IPv6 ranges.
[EC2-VPC only] Describes an IPv6 range.
The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv6 address, use the /128 prefix length.
A description for the security group rule that references this IPv6 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The prefix list IDs for an AWS service. With outbound rules, this is the AWS service to access through a VPC endpoint from instances associated with the security group.
Describes a prefix list ID.
A description for the security group rule that references this prefix list ID.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the prefix.
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The security group and AWS account ID pairs.
Describes a security group and AWS account ID pair.
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the security group.
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
The status of a VPC peering connection, if applicable.
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
The ID of the VPC for the referenced security group, if applicable.
The ID of the VPC peering connection, if applicable.
None
Removes the specified ingress rules from a security group. To remove a rule, the values that you specify (for example, ports) must match the existing rule's values exactly.
Note
[EC2-Classic only] If the values you specify do not match the existing rule's values, no error is returned. Use DescribeSecurityGroups to verify that the rule has been removed.
Each rule consists of the protocol and the CIDR range or source security group. For the TCP and UDP protocols, you must also specify the destination port or range of ports. For the ICMP protocol, you must also specify the ICMP type and code. If the security group rule has a description, you do not have to specify the description to revoke the rule.
Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay might occur.
See also: AWS API Documentation
Request Syntax
response = security_group.revoke_ingress(
CidrIp='string',
FromPort=123,
GroupName='string',
IpPermissions=[
{
'FromPort': 123,
'IpProtocol': 'string',
'IpRanges': [
{
'CidrIp': 'string',
'Description': 'string'
},
],
'Ipv6Ranges': [
{
'CidrIpv6': 'string',
'Description': 'string'
},
],
'PrefixListIds': [
{
'Description': 'string',
'PrefixListId': 'string'
},
],
'ToPort': 123,
'UserIdGroupPairs': [
{
'Description': 'string',
'GroupId': 'string',
'GroupName': 'string',
'PeeringStatus': 'string',
'UserId': 'string',
'VpcId': 'string',
'VpcPeeringConnectionId': 'string'
},
]
},
],
IpProtocol='string',
SourceSecurityGroupName='string',
SourceSecurityGroupOwnerId='string',
ToPort=123,
DryRun=True|False
)
The sets of IP permissions. You can't specify a source security group and a CIDR IP address range in the same set of permissions.
Describes a set of permissions for a security group rule.
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The IP protocol name (tcp , udp , icmp , icmpv6 ) or number (see Protocol Numbers ).
[VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp , udp , icmp , or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp , udp , and icmp , you must specify a port range. For icmpv6 , the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
The IPv4 ranges.
Describes an IPv4 range.
The IPv4 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv4 address, use the /32 prefix length.
A description for the security group rule that references this IPv4 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The IPv6 ranges.
[EC2-VPC only] Describes an IPv6 range.
The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv6 address, use the /128 prefix length.
A description for the security group rule that references this IPv6 address range.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
[VPC only] The prefix list IDs for an AWS service. With outbound rules, this is the AWS service to access through a VPC endpoint from instances associated with the security group.
Describes a prefix list ID.
A description for the security group rule that references this prefix list ID.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the prefix.
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
The security group and AWS account ID pairs.
Describes a security group and AWS account ID pair.
A description for the security group rule that references this user ID group pair.
Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
The ID of the security group.
The name of the security group. In a request, use this parameter for a security group in EC2-Classic or a default VPC only. For a security group in a nondefault VPC, use the security group ID.
For a referenced security group in another VPC, this value is not returned if the referenced security group is deleted.
The status of a VPC peering connection, if applicable.
The ID of an AWS account.
For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.
[EC2-Classic] Required when adding or removing rules that reference a security group in another AWS account.
The ID of the VPC for the referenced security group, if applicable.
The ID of the VPC peering connection, if applicable.
None
A resource representing an Amazon Elastic Compute Cloud (EC2) Snapshot:
import boto3
ec2 = boto3.resource('ec2')
snapshot = ec2.Snapshot('id')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available references:
These are the resource's available actions:
These are the resource's available waiters:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The Snapshot's id identifier. This must be set.
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.
(string) --
The data encryption key identifier for the snapshot. This value is a unique identifier that corresponds to the data encryption key that was used to encrypt the original volume or snapshot copy. Because data encryption keys are inherited by volumes created from snapshots, and vice versa, if snapshots share the same data encryption key identifier, then they belong to the same volume/snapshot lineage. This parameter is only returned by DescribeSnapshots .
(string) --
The description for the snapshot.
(boolean) --
Indicates whether the snapshot is encrypted.
(string) --
The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the volume encryption key for the parent volume.
(string) --
Value from an Amazon-maintained list (amazon | self | all | aws-marketplace | microsoft ) of snapshot owners. Not to be confused with the user-configured AWS account alias, which is set from the IAM console.
(string) --
The AWS account ID of the EBS snapshot owner.
(string) --
The progress of the snapshot, as a percentage.
(string) --
The ID of the snapshot. Each snapshot receives a unique identifier when it is created.
(datetime) --
The time stamp when the snapshot was initiated.
(string) --
The snapshot state.
(string) --
Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy operation fails (for example, if the proper AWS Key Management Service (AWS KMS) permissions are not obtained) this field displays error state details to help you diagnose why the error occurred. This parameter is only returned by DescribeSnapshots .
(list) --
Any tags assigned to the snapshot.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
(string) --
The ID of the volume that was used to create the snapshot. Snapshots created by the CopySnapshot action have an arbitrary volume ID that should not be used for any purpose.
(integer) --
The size of the volume, in GiB.
References
References are related resource instances that have a belongs-to relationship. For more information about references refer to the Resources Introduction Guide.
(Volume) The related volume if set, otherwise None.
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.
Copies a point-in-time snapshot of an EBS volume and stores it in Amazon S3. You can copy the snapshot within the same Region or from one Region to another. You can use the snapshot to create EBS volumes or Amazon Machine Images (AMIs).
Copies of encrypted EBS snapshots remain encrypted. Copies of unencrypted snapshots remain unencrypted, unless you enable encryption for the snapshot copy operation. By default, encrypted snapshot copies use the default AWS Key Management Service (AWS KMS) customer master key (CMK); however, you can specify a different CMK.
To copy an encrypted snapshot that has been shared from another account, you must have permissions for the CMK used to encrypt the snapshot.
Snapshots created by copying another snapshot have an arbitrary volume ID that should not be used for any purpose.
For more information, see Copying an Amazon EBS Snapshot in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = snapshot.copy(
Description='string',
Encrypted=True|False,
KmsKeyId='string',
SourceRegion='string',
DryRun=True|False
)
The destination Region to use in the PresignedUrl parameter of a snapshot copy operation. This parameter is only valid for specifying the destination Region in a PresignedUrl parameter, where it is required.
The snapshot copy is sent to the regional endpoint that you sent the HTTP request to (for example, ec2.us-east-1.amazonaws.com ). With the AWS CLI, this is specified using the --region parameter or the default Region in your AWS configuration file.
Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required
The identifier of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use for Amazon EBS encryption. If this parameter is not specified, your AWS managed CMK for EBS is used. If KmsKeyId is specified, the encrypted state must be true .
You can specify the CMK using any of the following:
AWS authenticates the CMK asynchronously. Therefore, if you specify an ID, alias, or ARN that is not valid, the action can appear to complete, but eventually fails.
When you copy an encrypted source snapshot using the Amazon EC2 Query API, you must supply a pre-signed URL. This parameter is optional for unencrypted snapshots. For more information, see Query Requests .
The PresignedUrl should use the snapshot source endpoint, the CopySnapshot action, and include the SourceRegion , SourceSnapshotId , and DestinationRegion parameters. The PresignedUrl must be signed using AWS Signature Version 4. Because EBS snapshots are stored in Amazon S3, the signing algorithm for this parameter uses the same logic that is described in Authenticating Requests by Using Query Parameters (AWS Signature Version 4) in the Amazon Simple Storage Service API Reference . An invalid or improperly signed PresignedUrl will cause the copy operation to fail asynchronously, and the snapshot will move to an error state.
Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required
[REQUIRED]
The ID of the Region that contains the snapshot to be copied.
dict
Response Syntax
{
'SnapshotId': 'string'
}
Response Structure
(dict) --
Contains the output of CopySnapshot.
SnapshotId (string) --
The ID of the new snapshot.
Adds or overwrites the specified tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide . For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
tag = snapshot.create_tags(
DryRun=True|False,
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
list(ec2.Tag)
A list of Tag resources
Deletes the specified snapshot.
When you make periodic snapshots of a volume, the snapshots are incremental, and only the blocks on the device that have changed since your last snapshot are saved in the new snapshot. When you delete a snapshot, only the data not needed for any other snapshot is removed. So regardless of which prior snapshots have been deleted, all active snapshots will have access to all the information needed to restore the volume.
You cannot delete a snapshot of the root device of an EBS volume used by a registered AMI. You must first de-register the AMI before you can delete the snapshot.
For more information, see Deleting an Amazon EBS Snapshot in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = snapshot.delete(
DryRun=True|False
)
Describes the specified attribute of the specified snapshot. You can specify only one attribute at a time.
For more information about EBS snapshots, see Amazon EBS Snapshots in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = snapshot.describe_attribute(
Attribute='productCodes'|'createVolumePermission',
DryRun=True|False
)
[REQUIRED]
The snapshot attribute you would like to view.
dict
Response Syntax
{
'CreateVolumePermissions': [
{
'Group': 'all',
'UserId': 'string'
},
],
'ProductCodes': [
{
'ProductCodeId': 'string',
'ProductCodeType': 'devpay'|'marketplace'
},
],
'SnapshotId': 'string'
}
Response Structure
(dict) --
Contains the output of DescribeSnapshotAttribute.
CreateVolumePermissions (list) --
The users and groups that have the permissions for creating volumes from the snapshot.
(dict) --
Describes the user or group to be added or removed from the list of create volume permissions for a volume.
Group (string) --
The group to be added or removed. The possible value is all .
UserId (string) --
The AWS account ID to be added or removed.
ProductCodes (list) --
The product codes.
(dict) --
Describes a product code.
ProductCodeId (string) --
The product code.
ProductCodeType (string) --
The type of product code.
SnapshotId (string) --
The ID of the EBS snapshot.
Returns a list of all the available sub-resources for this Resource.
Calls EC2.Client.describe_snapshots() to update the attributes of the Snapshot resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
snapshot.load()
Adds or removes permission settings for the specified snapshot. You may add or remove specified AWS account IDs from a snapshot's list of create volume permissions, but you cannot do both in a single operation. If you need to both add and remove account IDs for a snapshot, you must use multiple operations.
Encrypted snapshots and snapshots with AWS Marketplace product codes cannot be made public. Snapshots encrypted with your default CMK cannot be shared with other accounts.
For more information about modifying snapshot permissions, see Sharing Snapshots in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = snapshot.modify_attribute(
Attribute='productCodes'|'createVolumePermission',
CreateVolumePermission={
'Add': [
{
'Group': 'all',
'UserId': 'string'
},
],
'Remove': [
{
'Group': 'all',
'UserId': 'string'
},
]
},
GroupNames=[
'string',
],
OperationType='add'|'remove',
UserIds=[
'string',
],
DryRun=True|False
)
A JSON representation of the snapshot attribute modification.
Adds the specified AWS account ID or group to the list.
Describes the user or group to be added or removed from the list of create volume permissions for a volume.
The group to be added or removed. The possible value is all .
The AWS account ID to be added or removed.
Removes the specified AWS account ID or group from the list.
Describes the user or group to be added or removed from the list of create volume permissions for a volume.
The group to be added or removed. The possible value is all .
The AWS account ID to be added or removed.
The group to modify for the snapshot.
The account ID to modify for the snapshot.
None
Calls EC2.Client.describe_snapshots() to update the attributes of the Snapshot resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
snapshot.reload()
Resets permission settings for the specified snapshot.
For more information about modifying snapshot permissions, see Sharing Snapshots in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = snapshot.reset_attribute(
Attribute='productCodes'|'createVolumePermission',
DryRun=True|False
)
[REQUIRED]
The attribute to reset. Currently, only the attribute for permission to create volumes can be reset.
None
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.
Waits until this Snapshot is completed. This method calls EC2.Waiter.snapshot_completed.wait() which polls. EC2.Client.describe_snapshots() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
snapshot.wait_until_completed(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string',
OwnerIds=[
'string',
],
RestorableByUserIds=[
'string',
],
DryRun=True|False
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
Describes the snapshots owned by these owners.
The IDs of the AWS accounts that can create volumes from the snapshot.
None
A resource representing an Amazon Elastic Compute Cloud (EC2) Subnet:
import boto3
ec2 = boto3.resource('ec2')
subnet = ec2.Subnet('id')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available references:
These are the resource's available actions:
These are the resource's available collections:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The Subnet's id identifier. This must be set.
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.
(boolean) --
Indicates whether a network interface created in this subnet (including a network interface created by RunInstances ) receives an IPv6 address.
(string) --
The Availability Zone of the subnet.
(string) --
The AZ ID of the subnet.
(integer) --
The number of unused private IPv4 addresses in the subnet. The IPv4 addresses for any stopped instances are considered unavailable.
(string) --
The IPv4 CIDR block assigned to the subnet.
(boolean) --
Indicates whether this is the default subnet for the Availability Zone.
(list) --
Information about the IPv6 CIDR blocks associated with the subnet.
(dict) --
Describes an IPv6 CIDR block associated with a subnet.
AssociationId (string) --
The association ID for the CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
Ipv6CidrBlockState (dict) --
Information about the state of the CIDR block.
State (string) --
The state of a CIDR block.
StatusMessage (string) --
A message about the status of the CIDR block, if applicable.
(boolean) --
Indicates whether instances launched in this subnet receive a public IPv4 address.
(string) --
The ID of the AWS account that owns the subnet.
(string) --
The current state of the subnet.
(string) --
The Amazon Resource Name (ARN) of the subnet.
(string) --
The ID of the subnet.
(list) --
Any tags assigned to the subnet.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
(string) --
The ID of the VPC the subnet is in.
References
References are related resource instances that have a belongs-to relationship. For more information about references refer to the Resources Introduction Guide.
(Vpc) The related vpc if set, otherwise None.
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.
Launches the specified number of instances using an AMI for which you have permissions.
You can specify a number of options, or leave the default options. The following rules apply:
You can create a launch template , which is a resource that contains the parameters to launch an instance. When you launch an instance using RunInstances , you can specify the launch template instead of specifying the launch parameters.
To ensure faster instance launches, break up large requests into smaller batches. For example, create five separate launch requests for 100 instances each instead of one launch request for 500 instances.
An instance is ready for you to use when it's in the running state. You can check the state of your instance using DescribeInstances . You can tag instances and EBS volumes during launch, after launch, or both. For more information, see CreateTags and Tagging Your Amazon EC2 Resources .
Linux instances have access to the public key of the key pair at boot. You can use this key to provide secure access to the instance. Amazon EC2 public images use this feature to provide secure access without passwords. For more information, see Key Pairs in the Amazon Elastic Compute Cloud User Guide .
For troubleshooting, see What To Do If An Instance Immediately Terminates , and Troubleshooting Connecting to Your Instance in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
instance = subnet.create_instances(
BlockDeviceMappings=[
{
'DeviceName': 'string',
'VirtualName': 'string',
'Ebs': {
'DeleteOnTermination': True|False,
'Iops': 123,
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1',
'Encrypted': True|False,
'KmsKeyId': 'string'
},
'NoDevice': 'string'
},
],
ImageId='string',
InstanceType='t1.micro'|'t2.nano'|'t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'t2.xlarge'|'t2.2xlarge'|'t3.nano'|'t3.micro'|'t3.small'|'t3.medium'|'t3.large'|'t3.xlarge'|'t3.2xlarge'|'t3a.nano'|'t3a.micro'|'t3a.small'|'t3a.medium'|'t3a.large'|'t3a.xlarge'|'t3a.2xlarge'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m4.16xlarge'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'r5.metal'|'r5a.large'|'r5a.xlarge'|'r5a.2xlarge'|'r5a.4xlarge'|'r5a.8xlarge'|'r5a.12xlarge'|'r5a.16xlarge'|'r5a.24xlarge'|'r5d.large'|'r5d.xlarge'|'r5d.2xlarge'|'r5d.4xlarge'|'r5d.8xlarge'|'r5d.12xlarge'|'r5d.16xlarge'|'r5d.24xlarge'|'r5d.metal'|'r5ad.large'|'r5ad.xlarge'|'r5ad.2xlarge'|'r5ad.4xlarge'|'r5ad.8xlarge'|'r5ad.12xlarge'|'r5ad.16xlarge'|'r5ad.24xlarge'|'x1.16xlarge'|'x1.32xlarge'|'x1e.xlarge'|'x1e.2xlarge'|'x1e.4xlarge'|'x1e.8xlarge'|'x1e.16xlarge'|'x1e.32xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'i3.large'|'i3.xlarge'|'i3.2xlarge'|'i3.4xlarge'|'i3.8xlarge'|'i3.16xlarge'|'i3.metal'|'i3en.large'|'i3en.xlarge'|'i3en.2xlarge'|'i3en.3xlarge'|'i3en.6xlarge'|'i3en.12xlarge'|'i3en.24xlarge'|'hi1.4xlarge'|'hs1.8xlarge'|'c1.medium'|'c1.xlarge'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'c5.metal'|'c5d.large'|'c5d.xlarge'|'c5d.2xlarge'|'c5d.4xlarge'|'c5d.9xlarge'|'c5d.18xlarge'|'c5n.large'|'c5n.xlarge'|'c5n.2xlarge'|'c5n.4xlarge'|'c5n.9xlarge'|'c5n.18xlarge'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'g2.8xlarge'|'g3.4xlarge'|'g3.8xlarge'|'g3.16xlarge'|'g3s.xlarge'|'cg1.4xlarge'|'p2.xlarge'|'p2.8xlarge'|'p2.16xlarge'|'p3.2xlarge'|'p3.8xlarge'|'p3.16xlarge'|'p3dn.24xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'|'f1.2xlarge'|'f1.4xlarge'|'f1.16xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge'|'m5.metal'|'m5a.large'|'m5a.xlarge'|'m5a.2xlarge'|'m5a.4xlarge'|'m5a.8xlarge'|'m5a.12xlarge'|'m5a.16xlarge'|'m5a.24xlarge'|'m5d.large'|'m5d.xlarge'|'m5d.2xlarge'|'m5d.4xlarge'|'m5d.8xlarge'|'m5d.12xlarge'|'m5d.16xlarge'|'m5d.24xlarge'|'m5d.metal'|'m5ad.large'|'m5ad.xlarge'|'m5ad.2xlarge'|'m5ad.4xlarge'|'m5ad.8xlarge'|'m5ad.12xlarge'|'m5ad.16xlarge'|'m5ad.24xlarge'|'h1.2xlarge'|'h1.4xlarge'|'h1.8xlarge'|'h1.16xlarge'|'z1d.large'|'z1d.xlarge'|'z1d.2xlarge'|'z1d.3xlarge'|'z1d.6xlarge'|'z1d.12xlarge'|'z1d.metal'|'u-6tb1.metal'|'u-9tb1.metal'|'u-12tb1.metal'|'a1.medium'|'a1.large'|'a1.xlarge'|'a1.2xlarge'|'a1.4xlarge',
Ipv6AddressCount=123,
Ipv6Addresses=[
{
'Ipv6Address': 'string'
},
],
KernelId='string',
KeyName='string',
MaxCount=123,
MinCount=123,
Monitoring={
'Enabled': True|False
},
Placement={
'AvailabilityZone': 'string',
'Affinity': 'string',
'GroupName': 'string',
'PartitionNumber': 123,
'HostId': 'string',
'Tenancy': 'default'|'dedicated'|'host',
'SpreadDomain': 'string'
},
RamdiskId='string',
SecurityGroupIds=[
'string',
],
SecurityGroups=[
'string',
],
UserData='string',
AdditionalInfo='string',
ClientToken='string',
DisableApiTermination=True|False,
DryRun=True|False,
EbsOptimized=True|False,
IamInstanceProfile={
'Arn': 'string',
'Name': 'string'
},
InstanceInitiatedShutdownBehavior='stop'|'terminate',
NetworkInterfaces=[
{
'AssociatePublicIpAddress': True|False,
'DeleteOnTermination': True|False,
'Description': 'string',
'DeviceIndex': 123,
'Groups': [
'string',
],
'Ipv6AddressCount': 123,
'Ipv6Addresses': [
{
'Ipv6Address': 'string'
},
],
'NetworkInterfaceId': 'string',
'PrivateIpAddress': 'string',
'PrivateIpAddresses': [
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
'SecondaryPrivateIpAddressCount': 123,
'SubnetId': 'string',
'InterfaceType': 'string'
},
],
PrivateIpAddress='string',
ElasticGpuSpecification=[
{
'Type': 'string'
},
],
ElasticInferenceAccelerators=[
{
'Type': 'string'
},
],
TagSpecifications=[
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
LaunchTemplate={
'LaunchTemplateId': 'string',
'LaunchTemplateName': 'string',
'Version': 'string'
},
InstanceMarketOptions={
'MarketType': 'spot',
'SpotOptions': {
'MaxPrice': 'string',
'SpotInstanceType': 'one-time'|'persistent',
'BlockDurationMinutes': 123,
'ValidUntil': datetime(2015, 1, 1),
'InstanceInterruptionBehavior': 'hibernate'|'stop'|'terminate'
}
},
CreditSpecification={
'CpuCredits': 'string'
},
CpuOptions={
'CoreCount': 123,
'ThreadsPerCore': 123
},
CapacityReservationSpecification={
'CapacityReservationPreference': 'open'|'none',
'CapacityReservationTarget': {
'CapacityReservationId': 'string'
}
},
HibernationOptions={
'Configured': True|False
},
LicenseSpecifications=[
{
'LicenseConfigurationArn': 'string'
},
]
)
The block device mapping entries.
Describes a block device mapping.
The device name (for example, /dev/sdh or xvdh ).
The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
Parameters used to automatically set up EBS volumes when the instance is launched.
Indicates whether the EBS volume is deleted on instance termination.
The number of I/O operations per second (IOPS) that the volume supports. For io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
The ID of the snapshot.
The size of the volume, in GiB.
Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
Constraints: 1-16384 for General Purpose SSD (gp2 ), 4-16384 for Provisioned IOPS SSD (io1 ), 500-16384 for Throughput Optimized HDD (st1 ), 500-16384 for Cold HDD (sc1 ), and 1-1024 for Magnetic (standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
The volume type. If you set the type to io1 , you must also set the Iops property.
Default: standard
Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
In no case can you remove encryption from an encrypted volume.
Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .
Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is encrypted.
This parameter is only supported on BlockDeviceMapping objects called by RunInstances , RequestSpotFleet , and RequestSpotInstances .
Suppresses the specified device included in the block device mapping of the AMI.
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide .
Default: m1.small
[EC2-VPC] The number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.
You cannot specify this option and the network interfaces option in the same request.
[EC2-VPC] The IPv6 addresses from the range of the subnet to associate with the primary network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.
You cannot specify this option and the network interfaces option in the same request.
Describes an IPv6 address.
The IPv6 address.
The ID of the kernel.
Warning
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB in the Amazon Elastic Compute Cloud User Guide .
The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair .
Warning
If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.
[REQUIRED]
The maximum number of instances to launch. If you specify more instances than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches the largest possible number of instances above MinCount .
Constraints: Between 1 and the maximum number you're allowed for the specified instance type. For more information about the default limits, and how to request an increase, see How many instances can I run in Amazon EC2 in the Amazon EC2 FAQ.
[REQUIRED]
The minimum number of instances to launch. If you specify a minimum that is more instances than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches no instances.
Constraints: Between 1 and the maximum number you're allowed for the specified instance type. For more information about the default limits, and how to request an increase, see How many instances can I run in Amazon EC2 in the Amazon EC2 General FAQ.
Specifies whether detailed monitoring is enabled for the instance.
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
The placement for the instance.
The Availability Zone of the instance.
If not specified, an Availability Zone will be automatically chosen for you based on the load balancing criteria for the Region.
The affinity setting for the instance on the Dedicated Host. This parameter is not supported for the ImportInstance command.
The name of the placement group the instance is in.
The number of the partition the instance is in. Valid only if the placement group strategy is set to partition .
The ID of the Dedicated Host on which the instance resides. This parameter is not supported for the ImportInstance command.
The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for the ImportInstance command.
Reserved for future use.
The ID of the RAM disk to select. Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, go to the AWS Resource Center and search for the kernel ID.
Warning
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB in the Amazon Elastic Compute Cloud User Guide .
The IDs of the security groups. You can create a security group using CreateSecurityGroup .
If you specify a network interface, you must specify any security groups as part of the network interface.
[EC2-Classic, default VPC] The names of the security groups. For a nondefault VPC, you must use security group IDs instead.
If you specify a network interface, you must specify any security groups as part of the network interface.
Default: Amazon EC2 uses the default security group.
The user data to make available to the instance. For more information, see Running Commands on Your Linux Instance at Launch (Linux) and Adding User Data (Windows). If you are using a command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text. User data is limited to 16 KB.
This value will be base64 encoded automatically. Do not base64 encode this value prior to performing the operation.
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency .
Constraints: Maximum 64 ASCII characters
If you set this parameter to true , you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. To change this attribute after launch, use ModifyInstanceAttribute . Alternatively, if you set InstanceInitiatedShutdownBehavior to terminate , you can terminate the instance by running the shutdown command from the instance.
Default: false
Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.
Default: false
The IAM instance profile.
The Amazon Resource Name (ARN) of the instance profile.
The name of the instance profile.
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
Default: stop
The network interfaces to associate with the instance. If you specify a network interface, you must specify any security groups and subnets as part of the network interface.
Describes a network interface.
Indicates whether to assign a public IPv4 address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is true .
If set to true , the interface is deleted when the instance is terminated. You can specify true only if creating a new network interface when launching an instance.
The description of the network interface. Applies only if creating a network interface when launching an instance.
The position of the network interface in the attachment order. A primary network interface has a device index of 0.
If you specify a network interface when launching an instance, you must specify the device index.
The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.
A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.
One or more IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.
Describes an IPv6 address.
The IPv6 address.
The ID of the network interface.
The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance. You cannot specify this option if you're launching more than one instance in a RunInstances request.
One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you're launching more than one instance in a RunInstances request.
Describes a secondary private IPv4 address for a network interface.
Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.
The private IPv4 addresses.
The number of secondary private IPv4 addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you're launching more than one instance in a RunInstances request.
The ID of the subnet associated with the network string. Applies only if creating a network interface when launching an instance.
The type of network interface. To create an Elastic Fabric Adapter (EFA), specify efa . For more information, see Elastic Fabric Adapter in the Amazon Elastic Compute Cloud User Guide .
If you are not creating an EFA, specify interface or omit this parameter.
Valid values: interface | efa
[EC2-VPC] The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.
Only one private IP address can be designated as primary. You can't specify this option if you've specified the option to designate a private IP address as the primary IP address in a network interface specification. You cannot specify this option if you're launching more than one instance in the request.
You cannot specify this option and the network interfaces option in the same request.
An elastic GPU to associate with the instance. An Elastic GPU is a GPU resource that you can attach to your Windows instance to accelerate the graphics performance of your applications. For more information, see Amazon EC2 Elastic GPUs in the Amazon Elastic Compute Cloud User Guide .
A specification for an Elastic Graphics accelerator.
The type of Elastic Graphics accelerator.
An elastic inference accelerator to associate with the instance. Elastic inference accelerators are a resource you can attach to your Amazon EC2 instances to accelerate your Deep Learning (DL) inference workloads.
Describes an elastic inference accelerator.
The type of elastic inference accelerator. The possible values are eia1.small , eia1.medium , and eia1.large .
The tags to apply to the resources during launch. You can only tag instances and volumes on launch. The specified tags are applied to all instances or volumes that are created during launch. To tag a resource after it has been created, see CreateTags .
The tags to apply to a resource when the resource is being created.
The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
The launch template to use to launch the instances. Any parameters that you specify in RunInstances override the same parameters in the launch template. You can specify either the name or ID of a launch template, but not both.
The ID of the launch template.
The name of the launch template.
The version number of the launch template.
Default: The default version for the launch template.
The market (purchasing) option for the instances.
For RunInstances , persistent Spot Instance requests are only supported when InstanceInterruptionBehavior is set to either hibernate or stop .
The market type.
The options for Spot Instances.
The maximum hourly price you're willing to pay for the Spot Instances. The default is the On-Demand price.
The Spot Instance request type. For RunInstances , persistent Spot Instance requests are only supported when InstanceInterruptionBehavior is set to either hibernate or stop .
The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).
The end date of the request. For a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached. The default end date is 7 days from the current date.
The behavior when a Spot Instance is interrupted. The default is terminate .
The credit option for CPU usage of the T2 or T3 instance. Valid values are standard and unlimited . To change this attribute after launch, use ModifyInstanceCreditSpecification . For more information, see Burstable Performance Instances in the Amazon Elastic Compute Cloud User Guide .
Default: standard (T2 instances) or unlimited (T3 instances)
The credit option for CPU usage of a T2 or T3 instance. Valid values are standard and unlimited .
The CPU options for the instance. For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide .
The number of CPU cores for the instance.
The number of threads per CPU core. To disable Intel Hyper-Threading Technology for the instance, specify a value of 1 . Otherwise, specify the default value of 2 .
Information about the Capacity Reservation targeting option. If you do not specify this parameter, the instance's Capacity Reservation preference defaults to open , which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
Information about the target Capacity Reservation.
The ID of the Capacity Reservation.
Indicates whether an instance is enabled for hibernation. For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
If you set this parameter to true , your instance is enabled for hibernation.
Default: false
The license configurations.
Describes a license configuration.
The Amazon Resource Name (ARN) of the license configuration.
list(ec2.Instance)
A list of Instance resources
Creates a network interface in the specified subnet.
For more information about network interfaces, see Elastic Network Interfaces in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
network_interface = subnet.create_network_interface(
Description='string',
DryRun=True|False,
Groups=[
'string',
],
Ipv6AddressCount=123,
Ipv6Addresses=[
{
'Ipv6Address': 'string'
},
],
PrivateIpAddress='string',
PrivateIpAddresses=[
{
'Primary': True|False,
'PrivateIpAddress': 'string'
},
],
SecondaryPrivateIpAddressCount=123,
InterfaceType='efa',
)
The IDs of one or more security groups.
One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. You can't use this option if you're specifying a number of IPv6 addresses.
Describes an IPv6 address.
The IPv6 address.
One or more private IPv4 addresses.
Describes a secondary private IPv4 address for a network interface.
Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.
The private IPv4 addresses.
The number of secondary private IPv4 addresses to assign to a network interface. When you specify a number of secondary IPv4 addresses, Amazon EC2 selects these IP addresses within the subnet's IPv4 CIDR range. You can't specify this option and specify more than one private IP address using privateIpAddresses .
The number of IP addresses you can assign to a network interface varies by instance type. For more information, see IP Addresses Per ENI Per Instance Type in the Amazon Virtual Private Cloud User Guide .
ec2.NetworkInterface
NetworkInterface resource
Adds or overwrites the specified tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide . For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
tag = subnet.create_tags(
DryRun=True|False,
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
list(ec2.Tag)
A list of Tag resources
Deletes the specified subnet. You must terminate all running instances in the subnet before you can delete the subnet.
See also: AWS API Documentation
Request Syntax
response = subnet.delete(
DryRun=True|False
)
Returns a list of all the available sub-resources for this Resource.
Calls EC2.Client.describe_subnets() to update the attributes of the Subnet resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
subnet.load()
Calls EC2.Client.describe_subnets() to update the attributes of the Subnet resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
subnet.reload()
Collections
Collections provide an interface to iterate over and manipulate groups of resources. For more information about collections refer to the Resources Introduction Guide.
A collection of Instance resources
Creates an iterable of all Instance resources in the collection.
See also: AWS API Documentation
Request Syntax
instance_iterator = subnet.instances.all()
Adds or overwrites the specified tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide . For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = subnet.instances.create_tags(
DryRun=True|False,
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
None
Creates an iterable of all Instance resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
instance_iterator = subnet.instances.filter(
InstanceIds=[
'string',
],
DryRun=True|False,
MaxResults=123,
NextToken='string'
)
The instance IDs.
Default: Describes all your instances.
list(ec2.Instance)
A list of Instance resources
Creates an iterable up to a specified amount of Instance resources in the collection.
See also: AWS API Documentation
Request Syntax
instance_iterator = subnet.instances.limit(
count=123
)
Enables detailed monitoring for a running instance. Otherwise, basic monitoring is enabled. For more information, see Monitoring Your Instances and Volumes in the Amazon Elastic Compute Cloud User Guide .
To disable detailed monitoring, see .
See also: AWS API Documentation
Request Syntax
response = subnet.instances.monitor(
DryRun=True|False
)
{
'InstanceMonitorings': [
{
'InstanceId': 'string',
'Monitoring': {
'State': 'disabled'|'disabling'|'enabled'|'pending'
}
},
]
}
Response Structure
The monitoring information.
Describes the monitoring of an instance.
The ID of the instance.
The monitoring for the instance.
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
Creates an iterable of all Instance resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
instance_iterator = subnet.instances.page_size(
count=123
)
Requests a reboot of the specified instances. This operation is asynchronous; it only queues a request to reboot the specified instances. The operation succeeds if the instances are valid and belong to you. Requests to reboot terminated instances are ignored.
If an instance does not cleanly shut down within four minutes, Amazon EC2 performs a hard reboot.
For more information about troubleshooting, see Getting Console Output and Rebooting Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = subnet.instances.reboot(
DryRun=True|False
)
Starts an Amazon EBS-backed instance that you've previously stopped.
Instances that use Amazon EBS volumes as their root devices can be quickly stopped and started. When an instance is stopped, the compute resources are released and you are not billed for instance usage. However, your root partition Amazon EBS volume remains and continues to persist your data, and you are charged for Amazon EBS volume usage. You can restart your instance at any time. Every time you start your Windows instance, Amazon EC2 charges you for a full instance hour. If you stop and restart your Windows instance, a new instance hour begins and Amazon EC2 charges you for another full instance hour even if you are still within the same 60-minute period when it was stopped. Every time you start your Linux instance, Amazon EC2 charges a one-minute minimum for instance usage, and thereafter charges per second for instance usage.
Before stopping an instance, make sure it is in a state from which it can be restarted. Stopping an instance does not preserve data stored in RAM.
Performing this operation on an instance that uses an instance store as its root device returns an error.
For more information, see Stopping Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = subnet.instances.start(
AdditionalInfo='string',
DryRun=True|False
)
dict
Response Syntax
{
'StartingInstances': [
{
'CurrentState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceId': 'string',
'PreviousState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
}
},
]
}
Response Structure
(dict) --
StartingInstances (list) --
Information about the started instances.
(dict) --
Describes an instance state change.
CurrentState (dict) --
The current state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
InstanceId (string) --
The ID of the instance.
PreviousState (dict) --
The previous state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
Stops an Amazon EBS-backed instance.
You can use the Stop action to hibernate an instance if the instance is enabled for hibernation and it meets the hibernation prerequisites . For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
We don't charge usage for a stopped instance, or data transfer fees; however, your root partition Amazon EBS volume remains and continues to persist your data, and you are charged for Amazon EBS volume usage. Every time you start your Windows instance, Amazon EC2 charges you for a full instance hour. If you stop and restart your Windows instance, a new instance hour begins and Amazon EC2 charges you for another full instance hour even if you are still within the same 60-minute period when it was stopped. Every time you start your Linux instance, Amazon EC2 charges a one-minute minimum for instance usage, and thereafter charges per second for instance usage.
You can't start, stop, or hibernate Spot Instances, and you can't stop or hibernate instance store-backed instances. For information about using hibernation for Spot Instances, see Hibernating Interrupted Spot Instances in the Amazon Elastic Compute Cloud User Guide .
When you stop or hibernate an instance, we shut it down. You can restart your instance at any time. Before stopping or hibernating an instance, make sure it is in a state from which it can be restarted. Stopping an instance does not preserve data stored in RAM, but hibernating an instance does preserve data stored in RAM. If an instance cannot hibernate successfully, a normal shutdown occurs.
Stopping and hibernating an instance is different to rebooting or terminating it. For example, when you stop or hibernate an instance, the root device and any other devices attached to the instance persist. When you terminate an instance, the root device and any other devices attached during the instance launch are automatically deleted. For more information about the differences between rebooting, stopping, hibernating, and terminating instances, see Instance Lifecycle in the Amazon Elastic Compute Cloud User Guide .
When you stop an instance, we attempt to shut it down forcibly after a short while. If your instance appears stuck in the stopping state after a period of time, there may be an issue with the underlying host computer. For more information, see Troubleshooting Stopping Your Instance in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = subnet.instances.stop(
Hibernate=True|False,
DryRun=True|False,
Force=True|False
)
Hibernates the instance if the instance was enabled for hibernation at launch. If the instance cannot hibernate successfully, a normal shutdown occurs. For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
Default: false
Forces the instances to stop. The instances do not have an opportunity to flush file system caches or file system metadata. If you use this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances.
Default: false
dict
Response Syntax
{
'StoppingInstances': [
{
'CurrentState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceId': 'string',
'PreviousState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
}
},
]
}
Response Structure
(dict) --
StoppingInstances (list) --
Information about the stopped instances.
(dict) --
Describes an instance state change.
CurrentState (dict) --
The current state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
InstanceId (string) --
The ID of the instance.
PreviousState (dict) --
The previous state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
Shuts down the specified instances. This operation is idempotent; if you terminate an instance more than once, each call succeeds.
If you specify multiple instances and the request fails (for example, because of a single incorrect instance ID), none of the instances are terminated.
Terminated instances remain visible after termination (for approximately one hour).
By default, Amazon EC2 deletes all EBS volumes that were attached when the instance launched. Volumes attached after instance launch continue running.
You can stop, start, and terminate EBS-backed instances. You can only terminate instance store-backed instances. What happens to an instance differs if you stop it or terminate it. For example, when you stop an instance, the root device and any other devices attached to the instance persist. When you terminate an instance, any attached EBS volumes with the DeleteOnTermination block device mapping parameter set to true are automatically deleted. For more information about the differences between stopping and terminating instances, see Instance Lifecycle in the Amazon Elastic Compute Cloud User Guide .
For more information about troubleshooting, see Troubleshooting Terminating Your Instance in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = subnet.instances.terminate(
DryRun=True|False
)
{
'TerminatingInstances': [
{
'CurrentState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceId': 'string',
'PreviousState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
}
},
]
}
Response Structure
Information about the terminated instances.
Describes an instance state change.
The current state of the instance.
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
The current state of the instance.
The ID of the instance.
The previous state of the instance.
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
The current state of the instance.
Disables detailed monitoring for a running instance. For more information, see Monitoring Your Instances and Volumes in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = subnet.instances.unmonitor(
DryRun=True|False
)
{
'InstanceMonitorings': [
{
'InstanceId': 'string',
'Monitoring': {
'State': 'disabled'|'disabling'|'enabled'|'pending'
}
},
]
}
Response Structure
The monitoring information.
Describes the monitoring of an instance.
The ID of the instance.
The monitoring for the instance.
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
A collection of NetworkInterface resources
Creates an iterable of all NetworkInterface resources in the collection.
See also: AWS API Documentation
Request Syntax
network_interface_iterator = subnet.network_interfaces.all()
Creates an iterable of all NetworkInterface resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
network_interface_iterator = subnet.network_interfaces.filter(
DryRun=True|False,
NetworkInterfaceIds=[
'string',
],
NextToken='string',
MaxResults=123
)
One or more network interface IDs.
Default: Describes all your network interfaces.
list(ec2.NetworkInterface)
A list of NetworkInterface resources
Creates an iterable up to a specified amount of NetworkInterface resources in the collection.
See also: AWS API Documentation
Request Syntax
network_interface_iterator = subnet.network_interfaces.limit(
count=123
)
Creates an iterable of all NetworkInterface resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
network_interface_iterator = subnet.network_interfaces.page_size(
count=123
)
A resource representing an Amazon Elastic Compute Cloud (EC2) Tag:
import boto3
ec2 = boto3.resource('ec2')
tag = ec2.Tag('resource_id','key','value')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The Tag's resource_id identifier. This must be set.
(string) The Tag's key identifier. This must be set.
(string) The Tag's value identifier. This must be set.
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.
(string) --
The resource type.
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.
Deletes the specified set of tags from the specified set of resources.
To list the current tags, use DescribeTags . For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = tag.delete(
DryRun=True|False,
)
Returns a list of all the available sub-resources for this Resource.
Calls EC2.Client.describe_tags() to update the attributes of the Tag resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
tag.load()
Calls EC2.Client.describe_tags() to update the attributes of the Tag resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
tag.reload()
A resource representing an Amazon Elastic Compute Cloud (EC2) Volume:
import boto3
ec2 = boto3.resource('ec2')
volume = ec2.Volume('id')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available actions:
These are the resource's available collections:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The Volume's id identifier. This must be set.
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.
(list) --
Information about the volume attachments.
(dict) --
Describes volume attachment details.
AttachTime (datetime) --
The time stamp when the attachment initiated.
Device (string) --
The device name.
InstanceId (string) --
The ID of the instance.
State (string) --
The attachment state of the volume.
VolumeId (string) --
The ID of the volume.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
(string) --
The Availability Zone for the volume.
(datetime) --
The time stamp when volume creation was initiated.
(boolean) --
Indicates whether the volume is encrypted.
(integer) --
The number of I/O operations per second (IOPS) that the volume supports. For Provisioned IOPS SSD volumes, this represents the number of IOPS that are provisioned for the volume. For General Purpose SSD volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .
Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS for io1 volumes, in most Regions. The maximum IOPS for io1 of 64,000 is guaranteed only on Nitro-based instances . Other instance families guarantee performance up to 32,000 IOPS.
Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.
(string) --
The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the volume encryption key for the volume.
(integer) --
The size of the volume, in GiBs.
(string) --
The snapshot from which the volume was created, if applicable.
(string) --
The volume state.
(list) --
Any tags assigned to the volume.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
(string) --
The ID of the volume.
(string) --
The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.
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.
Attaches an EBS volume to a running or stopped instance and exposes it to the instance with the specified device name.
Encrypted EBS volumes must be attached to instances that support Amazon EBS encryption. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
After you attach an EBS volume, you must make it available. For more information, see Making an EBS Volume Available For Use .
If a volume has an AWS Marketplace product code:
For more information, see Attaching Amazon EBS Volumes in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = volume.attach_to_instance(
Device='string',
InstanceId='string',
DryRun=True|False
)
[REQUIRED]
The device name (for example, /dev/sdh or xvdh ).
[REQUIRED]
The ID of the instance.
dict
Response Syntax
{
'AttachTime': datetime(2015, 1, 1),
'Device': 'string',
'InstanceId': 'string',
'State': 'attaching'|'attached'|'detaching'|'detached'|'busy',
'VolumeId': 'string',
'DeleteOnTermination': True|False
}
Response Structure
(dict) --
Describes volume attachment details.
AttachTime (datetime) --
The time stamp when the attachment initiated.
Device (string) --
The device name.
InstanceId (string) --
The ID of the instance.
State (string) --
The attachment state of the volume.
VolumeId (string) --
The ID of the volume.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
Creates a snapshot of an EBS volume and stores it in Amazon S3. You can use snapshots for backups, to make copies of EBS volumes, and to save data before shutting down an instance.
When a snapshot is created, any AWS Marketplace product codes that are associated with the source volume are propagated to the snapshot.
You can take a snapshot of an attached volume that is in use. However, snapshots only capture data that has been written to your EBS volume at the time the snapshot command is issued; this may exclude any data that has been cached by any applications or the operating system. If you can pause any file systems on the volume long enough to take a snapshot, your snapshot should be complete. However, if you cannot pause all file writes to the volume, you should unmount the volume from within the instance, issue the snapshot command, and then remount the volume to ensure a consistent and complete snapshot. You may remount and use your volume while the snapshot status is pending .
To create a snapshot for EBS volumes that serve as root devices, you should stop the instance before taking the snapshot.
Snapshots that are taken from encrypted volumes are automatically encrypted. Volumes that are created from encrypted snapshots are also automatically encrypted. Your encrypted volumes and any associated snapshots always remain protected.
You can tag your snapshots during creation. For more information, see Tagging Your Amazon EC2 Resources in the Amazon Elastic Compute Cloud User Guide .
For more information, see Amazon Elastic Block Store and Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
snapshot = volume.create_snapshot(
Description='string',
TagSpecifications=[
{
'ResourceType': 'client-vpn-endpoint'|'customer-gateway'|'dedicated-host'|'dhcp-options'|'elastic-ip'|'fleet'|'fpga-image'|'host-reservation'|'image'|'instance'|'internet-gateway'|'launch-template'|'natgateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'security-group'|'snapshot'|'spot-instances-request'|'subnet'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-route-table'|'volume'|'vpc'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
DryRun=True|False
)
The tags to apply to the snapshot during creation.
The tags to apply to a resource when the resource is being created.
The type of resource to tag. Currently, the resource types that support tagging on creation are fleet , dedicated-host , instance , snapshot , and volume . To tag a resource after it has been created, see CreateTags .
The tags to apply to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
ec2.Snapshot
Snapshot resource
Adds or overwrites the specified tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide . For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
tag = volume.create_tags(
DryRun=True|False,
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
list(ec2.Tag)
A list of Tag resources
Deletes the specified EBS volume. The volume must be in the available state (not attached to an instance).
The volume can remain in the deleting state for several minutes.
For more information, see Deleting an Amazon EBS Volume in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = volume.delete(
DryRun=True|False
)
Describes the specified attribute of the specified volume. You can specify only one attribute at a time.
For more information about EBS volumes, see Amazon EBS Volumes in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = volume.describe_attribute(
Attribute='autoEnableIO'|'productCodes',
DryRun=True|False
)
[REQUIRED]
The attribute of the volume. This parameter is required.
dict
Response Syntax
{
'AutoEnableIO': {
'Value': True|False
},
'ProductCodes': [
{
'ProductCodeId': 'string',
'ProductCodeType': 'devpay'|'marketplace'
},
],
'VolumeId': 'string'
}
Response Structure
(dict) --
Contains the output of DescribeVolumeAttribute.
AutoEnableIO (dict) --
The state of autoEnableIO attribute.
Value (boolean) --
The attribute value. The valid values are true or false .
ProductCodes (list) --
A list of product codes.
(dict) --
Describes a product code.
ProductCodeId (string) --
The product code.
ProductCodeType (string) --
The type of product code.
VolumeId (string) --
The ID of the volume.
Describes the status of the specified volumes. Volume status provides the result of the checks performed on your volumes to determine events that can impair the performance of your volumes. The performance of a volume can be affected if an issue occurs on the volume's underlying host. If the volume's underlying host experiences a power outage or system issue, after the system is restored, there could be data inconsistencies on the volume. Volume events notify you if this occurs. Volume actions notify you if any action needs to be taken in response to the event.
The DescribeVolumeStatus operation provides the following information about the specified volumes:
Status : Reflects the current status of the volume. The possible values are ok , impaired , warning , or insufficient-data . If all checks pass, the overall status of the volume is ok . If the check fails, the overall status is impaired . If the status is insufficient-data , then the checks may still be taking place on your volume at the time. We recommend that you retry the request. For more information about volume status, see Monitoring the Status of Your Volumes in the Amazon Elastic Compute Cloud User Guide .
Events : Reflect the cause of a volume status and may require you to take action. For example, if your volume returns an impaired status, then the volume event might be potential-data-inconsistency . This means that your volume has been affected by an issue with the underlying host, has all I/O operations disabled, and may have inconsistent data.
Actions : Reflect the actions you may have to take in response to an event. For example, if the status of the volume is impaired and the volume event shows potential-data-inconsistency , then the action shows enable-volume-io . This means that you may want to enable the I/O operations for the volume by calling the EnableVolumeIO action and then check the volume for data consistency.
Volume status is based on the volume status checks, and does not reflect the volume state. Therefore, volume status does not indicate volumes in the error state (for example, when a volume is incapable of accepting I/O.)
See also: AWS API Documentation
Request Syntax
response = volume.describe_status(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string',
DryRun=True|False
)
The filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
dict
Response Syntax
{
'NextToken': 'string',
'VolumeStatuses': [
{
'Actions': [
{
'Code': 'string',
'Description': 'string',
'EventId': 'string',
'EventType': 'string'
},
],
'AvailabilityZone': 'string',
'Events': [
{
'Description': 'string',
'EventId': 'string',
'EventType': 'string',
'NotAfter': datetime(2015, 1, 1),
'NotBefore': datetime(2015, 1, 1)
},
],
'VolumeId': 'string',
'VolumeStatus': {
'Details': [
{
'Name': 'io-enabled'|'io-performance',
'Status': 'string'
},
],
'Status': 'ok'|'impaired'|'insufficient-data'
}
},
]
}
Response Structure
(dict) --
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
VolumeStatuses (list) --
Information about the status of the volumes.
(dict) --
Describes the volume status.
Actions (list) --
The details of the operation.
(dict) --
Describes a volume status operation code.
Code (string) --
The code identifying the operation, for example, enable-volume-io .
Description (string) --
A description of the operation.
EventId (string) --
The ID of the event associated with this operation.
EventType (string) --
The event type associated with this operation.
AvailabilityZone (string) --
The Availability Zone of the volume.
Events (list) --
A list of events associated with the volume.
(dict) --
Describes a volume status event.
Description (string) --
A description of the event.
EventId (string) --
The ID of this event.
EventType (string) --
The type of this event.
NotAfter (datetime) --
The latest end time of the event.
NotBefore (datetime) --
The earliest start time of the event.
VolumeId (string) --
The volume ID.
VolumeStatus (dict) --
The volume status.
Details (list) --
The details of the volume status.
(dict) --
Describes a volume status.
Name (string) --
The name of the volume status.
Status (string) --
The intended status of the volume status.
Status (string) --
The status of the volume.
Detaches an EBS volume from an instance. Make sure to unmount any file systems on the device within your operating system before detaching the volume. Failure to do so can result in the volume becoming stuck in the busy state while detaching. If this happens, detachment can be delayed indefinitely until you unmount the volume, force detachment, reboot the instance, or all three. If an EBS volume is the root device of an instance, it can't be detached while the instance is running. To detach the root volume, stop the instance first.
When a volume with an AWS Marketplace product code is detached from an instance, the product code is no longer associated with the instance.
For more information, see Detaching an Amazon EBS Volume in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = volume.detach_from_instance(
Device='string',
Force=True|False,
InstanceId='string',
DryRun=True|False
)
dict
Response Syntax
{
'AttachTime': datetime(2015, 1, 1),
'Device': 'string',
'InstanceId': 'string',
'State': 'attaching'|'attached'|'detaching'|'detached'|'busy',
'VolumeId': 'string',
'DeleteOnTermination': True|False
}
Response Structure
(dict) --
Describes volume attachment details.
AttachTime (datetime) --
The time stamp when the attachment initiated.
Device (string) --
The device name.
InstanceId (string) --
The ID of the instance.
State (string) --
The attachment state of the volume.
VolumeId (string) --
The ID of the volume.
DeleteOnTermination (boolean) --
Indicates whether the EBS volume is deleted on instance termination.
Enables I/O operations for a volume that had I/O operations disabled because the data on the volume was potentially inconsistent.
See also: AWS API Documentation
Request Syntax
response = volume.enable_io(
DryRun=True|False,
)
Returns a list of all the available sub-resources for this Resource.
Calls EC2.Client.describe_volumes() to update the attributes of the Volume resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
volume.load()
Modifies a volume attribute.
By default, all I/O operations for the volume are suspended when the data on the volume is determined to be potentially inconsistent, to prevent undetectable, latent data corruption. The I/O access to the volume can be resumed by first enabling I/O access and then checking the data consistency on your volume.
You can change the default behavior to resume I/O operations. We recommend that you change this only for boot volumes or for volumes that are stateless or disposable.
See also: AWS API Documentation
Request Syntax
response = volume.modify_attribute(
AutoEnableIO={
'Value': True|False
},
DryRun=True|False
)
Indicates whether the volume should be auto-enabled for I/O operations.
The attribute value. The valid values are true or false .
None
Calls EC2.Client.describe_volumes() to update the attributes of the Volume resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
volume.reload()
Collections
Collections provide an interface to iterate over and manipulate groups of resources. For more information about collections refer to the Resources Introduction Guide.
A collection of Snapshot resources
Creates an iterable of all Snapshot resources in the collection.
See also: AWS API Documentation
Request Syntax
snapshot_iterator = volume.snapshots.all()
Creates an iterable of all Snapshot resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
snapshot_iterator = volume.snapshots.filter(
MaxResults=123,
NextToken='string',
OwnerIds=[
'string',
],
RestorableByUserIds=[
'string',
],
SnapshotIds=[
'string',
],
DryRun=True|False
)
Describes the snapshots owned by these owners.
The IDs of the AWS accounts that can create volumes from the snapshot.
The snapshot IDs.
Default: Describes the snapshots for which you have create volume permissions.
list(ec2.Snapshot)
A list of Snapshot resources
Creates an iterable up to a specified amount of Snapshot resources in the collection.
See also: AWS API Documentation
Request Syntax
snapshot_iterator = volume.snapshots.limit(
count=123
)
Creates an iterable of all Snapshot resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
snapshot_iterator = volume.snapshots.page_size(
count=123
)
A resource representing an Amazon Elastic Compute Cloud (EC2) Vpc:
import boto3
ec2 = boto3.resource('ec2')
vpc = ec2.Vpc('id')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available references:
These are the resource's available actions:
These are the resource's available collections:
These are the resource's available waiters:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The Vpc's id identifier. This must be set.
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.
(string) --
The primary IPv4 CIDR block for the VPC.
(list) --
Information about the IPv4 CIDR blocks associated with the VPC.
(dict) --
Describes an IPv4 CIDR block associated with a VPC.
AssociationId (string) --
The association ID for the IPv4 CIDR block.
CidrBlock (string) --
The IPv4 CIDR block.
CidrBlockState (dict) --
Information about the state of the CIDR block.
State (string) --
The state of the CIDR block.
StatusMessage (string) --
A message about the status of the CIDR block, if applicable.
(string) --
The ID of the set of DHCP options you've associated with the VPC (or default if the default options are associated with the VPC).
(string) --
The allowed tenancy of instances launched into the VPC.
(list) --
Information about the IPv6 CIDR blocks associated with the VPC.
(dict) --
Describes an IPv6 CIDR block associated with a VPC.
AssociationId (string) --
The association ID for the IPv6 CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
Ipv6CidrBlockState (dict) --
Information about the state of the CIDR block.
State (string) --
The state of the CIDR block.
StatusMessage (string) --
A message about the status of the CIDR block, if applicable.
(boolean) --
Indicates whether the VPC is the default VPC.
(string) --
The ID of the AWS account that owns the VPC.
(string) --
The current state of the VPC.
(list) --
Any tags assigned to the VPC.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
(string) --
The ID of the VPC.
References
References are related resource instances that have a belongs-to relationship. For more information about references refer to the Resources Introduction Guide.
(DhcpOptions) The related dhcp_options if set, otherwise None.
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.
Associates a set of DHCP options (that you've previously created) with the specified VPC, or associates no DHCP options with the VPC.
After you associate the options with the VPC, any existing instances and all new instances that you launch in that VPC use the options. You don't need to restart or relaunch the instances. They automatically pick up the changes within a few hours, depending on how frequently the instance renews its DHCP lease. You can explicitly renew the lease using the operating system on the instance.
For more information, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = vpc.associate_dhcp_options(
DhcpOptionsId='string',
DryRun=True|False
)
[REQUIRED]
The ID of the DHCP options set, or default to associate no DHCP options with the VPC.
None
Links an EC2-Classic instance to a ClassicLink-enabled VPC through one or more of the VPC's security groups. You cannot link an EC2-Classic instance to more than one VPC at a time. You can only link an instance that's in the running state. An instance is automatically unlinked from a VPC when it's stopped - you can link it to the VPC again when you restart it.
After you've linked an instance, you cannot change the VPC security groups that are associated with it. To change the security groups, you must first unlink the instance, and then link it again.
Linking your instance to a VPC is sometimes referred to as attaching your instance.
See also: AWS API Documentation
Request Syntax
response = vpc.attach_classic_link_instance(
DryRun=True|False,
Groups=[
'string',
],
InstanceId='string',
)
[REQUIRED]
The ID of one or more of the VPC's security groups. You cannot specify security groups from a different VPC.
[REQUIRED]
The ID of an EC2-Classic instance to link to the ClassicLink-enabled VPC.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Attaches an internet gateway to a VPC, enabling connectivity between the internet and the VPC. For more information about your VPC and internet gateway, see the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = vpc.attach_internet_gateway(
DryRun=True|False,
InternetGatewayId='string',
)
[REQUIRED]
The ID of the internet gateway.
None
Creates a network ACL in a VPC. Network ACLs provide an optional layer of security (in addition to security groups) for the instances in your VPC.
For more information, see Network ACLs in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
network_acl = vpc.create_network_acl(
DryRun=True|False,
)
Creates a route table for the specified VPC. After you create a route table, you can add routes and associate the table with a subnet.
For more information, see Route Tables in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
route_table = vpc.create_route_table(
DryRun=True|False,
)
Creates a security group.
A security group acts as a virtual firewall for your instance to control inbound and outbound traffic. For more information, see Amazon EC2 Security Groups in the Amazon Elastic Compute Cloud User Guide and Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide .
When you create a security group, you specify a friendly name of your choice. You can have a security group for use in EC2-Classic with the same name as a security group for use in a VPC. However, you can't have two security groups for use in EC2-Classic with the same name or two security groups for use in a VPC with the same name.
You have a default security group for use in EC2-Classic and a default security group for use in your VPC. If you don't specify a security group when you launch an instance, the instance is launched into the appropriate default security group. A default security group includes a default rule that grants instances unrestricted network access to each other.
You can add or remove rules from your security groups using AuthorizeSecurityGroupIngress , AuthorizeSecurityGroupEgress , RevokeSecurityGroupIngress , and RevokeSecurityGroupEgress .
For more information about VPC security group limits, see Amazon VPC Limits .
See also: AWS API Documentation
Request Syntax
security_group = vpc.create_security_group(
Description='string',
GroupName='string',
DryRun=True|False
)
[REQUIRED]
A description for the security group. This is informational only.
Constraints: Up to 255 characters in length
Constraints for EC2-Classic: ASCII characters
Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*
[REQUIRED]
The name of the security group.
Constraints: Up to 255 characters in length. Cannot start with sg- .
Constraints for EC2-Classic: ASCII characters
Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*
ec2.SecurityGroup
SecurityGroup resource
Creates a subnet in an existing VPC.
When you create each subnet, you provide the VPC ID and IPv4 CIDR block for the subnet. After you create a subnet, you can't change its CIDR block. The size of the subnet's IPv4 CIDR block can be the same as a VPC's IPv4 CIDR block, or a subset of a VPC's IPv4 CIDR block. If you create more than one subnet in a VPC, the subnets' CIDR blocks must not overlap. The smallest IPv4 subnet (and VPC) you can create uses a /28 netmask (16 IPv4 addresses), and the largest uses a /16 netmask (65,536 IPv4 addresses).
If you've associated an IPv6 CIDR block with your VPC, you can create a subnet with an IPv6 CIDR block that uses a /64 prefix length.
Warning
AWS reserves both the first four and the last IPv4 address in each subnet's CIDR block. They're not available for use.
If you add more than one subnet to a VPC, they're set up in a star topology with a logical router in the middle.
If you launch an instance in a VPC using an Amazon EBS-backed AMI, the IP address doesn't change if you stop and restart the instance (unlike a similar instance launched outside a VPC, which gets a new IP address when restarted). It's therefore possible to have a subnet with no running instances (they're all stopped), but no remaining IP addresses available.
For more information about subnets, see Your VPC and Subnets in the Amazon Virtual Private Cloud User Guide .
See also: AWS API Documentation
Request Syntax
subnet = vpc.create_subnet(
AvailabilityZone='string',
AvailabilityZoneId='string',
CidrBlock='string',
Ipv6CidrBlock='string',
DryRun=True|False
)
The Availability Zone for the subnet.
Default: AWS selects one for you. If you create more than one subnet in your VPC, we may not necessarily select a different zone for each subnet.
[REQUIRED]
The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24 .
ec2.Subnet
Subnet resource
Adds or overwrites the specified tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide . For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
tag = vpc.create_tags(
DryRun=True|False,
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
list(ec2.Tag)
A list of Tag resources
Deletes the specified VPC. You must detach or delete all gateways and resources that are associated with the VPC before you can delete it. For example, you must terminate all instances running in the VPC, delete all security groups associated with the VPC (except the default one), delete all route tables associated with the VPC (except the default one), and so on.
See also: AWS API Documentation
Request Syntax
response = vpc.delete(
DryRun=True|False
)
Describes the specified attribute of the specified VPC. You can specify only one attribute at a time.
See also: AWS API Documentation
Request Syntax
response = vpc.describe_attribute(
Attribute='enableDnsSupport'|'enableDnsHostnames',
DryRun=True|False
)
[REQUIRED]
The VPC attribute.
dict
Response Syntax
{
'VpcId': 'string',
'EnableDnsHostnames': {
'Value': True|False
},
'EnableDnsSupport': {
'Value': True|False
}
}
Response Structure
(dict) --
VpcId (string) --
The ID of the VPC.
EnableDnsHostnames (dict) --
Indicates whether the instances launched in the VPC get DNS hostnames. If this attribute is true , instances in the VPC get DNS hostnames; otherwise, they do not.
Value (boolean) --
The attribute value. The valid values are true or false .
EnableDnsSupport (dict) --
Indicates whether DNS resolution is enabled for the VPC. If this attribute is true , the Amazon DNS server resolves DNS hostnames for your instances to their corresponding IP addresses; otherwise, it does not.
Value (boolean) --
The attribute value. The valid values are true or false .
Unlinks (detaches) a linked EC2-Classic instance from a VPC. After the instance has been unlinked, the VPC security groups are no longer associated with it. An instance is automatically unlinked from a VPC when it's stopped.
See also: AWS API Documentation
Request Syntax
response = vpc.detach_classic_link_instance(
DryRun=True|False,
InstanceId='string',
)
[REQUIRED]
The ID of the instance to unlink from the VPC.
dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true if the request succeeds; otherwise, it returns an error.
Detaches an internet gateway from a VPC, disabling connectivity between the internet and the VPC. The VPC must not contain any running instances with Elastic IP addresses or public IPv4 addresses.
See also: AWS API Documentation
Request Syntax
response = vpc.detach_internet_gateway(
DryRun=True|False,
InternetGatewayId='string',
)
[REQUIRED]
The ID of the internet gateway.
None
Disables ClassicLink for a VPC. You cannot disable ClassicLink for a VPC that has EC2-Classic instances linked to it.
See also: AWS API Documentation
Request Syntax
response = vpc.disable_classic_link(
DryRun=True|False,
)
{
'Return': True|False
}
Response Structure
Returns true if the request succeeds; otherwise, it returns an error.
Enables a VPC for ClassicLink. You can then link EC2-Classic instances to your ClassicLink-enabled VPC to allow communication over private IP addresses. You cannot enable your VPC for ClassicLink if any of your VPC route tables have existing routes for address ranges within the 10.0.0.0/8 IP address range, excluding local routes for VPCs in the 10.0.0.0/16 and 10.1.0.0/16 IP address ranges. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = vpc.enable_classic_link(
DryRun=True|False,
)
{
'Return': True|False
}
Response Structure
Returns true if the request succeeds; otherwise, it returns an error.
Returns a list of all the available sub-resources for this Resource.
Calls EC2.Client.describe_vpcs() to update the attributes of the Vpc resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
vpc.load()
Modifies the specified attribute of the specified VPC.
See also: AWS API Documentation
Request Syntax
response = vpc.modify_attribute(
EnableDnsHostnames={
'Value': True|False
},
EnableDnsSupport={
'Value': True|False
},
)
Indicates whether the instances launched in the VPC get DNS hostnames. If enabled, instances in the VPC get DNS hostnames; otherwise, they do not.
You cannot modify the DNS resolution and DNS hostnames attributes in the same request. Use separate requests for each attribute. You can only enable DNS hostnames if you've enabled DNS support.
The attribute value. The valid values are true or false .
Indicates whether the DNS resolution is supported for the VPC. If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range "plus two" succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled.
You cannot modify the DNS resolution and DNS hostnames attributes in the same request. Use separate requests for each attribute.
The attribute value. The valid values are true or false .
None
Calls EC2.Client.describe_vpcs() to update the attributes of the Vpc resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
vpc.reload()
Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection. The accepter VPC can belong to another AWS account and can be in a different Region to the requester VPC. The requester VPC and accepter VPC cannot have overlapping CIDR blocks.
Note
Limitations and rules apply to a VPC peering connection. For more information, see the limitations section in the VPC Peering Guide .
The owner of the accepter VPC must accept the peering request to activate the peering connection. The VPC peering connection request expires after 7 days, after which it cannot be accepted or rejected.
If you create a VPC peering connection request between VPCs with overlapping CIDR blocks, the VPC peering connection has a status of failed .
See also: AWS API Documentation
Request Syntax
vpc_peering_connection = vpc.request_vpc_peering_connection(
DryRun=True|False,
PeerOwnerId='string',
PeerVpcId='string',
PeerRegion='string'
)
The AWS account ID of the owner of the accepter VPC.
Default: Your AWS account ID
The Region code for the accepter VPC, if the accepter VPC is located in a Region other than the Region in which you make the request.
Default: The Region in which you make the request.
ec2.VpcPeeringConnection
VpcPeeringConnection resource
Collections
Collections provide an interface to iterate over and manipulate groups of resources. For more information about collections refer to the Resources Introduction Guide.
A collection of VpcPeeringConnection resources
Creates an iterable of all VpcPeeringConnection resources in the collection.
See also: AWS API Documentation
Request Syntax
vpc_peering_connection_iterator = vpc.accepted_vpc_peering_connections.all()
Creates an iterable of all VpcPeeringConnection resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
vpc_peering_connection_iterator = vpc.accepted_vpc_peering_connections.filter(
DryRun=True|False,
VpcPeeringConnectionIds=[
'string',
],
NextToken='string',
MaxResults=123
)
One or more VPC peering connection IDs.
Default: Describes all your VPC peering connections.
list(ec2.VpcPeeringConnection)
A list of VpcPeeringConnection resources
Creates an iterable up to a specified amount of VpcPeeringConnection resources in the collection.
See also: AWS API Documentation
Request Syntax
vpc_peering_connection_iterator = vpc.accepted_vpc_peering_connections.limit(
count=123
)
Creates an iterable of all VpcPeeringConnection resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
vpc_peering_connection_iterator = vpc.accepted_vpc_peering_connections.page_size(
count=123
)
A collection of Instance resources
Creates an iterable of all Instance resources in the collection.
See also: AWS API Documentation
Request Syntax
instance_iterator = vpc.instances.all()
Adds or overwrites the specified tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide . For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = vpc.instances.create_tags(
DryRun=True|False,
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
None
Creates an iterable of all Instance resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
instance_iterator = vpc.instances.filter(
InstanceIds=[
'string',
],
DryRun=True|False,
MaxResults=123,
NextToken='string'
)
The instance IDs.
Default: Describes all your instances.
list(ec2.Instance)
A list of Instance resources
Creates an iterable up to a specified amount of Instance resources in the collection.
See also: AWS API Documentation
Request Syntax
instance_iterator = vpc.instances.limit(
count=123
)
Enables detailed monitoring for a running instance. Otherwise, basic monitoring is enabled. For more information, see Monitoring Your Instances and Volumes in the Amazon Elastic Compute Cloud User Guide .
To disable detailed monitoring, see .
See also: AWS API Documentation
Request Syntax
response = vpc.instances.monitor(
DryRun=True|False
)
{
'InstanceMonitorings': [
{
'InstanceId': 'string',
'Monitoring': {
'State': 'disabled'|'disabling'|'enabled'|'pending'
}
},
]
}
Response Structure
The monitoring information.
Describes the monitoring of an instance.
The ID of the instance.
The monitoring for the instance.
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
Creates an iterable of all Instance resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
instance_iterator = vpc.instances.page_size(
count=123
)
Requests a reboot of the specified instances. This operation is asynchronous; it only queues a request to reboot the specified instances. The operation succeeds if the instances are valid and belong to you. Requests to reboot terminated instances are ignored.
If an instance does not cleanly shut down within four minutes, Amazon EC2 performs a hard reboot.
For more information about troubleshooting, see Getting Console Output and Rebooting Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = vpc.instances.reboot(
DryRun=True|False
)
Starts an Amazon EBS-backed instance that you've previously stopped.
Instances that use Amazon EBS volumes as their root devices can be quickly stopped and started. When an instance is stopped, the compute resources are released and you are not billed for instance usage. However, your root partition Amazon EBS volume remains and continues to persist your data, and you are charged for Amazon EBS volume usage. You can restart your instance at any time. Every time you start your Windows instance, Amazon EC2 charges you for a full instance hour. If you stop and restart your Windows instance, a new instance hour begins and Amazon EC2 charges you for another full instance hour even if you are still within the same 60-minute period when it was stopped. Every time you start your Linux instance, Amazon EC2 charges a one-minute minimum for instance usage, and thereafter charges per second for instance usage.
Before stopping an instance, make sure it is in a state from which it can be restarted. Stopping an instance does not preserve data stored in RAM.
Performing this operation on an instance that uses an instance store as its root device returns an error.
For more information, see Stopping Instances in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = vpc.instances.start(
AdditionalInfo='string',
DryRun=True|False
)
dict
Response Syntax
{
'StartingInstances': [
{
'CurrentState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceId': 'string',
'PreviousState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
}
},
]
}
Response Structure
(dict) --
StartingInstances (list) --
Information about the started instances.
(dict) --
Describes an instance state change.
CurrentState (dict) --
The current state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
InstanceId (string) --
The ID of the instance.
PreviousState (dict) --
The previous state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
Stops an Amazon EBS-backed instance.
You can use the Stop action to hibernate an instance if the instance is enabled for hibernation and it meets the hibernation prerequisites . For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
We don't charge usage for a stopped instance, or data transfer fees; however, your root partition Amazon EBS volume remains and continues to persist your data, and you are charged for Amazon EBS volume usage. Every time you start your Windows instance, Amazon EC2 charges you for a full instance hour. If you stop and restart your Windows instance, a new instance hour begins and Amazon EC2 charges you for another full instance hour even if you are still within the same 60-minute period when it was stopped. Every time you start your Linux instance, Amazon EC2 charges a one-minute minimum for instance usage, and thereafter charges per second for instance usage.
You can't start, stop, or hibernate Spot Instances, and you can't stop or hibernate instance store-backed instances. For information about using hibernation for Spot Instances, see Hibernating Interrupted Spot Instances in the Amazon Elastic Compute Cloud User Guide .
When you stop or hibernate an instance, we shut it down. You can restart your instance at any time. Before stopping or hibernating an instance, make sure it is in a state from which it can be restarted. Stopping an instance does not preserve data stored in RAM, but hibernating an instance does preserve data stored in RAM. If an instance cannot hibernate successfully, a normal shutdown occurs.
Stopping and hibernating an instance is different to rebooting or terminating it. For example, when you stop or hibernate an instance, the root device and any other devices attached to the instance persist. When you terminate an instance, the root device and any other devices attached during the instance launch are automatically deleted. For more information about the differences between rebooting, stopping, hibernating, and terminating instances, see Instance Lifecycle in the Amazon Elastic Compute Cloud User Guide .
When you stop an instance, we attempt to shut it down forcibly after a short while. If your instance appears stuck in the stopping state after a period of time, there may be an issue with the underlying host computer. For more information, see Troubleshooting Stopping Your Instance in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = vpc.instances.stop(
Hibernate=True|False,
DryRun=True|False,
Force=True|False
)
Hibernates the instance if the instance was enabled for hibernation at launch. If the instance cannot hibernate successfully, a normal shutdown occurs. For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .
Default: false
Forces the instances to stop. The instances do not have an opportunity to flush file system caches or file system metadata. If you use this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances.
Default: false
dict
Response Syntax
{
'StoppingInstances': [
{
'CurrentState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceId': 'string',
'PreviousState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
}
},
]
}
Response Structure
(dict) --
StoppingInstances (list) --
Information about the stopped instances.
(dict) --
Describes an instance state change.
CurrentState (dict) --
The current state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
InstanceId (string) --
The ID of the instance.
PreviousState (dict) --
The previous state of the instance.
Code (integer) --
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Name (string) --
The current state of the instance.
Shuts down the specified instances. This operation is idempotent; if you terminate an instance more than once, each call succeeds.
If you specify multiple instances and the request fails (for example, because of a single incorrect instance ID), none of the instances are terminated.
Terminated instances remain visible after termination (for approximately one hour).
By default, Amazon EC2 deletes all EBS volumes that were attached when the instance launched. Volumes attached after instance launch continue running.
You can stop, start, and terminate EBS-backed instances. You can only terminate instance store-backed instances. What happens to an instance differs if you stop it or terminate it. For example, when you stop an instance, the root device and any other devices attached to the instance persist. When you terminate an instance, any attached EBS volumes with the DeleteOnTermination block device mapping parameter set to true are automatically deleted. For more information about the differences between stopping and terminating instances, see Instance Lifecycle in the Amazon Elastic Compute Cloud User Guide .
For more information about troubleshooting, see Troubleshooting Terminating Your Instance in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = vpc.instances.terminate(
DryRun=True|False
)
{
'TerminatingInstances': [
{
'CurrentState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
},
'InstanceId': 'string',
'PreviousState': {
'Code': 123,
'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
}
},
]
}
Response Structure
Information about the terminated instances.
Describes an instance state change.
The current state of the instance.
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
The current state of the instance.
The ID of the instance.
The previous state of the instance.
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
The current state of the instance.
Disables detailed monitoring for a running instance. For more information, see Monitoring Your Instances and Volumes in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = vpc.instances.unmonitor(
DryRun=True|False
)
{
'InstanceMonitorings': [
{
'InstanceId': 'string',
'Monitoring': {
'State': 'disabled'|'disabling'|'enabled'|'pending'
}
},
]
}
Response Structure
The monitoring information.
Describes the monitoring of an instance.
The ID of the instance.
The monitoring for the instance.
Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
A collection of InternetGateway resources
Creates an iterable of all InternetGateway resources in the collection.
See also: AWS API Documentation
Request Syntax
internet_gateway_iterator = vpc.internet_gateways.all()
Creates an iterable of all InternetGateway resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
internet_gateway_iterator = vpc.internet_gateways.filter(
DryRun=True|False,
InternetGatewayIds=[
'string',
],
NextToken='string',
MaxResults=123
)
One or more internet gateway IDs.
Default: Describes all your internet gateways.
list(ec2.InternetGateway)
A list of InternetGateway resources
Creates an iterable up to a specified amount of InternetGateway resources in the collection.
See also: AWS API Documentation
Request Syntax
internet_gateway_iterator = vpc.internet_gateways.limit(
count=123
)
Creates an iterable of all InternetGateway resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
internet_gateway_iterator = vpc.internet_gateways.page_size(
count=123
)
A collection of NetworkAcl resources
Creates an iterable of all NetworkAcl resources in the collection.
See also: AWS API Documentation
Request Syntax
network_acl_iterator = vpc.network_acls.all()
Creates an iterable of all NetworkAcl resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
network_acl_iterator = vpc.network_acls.filter(
DryRun=True|False,
NetworkAclIds=[
'string',
],
NextToken='string',
MaxResults=123
)
One or more network ACL IDs.
Default: Describes all your network ACLs.
list(ec2.NetworkAcl)
A list of NetworkAcl resources
Creates an iterable up to a specified amount of NetworkAcl resources in the collection.
See also: AWS API Documentation
Request Syntax
network_acl_iterator = vpc.network_acls.limit(
count=123
)
Creates an iterable of all NetworkAcl resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
network_acl_iterator = vpc.network_acls.page_size(
count=123
)
A collection of NetworkInterface resources
Creates an iterable of all NetworkInterface resources in the collection.
See also: AWS API Documentation
Request Syntax
network_interface_iterator = vpc.network_interfaces.all()
Creates an iterable of all NetworkInterface resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
network_interface_iterator = vpc.network_interfaces.filter(
DryRun=True|False,
NetworkInterfaceIds=[
'string',
],
NextToken='string',
MaxResults=123
)
One or more network interface IDs.
Default: Describes all your network interfaces.
list(ec2.NetworkInterface)
A list of NetworkInterface resources
Creates an iterable up to a specified amount of NetworkInterface resources in the collection.
See also: AWS API Documentation
Request Syntax
network_interface_iterator = vpc.network_interfaces.limit(
count=123
)
Creates an iterable of all NetworkInterface resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
network_interface_iterator = vpc.network_interfaces.page_size(
count=123
)
A collection of VpcPeeringConnection resources
Creates an iterable of all VpcPeeringConnection resources in the collection.
See also: AWS API Documentation
Request Syntax
vpc_peering_connection_iterator = vpc.requested_vpc_peering_connections.all()
Creates an iterable of all VpcPeeringConnection resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
vpc_peering_connection_iterator = vpc.requested_vpc_peering_connections.filter(
DryRun=True|False,
VpcPeeringConnectionIds=[
'string',
],
NextToken='string',
MaxResults=123
)
One or more VPC peering connection IDs.
Default: Describes all your VPC peering connections.
list(ec2.VpcPeeringConnection)
A list of VpcPeeringConnection resources
Creates an iterable up to a specified amount of VpcPeeringConnection resources in the collection.
See also: AWS API Documentation
Request Syntax
vpc_peering_connection_iterator = vpc.requested_vpc_peering_connections.limit(
count=123
)
Creates an iterable of all VpcPeeringConnection resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
vpc_peering_connection_iterator = vpc.requested_vpc_peering_connections.page_size(
count=123
)
A collection of RouteTable resources
Creates an iterable of all RouteTable resources in the collection.
See also: AWS API Documentation
Request Syntax
route_table_iterator = vpc.route_tables.all()
Creates an iterable of all RouteTable resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
route_table_iterator = vpc.route_tables.filter(
DryRun=True|False,
RouteTableIds=[
'string',
],
NextToken='string',
MaxResults=123
)
One or more route table IDs.
Default: Describes all your route tables.
list(ec2.RouteTable)
A list of RouteTable resources
Creates an iterable up to a specified amount of RouteTable resources in the collection.
See also: AWS API Documentation
Request Syntax
route_table_iterator = vpc.route_tables.limit(
count=123
)
Creates an iterable of all RouteTable resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
route_table_iterator = vpc.route_tables.page_size(
count=123
)
A collection of SecurityGroup resources
Creates an iterable of all SecurityGroup resources in the collection.
See also: AWS API Documentation
Request Syntax
security_group_iterator = vpc.security_groups.all()
Creates an iterable of all SecurityGroup resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
security_group_iterator = vpc.security_groups.filter(
GroupIds=[
'string',
],
GroupNames=[
'string',
],
DryRun=True|False,
NextToken='string',
MaxResults=123
)
The IDs of the security groups. Required for security groups in a nondefault VPC.
Default: Describes all your security groups.
[EC2-Classic and default VPC only] The names of the security groups. You can specify either the security group name or the security group ID. For security groups in a nondefault VPC, use the group-name filter to describe security groups by name.
Default: Describes all your security groups.
list(ec2.SecurityGroup)
A list of SecurityGroup resources
Creates an iterable up to a specified amount of SecurityGroup resources in the collection.
See also: AWS API Documentation
Request Syntax
security_group_iterator = vpc.security_groups.limit(
count=123
)
Creates an iterable of all SecurityGroup resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
security_group_iterator = vpc.security_groups.page_size(
count=123
)
A collection of Subnet resources
Creates an iterable of all Subnet resources in the collection.
See also: AWS API Documentation
Request Syntax
subnet_iterator = vpc.subnets.all()
Creates an iterable of all Subnet resources in the collection filtered by kwargs passed to method.
See also: AWS API Documentation
Request Syntax
subnet_iterator = vpc.subnets.filter(
SubnetIds=[
'string',
],
DryRun=True|False,
NextToken='string',
MaxResults=123
)
One or more subnet IDs.
Default: Describes all your subnets.
list(ec2.Subnet)
A list of Subnet resources
Creates an iterable up to a specified amount of Subnet resources in the collection.
See also: AWS API Documentation
Request Syntax
subnet_iterator = vpc.subnets.limit(
count=123
)
Creates an iterable of all Subnet resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
subnet_iterator = vpc.subnets.page_size(
count=123
)
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.
Waits until this Vpc is available. This method calls EC2.Waiter.vpc_available.wait() which polls. EC2.Client.describe_vpcs() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
vpc.wait_until_available(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
NextToken='string',
MaxResults=123
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
None
Waits until this Vpc is exists. This method calls EC2.Waiter.vpc_exists.wait() which polls. EC2.Client.describe_vpcs() every 1 seconds until a successful state is reached. An error is returned after 5 failed checks.
See also: AWS API Documentation
Request Syntax
vpc.wait_until_exists(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
NextToken='string',
MaxResults=123
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
None
A resource representing an Amazon Elastic Compute Cloud (EC2) VpcPeeringConnection:
import boto3
ec2 = boto3.resource('ec2')
vpc_peering_connection = ec2.VpcPeeringConnection('id')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available references:
These are the resource's available actions:
These are the resource's available waiters:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The VpcPeeringConnection's id identifier. This must be set.
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.
(dict) --
Information about the accepter VPC. CIDR block information is only returned when describing an active VPC peering connection.
CidrBlock (string) --
The IPv4 CIDR block for the VPC.
Ipv6CidrBlockSet (list) --
The IPv6 CIDR block for the VPC.
(dict) --
Describes an IPv6 CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
CidrBlockSet (list) --
Information about the IPv4 CIDR blocks for the VPC.
(dict) --
Describes an IPv4 CIDR block.
CidrBlock (string) --
The IPv4 CIDR block.
OwnerId (string) --
The AWS account ID of the VPC owner.
PeeringOptions (dict) --
Information about the VPC peering connection options for the accepter or requester VPC.
AllowDnsResolutionFromRemoteVpc (boolean) --
Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
AllowEgressFromLocalClassicLinkToRemoteVpc (boolean) --
Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection.
AllowEgressFromLocalVpcToRemoteClassicLink (boolean) --
Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection.
VpcId (string) --
The ID of the VPC.
Region (string) --
The Region in which the VPC is located.
(datetime) --
The time that an unaccepted VPC peering connection will expire.
(dict) --
Information about the requester VPC. CIDR block information is only returned when describing an active VPC peering connection.
CidrBlock (string) --
The IPv4 CIDR block for the VPC.
Ipv6CidrBlockSet (list) --
The IPv6 CIDR block for the VPC.
(dict) --
Describes an IPv6 CIDR block.
Ipv6CidrBlock (string) --
The IPv6 CIDR block.
CidrBlockSet (list) --
Information about the IPv4 CIDR blocks for the VPC.
(dict) --
Describes an IPv4 CIDR block.
CidrBlock (string) --
The IPv4 CIDR block.
OwnerId (string) --
The AWS account ID of the VPC owner.
PeeringOptions (dict) --
Information about the VPC peering connection options for the accepter or requester VPC.
AllowDnsResolutionFromRemoteVpc (boolean) --
Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
AllowEgressFromLocalClassicLinkToRemoteVpc (boolean) --
Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection.
AllowEgressFromLocalVpcToRemoteClassicLink (boolean) --
Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection.
VpcId (string) --
The ID of the VPC.
Region (string) --
The Region in which the VPC is located.
(dict) --
The status of the VPC peering connection.
Code (string) --
The status of the VPC peering connection.
Message (string) --
A message that provides more information about the status, if applicable.
(list) --
Any tags assigned to the resource.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
(string) --
The ID of the VPC peering connection.
References
References are related resource instances that have a belongs-to relationship. For more information about references refer to the Resources Introduction Guide.
(Vpc) The related accepter_vpc if set, otherwise None.
(Vpc) The related requester_vpc if set, otherwise None.
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.
Accept a VPC peering connection request. To accept a request, the VPC peering connection must be in the pending-acceptance state, and you must be the owner of the peer VPC. Use DescribeVpcPeeringConnections to view your outstanding VPC peering connection requests.
For an inter-Region VPC peering connection request, you must accept the VPC peering connection in the Region of the accepter VPC.
See also: AWS API Documentation
Request Syntax
response = vpc_peering_connection.accept(
DryRun=True|False,
)
{
'VpcPeeringConnection': {
'AccepterVpcInfo': {
'CidrBlock': 'string',
'Ipv6CidrBlockSet': [
{
'Ipv6CidrBlock': 'string'
},
],
'CidrBlockSet': [
{
'CidrBlock': 'string'
},
],
'OwnerId': 'string',
'PeeringOptions': {
'AllowDnsResolutionFromRemoteVpc': True|False,
'AllowEgressFromLocalClassicLinkToRemoteVpc': True|False,
'AllowEgressFromLocalVpcToRemoteClassicLink': True|False
},
'VpcId': 'string',
'Region': 'string'
},
'ExpirationTime': datetime(2015, 1, 1),
'RequesterVpcInfo': {
'CidrBlock': 'string',
'Ipv6CidrBlockSet': [
{
'Ipv6CidrBlock': 'string'
},
],
'CidrBlockSet': [
{
'CidrBlock': 'string'
},
],
'OwnerId': 'string',
'PeeringOptions': {
'AllowDnsResolutionFromRemoteVpc': True|False,
'AllowEgressFromLocalClassicLinkToRemoteVpc': True|False,
'AllowEgressFromLocalVpcToRemoteClassicLink': True|False
},
'VpcId': 'string',
'Region': 'string'
},
'Status': {
'Code': 'initiating-request'|'pending-acceptance'|'active'|'deleted'|'rejected'|'failed'|'expired'|'provisioning'|'deleting',
'Message': 'string'
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'VpcPeeringConnectionId': 'string'
}
}
Response Structure
Information about the VPC peering connection.
Information about the accepter VPC. CIDR block information is only returned when describing an active VPC peering connection.
The IPv4 CIDR block for the VPC.
The IPv6 CIDR block for the VPC.
Describes an IPv6 CIDR block.
The IPv6 CIDR block.
Information about the IPv4 CIDR blocks for the VPC.
Describes an IPv4 CIDR block.
The IPv4 CIDR block.
The AWS account ID of the VPC owner.
Information about the VPC peering connection options for the accepter or requester VPC.
Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection.
Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection.
The ID of the VPC.
The Region in which the VPC is located.
The time that an unaccepted VPC peering connection will expire.
Information about the requester VPC. CIDR block information is only returned when describing an active VPC peering connection.
The IPv4 CIDR block for the VPC.
The IPv6 CIDR block for the VPC.
Describes an IPv6 CIDR block.
The IPv6 CIDR block.
Information about the IPv4 CIDR blocks for the VPC.
Describes an IPv4 CIDR block.
The IPv4 CIDR block.
The AWS account ID of the VPC owner.
Information about the VPC peering connection options for the accepter or requester VPC.
Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC peering connection.
Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC peering connection.
The ID of the VPC.
The Region in which the VPC is located.
The status of the VPC peering connection.
The status of the VPC peering connection.
A message that provides more information about the status, if applicable.
Any tags assigned to the resource.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
The ID of the VPC peering connection.
Deletes a VPC peering connection. Either the owner of the requester VPC or the owner of the accepter VPC can delete the VPC peering connection if it's in the active state. The owner of the requester VPC can delete a VPC peering connection in the pending-acceptance state. You cannot delete a VPC peering connection that's in the failed state.
See also: AWS API Documentation
Request Syntax
response = vpc_peering_connection.delete(
DryRun=True|False,
)
{
'Return': True|False
}
Response Structure
Returns true if the request succeeds; otherwise, it returns an error.
Returns a list of all the available sub-resources for this Resource.
Calls EC2.Client.describe_vpc_peering_connections() to update the attributes of the VpcPeeringConnection resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
vpc_peering_connection.load()
Rejects a VPC peering connection request. The VPC peering connection must be in the pending-acceptance state. Use the DescribeVpcPeeringConnections request to view your outstanding VPC peering connection requests. To delete an active VPC peering connection, or to delete a VPC peering connection request that you initiated, use DeleteVpcPeeringConnection .
See also: AWS API Documentation
Request Syntax
response = vpc_peering_connection.reject(
DryRun=True|False,
)
{
'Return': True|False
}
Response Structure
Returns true if the request succeeds; otherwise, it returns an error.
Calls EC2.Client.describe_vpc_peering_connections() to update the attributes of the VpcPeeringConnection resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
vpc_peering_connection.reload()
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.
Waits until this VpcPeeringConnection is exists. This method calls EC2.Waiter.vpc_peering_connection_exists.wait() which polls. EC2.Client.describe_vpc_peering_connections() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
See also: AWS API Documentation
Request Syntax
vpc_peering_connection.wait_until_exists(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False,
NextToken='string',
MaxResults=123
)
One or more filters.
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
The name of the filter. Filter names are case-sensitive.
The filter values. Filter values are case-sensitive.
None
A resource representing an Amazon Elastic Compute Cloud (EC2) VpcAddress:
import boto3
ec2 = boto3.resource('ec2')
vpc_address = ec2.VpcAddress('allocation_id')
These are the resource's available identifiers:
These are the resource's available attributes:
These are the resource's available references:
These are the resource's available actions:
Identifiers
Identifiers are properties of a resource that are set upon instantation of the resource. For more information about identifiers refer to the Resources Introduction Guide.
(string) The VpcAddress's allocation_id identifier. This must be set.
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.
(string) --
The ID representing the association of the address with an instance in a VPC.
(string) --
Indicates whether this Elastic IP address is for use with instances in EC2-Classic (standard ) or instances in a VPC (vpc ).
(string) --
The ID of the instance that the address is associated with (if any).
(string) --
The ID of the network interface.
(string) --
The ID of the AWS account that owns the network interface.
(string) --
The private IP address associated with the Elastic IP address.
(string) --
The Elastic IP address.
(string) --
The ID of an address pool.
(list) --
Any tags assigned to the Elastic IP address.
(dict) --
Describes a tag.
Key (string) --
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .
Value (string) --
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
References
References are related resource instances that have a belongs-to relationship. For more information about references refer to the Resources Introduction Guide.
(NetworkInterfaceAssociation) The related association if set, otherwise None.
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.
Associates an Elastic IP address with an instance or a network interface. Before you can use an Elastic IP address, you must allocate it to your account.
An Elastic IP address is for use in either the EC2-Classic platform or in a VPC. For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide .
[EC2-Classic, VPC in an EC2-VPC-only account] If the Elastic IP address is already associated with a different instance, it is disassociated from that instance and associated with the specified instance. If you associate an Elastic IP address with an instance that has an existing Elastic IP address, the existing address is disassociated from the instance, but remains allocated to your account.
[VPC in an EC2-Classic account] If you don't specify a private IP address, the Elastic IP address is associated with the primary IP address. If the Elastic IP address is already associated with a different instance or a network interface, you get an error unless you allow reassociation. You cannot associate an Elastic IP address with an instance or network interface that has an existing Elastic IP address.
Warning
This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error, and you may be charged for each time the Elastic IP address is remapped to the same instance. For more information, see the Elastic IP Addresses section of Amazon EC2 Pricing .
See also: AWS API Documentation
Request Syntax
response = vpc_address.associate(
InstanceId='string',
PublicIp='string',
AllowReassociation=True|False,
DryRun=True|False,
NetworkInterfaceId='string',
PrivateIpAddress='string'
)
[EC2-VPC] The ID of the network interface. If the instance has more than one network interface, you must specify a network interface ID.
For EC2-VPC, you can specify either the instance ID or the network interface ID, but not both.
dict
Response Syntax
{
'AssociationId': 'string'
}
Response Structure
(dict) --
AssociationId (string) --
[EC2-VPC] The ID that represents the association of the Elastic IP address with an instance.
Returns a list of all the available sub-resources for this Resource.
Calls EC2.Client.describe_addresses() to update the attributes of the VpcAddress resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
vpc_address.load()
Releases the specified Elastic IP address.
[EC2-Classic, default VPC] Releasing an Elastic IP address automatically disassociates it from any instance that it's associated with. To disassociate an Elastic IP address without releasing it, use DisassociateAddress .
[Nondefault VPC] You must use DisassociateAddress to disassociate the Elastic IP address before you can release it. Otherwise, Amazon EC2 returns an error (InvalidIPAddress.InUse ).
After releasing an Elastic IP address, it is released to the IP address pool. Be sure to update your DNS records and any servers or devices that communicate with the address. If you attempt to release an Elastic IP address that you already released, you'll get an AuthFailure error if the address is already allocated to another AWS account.
[EC2-VPC] After you release an Elastic IP address for use in a VPC, you might be able to recover it. For more information, see AllocateAddress .
See also: AWS API Documentation
Request Syntax
response = vpc_address.release(
PublicIp='string',
DryRun=True|False
)
None
Calls EC2.Client.describe_addresses() to update the attributes of the VpcAddress resource. Note that the load and reload methods are the same method and can be used interchangeably.
See also: AWS API Documentation
Request Syntax
vpc_address.reload()