Amazon Elastic Compute Cloud

2015/05/07 - Amazon Elastic Compute Cloud - 165 new api methods

DescribeSpotPriceHistory (new) Link ¶

Describes the Spot Price history. The prices returned are listed in chronological order, from the oldest to the most recent, for up to the past 90 days. For more information, see Spot Instance Pricing History in the Amazon Elastic Compute Cloud User Guide for Linux.

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.

Request Syntax

client.describe_spot_price_history(
    DryRun=True|False,
    StartTime=datetime(2015, 1, 1),
    EndTime=datetime(2015, 1, 1),
    InstanceTypes=[
        't1.micro'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'t2.micro'|'t2.small'|'t2.medium'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'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'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'cg1.4xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge',
    ],
    ProductDescriptions=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    AvailabilityZone='string',
    MaxResults=123,
    NextToken='string'
)
type DryRun:

boolean

param DryRun:

type StartTime:

datetime

param StartTime:

The date and time, up to the past 90 days, from which to start retrieving the price history data.

type EndTime:

datetime

param EndTime:

The date and time, up to the current date, from which to stop retrieving the price history data.

type InstanceTypes:

list

param InstanceTypes:

Filters the results by the specified instance types.

  • (string) --

type ProductDescriptions:

list

param ProductDescriptions:

Filters the results by the specified basic product descriptions.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • availability-zone - The Availability Zone for which prices should be returned.

  • instance-type - The type of instance (for example, m1.small).

  • product-description - The product description for the Spot Price ( Linux/UNIX | SUSE Linux | Windows | Linux/UNIX (Amazon VPC) | SUSE Linux (Amazon VPC) | Windows (Amazon VPC)).

  • spot-price - The Spot Price. The value must match exactly (or use wildcards; greater than or less than comparison is not supported).

  • timestamp - The timestamp of the Spot Price history (for example, 2010-08-16T05:06:11.000Z). You can use wildcards (* and ?). Greater than or less than comparison is not supported.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

type AvailabilityZone:

string

param AvailabilityZone:

Filters the results by the specified Availability Zone.

type MaxResults:

integer

param MaxResults:

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 larger than 1000, only 1000 results are returned.

type NextToken:

string

param NextToken:

The token to retrieve the next page of results.

rtype:

dict

returns:

Response Syntax

{
    'SpotPriceHistory': [
        {
            'InstanceType': 't1.micro'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'t2.micro'|'t2.small'|'t2.medium'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'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'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'cg1.4xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge',
            'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
            'SpotPrice': 'string',
            'Timestamp': datetime(2015, 1, 1),
            'AvailabilityZone': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • SpotPriceHistory (list) --

      The historical Spot Prices.

      • (dict) --

        Describes the maximum hourly price (bid) for any Spot Instance launched to fulfill the request.

        • InstanceType (string) --

          The instance type.

        • ProductDescription (string) --

          A general description of the AMI.

        • SpotPrice (string) --

          The maximum price (bid) that you are willing to pay for a Spot Instance.

        • Timestamp (datetime) --

          The date and time the request was created.

        • AvailabilityZone (string) --

          The 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.

DisassociateAddress (new) Link ¶

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 for Linux.

This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error.

Request Syntax

client.disassociate_address(
    DryRun=True|False,
    PublicIp='string',
    AssociationId='string'
)
type DryRun:

boolean

param DryRun:

type PublicIp:

string

param PublicIp:

[EC2-Classic] The Elastic IP address. Required for EC2-Classic.

type AssociationId:

string

param AssociationId:

[EC2-VPC] The association ID. Required for EC2-VPC.

returns:

None

PurchaseReservedInstancesOffering (new) Link ¶

Purchases a Reserved Instance for use with your account. With Amazon EC2 Reserved Instances, you obtain a capacity reservation for a certain instance configuration over a specified period of time. You pay a lower usage rate than with On-Demand instances for the time that you actually use the capacity reservation.

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 for Linux.

Request Syntax

client.purchase_reserved_instances_offering(
    DryRun=True|False,
    ReservedInstancesOfferingId='string',
    InstanceCount=123,
    LimitPrice={
        'Amount': 123.0,
        'CurrencyCode': 'USD'
    }
)
type DryRun:

boolean

param DryRun:

type ReservedInstancesOfferingId:

string

param ReservedInstancesOfferingId:

[REQUIRED]

The ID of the Reserved Instance offering to purchase.

type InstanceCount:

integer

param InstanceCount:

[REQUIRED]

The number of Reserved Instances to purchase.

type LimitPrice:

dict

param LimitPrice:

Specified for Reserved Instance Marketplace offerings to limit the total order and ensure that the Reserved Instances are not purchased at unexpected prices.

  • Amount (float) --

    Used for Reserved Instance Marketplace offerings. Specifies the limit price on the total order (instanceCount * price).

  • CurrencyCode (string) --

    The currency in which the limitPrice amount is specified. At this time, the only supported currency is USD.

rtype:

dict

returns:

Response Syntax

{
    'ReservedInstancesId': 'string'
}

Response Structure

  • (dict) --

    • ReservedInstancesId (string) --

      The IDs of the purchased Reserved Instances.

DeleteSubnet (new) Link ¶

Deletes the specified subnet. You must terminate all running instances in the subnet before you can delete the subnet.

Request Syntax

client.delete_subnet(
    DryRun=True|False,
    SubnetId='string'
)
type DryRun:

boolean

param DryRun:

type SubnetId:

string

param SubnetId:

[REQUIRED]

The ID of the subnet.

returns:

None

AssociateDhcpOptions (new) Link ¶

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.

Request Syntax

client.associate_dhcp_options(
    DryRun=True|False,
    DhcpOptionsId='string',
    VpcId='string'
)
type DryRun:

boolean

param DryRun:

type DhcpOptionsId:

string

param DhcpOptionsId:

[REQUIRED]

The ID of the DHCP options set, or default to associate no DHCP options with the VPC.

type VpcId:

string

param VpcId:

[REQUIRED]

The ID of the VPC.

returns:

None

CreateReservedInstancesListing (new) Link ¶

Creates a listing for Amazon EC2 Reserved Instances to be sold in the Reserved Instance Marketplace. You can submit one Reserved Instance listing at a time. To get a list of your Reserved Instances, you can use the DescribeReservedInstances operation.

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.

To sell your 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 Reserved Instances, and specify the upfront price to receive for them. Your Reserved Instance listings then become available for purchase. To view the details of your Reserved Instance listing, you can use the DescribeReservedInstancesListings operation.

For more information, see Reserved Instance Marketplace in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.create_reserved_instances_listing(
    ReservedInstancesId='string',
    InstanceCount=123,
    PriceSchedules=[
        {
            'Term': 123,
            'Price': 123.0,
            'CurrencyCode': 'USD'
        },
    ],
    ClientToken='string'
)
type ReservedInstancesId:

string

param ReservedInstancesId:

[REQUIRED]

The ID of the active Reserved Instance.

type InstanceCount:

integer

param InstanceCount:

[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.

type PriceSchedules:

list

param PriceSchedules:

[REQUIRED]

A list specifying the price of the Reserved Instance for each month remaining in the Reserved Instance term.

  • (dict) --

    Describes the price for a Reserved Instance.

    • 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.

    • Price (float) --

      The fixed price for the term.

    • CurrencyCode (string) --

      The currency for transacting the Reserved Instance resale. At this time, the only supported currency is USD.

type ClientToken:

string

param ClientToken:

[REQUIRED]

Unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency.

rtype:

dict

returns:

Response Syntax

{
    'ReservedInstancesListings': [
        {
            'ReservedInstancesListingId': 'string',
            'ReservedInstancesId': 'string',
            'CreateDate': datetime(2015, 1, 1),
            'UpdateDate': datetime(2015, 1, 1),
            'Status': 'active'|'pending'|'cancelled'|'closed',
            'StatusMessage': 'string',
            'InstanceCounts': [
                {
                    'State': 'available'|'sold'|'cancelled'|'pending',
                    'InstanceCount': 123
                },
            ],
            'PriceSchedules': [
                {
                    'Term': 123,
                    'Price': 123.0,
                    'CurrencyCode': 'USD',
                    'Active': True|False
                },
            ],
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'ClientToken': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • ReservedInstancesListings (list) --

      Information about the Reserved Instances listing.

      • (dict) --

        Describes a Reserved Instance listing.

        • ReservedInstancesListingId (string) --

          The ID of the Reserved Instance listing.

        • ReservedInstancesId (string) --

          The ID of the Reserved Instance.

        • CreateDate (datetime) --

          The time the listing was created.

        • UpdateDate (datetime) --

          The last modified timestamp of the 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.

        • InstanceCounts (list) --

          The number of instances in this state.

          • (dict) --

            Describes a Reserved Instance listing state.

            • State (string) --

              The states of the listed Reserved Instances.

            • InstanceCount (integer) --

              he number of listed Reserved Instances in the state specified by the state.

        • PriceSchedules (list) --

          The price of the Reserved Instance listing.

          • (dict) --

            Describes the price for a Reserved Instance.

            • 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.

            • Price (float) --

              The fixed price for the term.

            • CurrencyCode (string) --

              The currency for transacting the Reserved Instance resale. At this time, the only supported currency is USD.

            • 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.

        • 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.

        • ClientToken (string) --

          A unique, case-sensitive key supplied by the client to ensure that the request is idempotent. For more information, see Ensuring Idempotency.

DeleteRoute (new) Link ¶

Deletes the specified route from the specified route table.

Request Syntax

client.delete_route(
    DryRun=True|False,
    RouteTableId='string',
    DestinationCidrBlock='string'
)
type DryRun:

boolean

param DryRun:

type RouteTableId:

string

param RouteTableId:

[REQUIRED]

The ID of the route table.

type DestinationCidrBlock:

string

param DestinationCidrBlock:

[REQUIRED]

The CIDR range for the route. The value you specify must match the CIDR for the route exactly.

returns:

None

DeleteSpotDatafeedSubscription (new) Link ¶

Deletes the data feed for Spot Instances. For more information, see Spot Instance Data Feed in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.delete_spot_datafeed_subscription(
    DryRun=True|False
)
type DryRun:

boolean

param DryRun:

returns:

None

DeleteVpnConnectionRoute (new) Link ¶

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.

Request Syntax

client.delete_vpn_connection_route(
    VpnConnectionId='string',
    DestinationCidrBlock='string'
)
type VpnConnectionId:

string

param VpnConnectionId:

[REQUIRED]

The ID of the VPN connection.

type DestinationCidrBlock:

string

param DestinationCidrBlock:

[REQUIRED]

The CIDR block associated with the local subnet of the customer network.

returns:

None

CancelSpotInstanceRequests (new) Link ¶

Cancels one or more Spot Instance requests. Spot Instances are instances that Amazon EC2 starts on your behalf when the bid price that you specify exceeds the current Spot Price. Amazon EC2 periodically sets the Spot Price based on available Spot Instance capacity and current Spot Instance requests. For more information, see Spot Instance Requests in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.cancel_spot_instance_requests(
    DryRun=True|False,
    SpotInstanceRequestIds=[
        'string',
    ]
)
type DryRun:

boolean

param DryRun:

type SpotInstanceRequestIds:

list

param SpotInstanceRequestIds:

[REQUIRED]

One or more Spot Instance request IDs.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'CancelledSpotInstanceRequests': [
        {
            'SpotInstanceRequestId': 'string',
            'State': 'active'|'open'|'closed'|'cancelled'|'completed'
        },
    ]
}

Response Structure

  • (dict) --

    • 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.

CopySnapshot (new) Link ¶

Copies a point-in-time snapshot of an Amazon 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 Amazon EBS volumes or Amazon Machine Images (AMIs). The snapshot is copied to the regional endpoint that you send the HTTP request to.

Copies of encrypted Amazon EBS snapshots remain encrypted. Copies of unencrypted snapshots remain unencrypted.

For more information, see Copying an Amazon EBS Snapshot in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.copy_snapshot(
    DryRun=True|False,
    SourceRegion='string',
    SourceSnapshotId='string',
    Description='string',
    DestinationRegion='string',
    PresignedUrl='string'
)
type DryRun:

boolean

param DryRun:

type SourceRegion:

string

param SourceRegion:

[REQUIRED]

The ID of the region that contains the snapshot to be copied.

type SourceSnapshotId:

string

param SourceSnapshotId:

[REQUIRED]

The ID of the Amazon EBS snapshot to copy.

type Description:

string

param Description:

A description for the new Amazon EBS snapshot.

type DestinationRegion:

string

param DestinationRegion:

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.

type PresignedUrl:

string

param PresignedUrl:

The pre-signed URL that facilitates copying an encrypted snapshot. This parameter is only required when copying an encrypted snapshot with the Amazon EC2 Query API; it is available as an optional parameter in all other cases. 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 Amazon 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.

rtype:

dict

returns:

Response Syntax

{
    'SnapshotId': 'string'
}

Response Structure

  • (dict) --

    • SnapshotId (string) --

      The ID of the new snapshot.

DescribePlacementGroups (new) Link ¶

Describes one or more of your placement groups. For more information about placement groups and cluster instances, see Cluster Instances in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.describe_placement_groups(
    DryRun=True|False,
    GroupNames=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type GroupNames:

list

param GroupNames:

One or more placement group names.

Default: Describes all your placement groups, or only those otherwise specified.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • group-name - The name of the placement group.

  • state - The state of the placement group ( pending | available | deleting | deleted).

  • strategy - The strategy of the placement group ( cluster).

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'PlacementGroups': [
        {
            'GroupName': 'string',
            'Strategy': 'cluster',
            'State': 'pending'|'available'|'deleting'|'deleted'
        },
    ]
}

Response Structure

  • (dict) --

    • PlacementGroups (list) --

      One or more placement groups.

      • (dict) --

        Describes a placement group.

        • GroupName (string) --

          The name of the placement group.

        • Strategy (string) --

          The placement strategy.

        • State (string) --

          The state of the placement group.

DescribeVpcPeeringConnections (new) Link ¶

Describes one or more of your VPC peering connections.

Request Syntax

client.describe_vpc_peering_connections(
    DryRun=True|False,
    VpcPeeringConnectionIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type VpcPeeringConnectionIds:

list

param VpcPeeringConnectionIds:

One or more VPC peering connection IDs.

Default: Describes all your VPC peering connections.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • accepter-vpc-info.cidr-block - The CIDR block of the peer VPC.

  • accepter-vpc-info.owner-id - The AWS account ID of the owner of the peer VPC.

  • accepter-vpc-info.vpc-id - The ID of the peer VPC.

  • expiration-time - The expiration date and time for the VPC peering connection.

  • requester-vpc-info.cidr-block - The CIDR block of the requester's VPC.

  • requester-vpc-info.owner-id - The AWS account ID of the owner of the requester VPC.

  • requester-vpc-info.vpc-id - The ID of the requester VPC.

  • status-code - The status of the VPC peering connection ( pending-acceptance | failed | expired | provisioning | active | deleted | rejected).

  • status-message - A message that provides more information about the status of the VPC peering connection, if applicable.

  • tag:key*=*value - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key*=*value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • vpc-peering-connection-id - The ID of the VPC peering connection.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'VpcPeeringConnections': [
        {
            'AccepterVpcInfo': {
                'CidrBlock': 'string',
                'OwnerId': 'string',
                'VpcId': 'string'
            },
            'ExpirationTime': datetime(2015, 1, 1),
            'RequesterVpcInfo': {
                'CidrBlock': 'string',
                'OwnerId': 'string',
                'VpcId': 'string'
            },
            'Status': {
                'Code': 'string',
                '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) --

          The information of the peer VPC.

          • CidrBlock (string) --

            The CIDR block for the VPC.

          • OwnerId (string) --

            The AWS account ID of the VPC owner.

          • VpcId (string) --

            The ID of the VPC.

        • ExpirationTime (datetime) --

          The time that an unaccepted VPC peering connection will expire.

        • RequesterVpcInfo (dict) --

          The information of the requester VPC.

          • CidrBlock (string) --

            The CIDR block for the VPC.

          • OwnerId (string) --

            The AWS account ID of the VPC owner.

          • VpcId (string) --

            The ID of the VPC.

        • 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.

DescribeSubnets (new) Link ¶

Describes one or more of your subnets.

For more information about subnets, see Your VPC and Subnets in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.describe_subnets(
    DryRun=True|False,
    SubnetIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type SubnetIds:

list

param SubnetIds:

One or more subnet IDs.

Default: Describes all your subnets.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • availabilityZone - The Availability Zone for the subnet. You can also use availability-zone as the filter name.

  • available-ip-address-count - The number of IP addresses in the subnet that are available.

  • cidrBlock - The CIDR block of the subnet. The CIDR block you specify must exactly match the subnet's CIDR block for information to be returned for the subnet. You can also use cidr or cidr-block as the filter names.

  • defaultForAz - Indicates whether this is the default subnet for the Availability Zone. You can also use default-for-az as the filter name.

  • state - The state of the subnet ( pending | available).

  • subnet-id - The ID of the subnet.

  • tag:key*=*value - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key*=*value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • vpc-id - The ID of the VPC for the subnet.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'Subnets': [
        {
            'SubnetId': 'string',
            'State': 'pending'|'available',
            'VpcId': 'string',
            'CidrBlock': 'string',
            'AvailableIpAddressCount': 123,
            'AvailabilityZone': 'string',
            'DefaultForAz': True|False,
            'MapPublicIpOnLaunch': True|False,
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • Subnets (list) --

      Information about one or more subnets.

      • (dict) --

        Describes a subnet.

        • SubnetId (string) --

          The ID of the subnet.

        • State (string) --

          The current state of the subnet.

        • VpcId (string) --

          The ID of the VPC the subnet is in.

        • CidrBlock (string) --

          The CIDR block assigned to the subnet.

        • AvailableIpAddressCount (integer) --

          The number of unused IP addresses in the subnet. Note that the IP addresses for any stopped instances are considered unavailable.

        • AvailabilityZone (string) --

          The Availability Zone of 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 IP address.

        • 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.

ResetNetworkInterfaceAttribute (new) Link ¶

Resets a network interface attribute. You can specify only one attribute at a time.

Request Syntax

client.reset_network_interface_attribute(
    DryRun=True|False,
    NetworkInterfaceId='string',
    SourceDestCheck='string'
)
type DryRun:

boolean

param DryRun:

type NetworkInterfaceId:

string

param NetworkInterfaceId:

[REQUIRED]

The ID of the network interface.

type SourceDestCheck:

string

param SourceDestCheck:

The source/destination checking attribute. Resets the value to true.

returns:

None

DeleteVpnConnection (new) Link ¶

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.

Request Syntax

client.delete_vpn_connection(
    DryRun=True|False,
    VpnConnectionId='string'
)
type DryRun:

boolean

param DryRun:

type VpnConnectionId:

string

param VpnConnectionId:

[REQUIRED]

The ID of the VPN connection.

returns:

None

GetConsoleOutput (new) Link ¶

Gets the console output for the specified instance.

Instances do not have a physical monitor through which you can view their console output. They also lack physical controls that allow you to power up, reboot, or shut them down. To allow these actions, we provide them through the Amazon EC2 API and command line interface.

Instance console output is buffered and posted shortly after instance boot, reboot, and termination. Amazon EC2 preserves the most recent 64 KB output which is available for at least one hour after the most recent post.

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. This output is buffered because the instance produces it and then posts it to a store where the instance's owner can retrieve it.

For Windows instances, the instance console output includes output from the EC2Config service.

Request Syntax

client.get_console_output(
    DryRun=True|False,
    InstanceId='string'
)
type DryRun:

boolean

param DryRun:

type InstanceId:

string

param InstanceId:

[REQUIRED]

The ID of the instance.

rtype:

dict

returns:

Response Syntax

{
    'InstanceId': 'string',
    'Timestamp': datetime(2015, 1, 1),
    'Output': 'string'
}

Response Structure

  • (dict) --

    • InstanceId (string) --

      The ID of the instance.

    • Timestamp (datetime) --

      The time the output was last updated.

    • Output (string) --

      The console output, Base64 encoded.

CreateNetworkInterface (new) Link ¶

Creates a network interface in the specified subnet.

For more information about network interfaces, see Elastic Network Interfaces in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.create_network_interface(
    SubnetId='string',
    Description='string',
    PrivateIpAddress='string',
    Groups=[
        'string',
    ],
    PrivateIpAddresses=[
        {
            'PrivateIpAddress': 'string',
            'Primary': True|False
        },
    ],
    SecondaryPrivateIpAddressCount=123,
    DryRun=True|False
)
type SubnetId:

string

param SubnetId:

[REQUIRED]

The ID of the subnet to associate with the network interface.

type Description:

string

param Description:

A description for the network interface.

type PrivateIpAddress:

string

param PrivateIpAddress:

The primary private IP address of the network interface. If you don't specify an IP address, Amazon EC2 selects one for you from the subnet range. If you specify an IP address, you cannot indicate any IP addresses specified in privateIpAddresses as primary (only one IP address can be designated as primary).

type Groups:

list

param Groups:

The IDs of one or more security groups.

  • (string) --

type PrivateIpAddresses:

list

param PrivateIpAddresses:

One or more private IP addresses.

  • (dict) --

    Describes a secondary private IP address for a network interface.

    • PrivateIpAddress (string) -- [REQUIRED]

      The private IP addresses.

    • Primary (boolean) --

      Indicates whether the private IP address is the primary private IP address. Only one IP address can be designated as primary.

type SecondaryPrivateIpAddressCount:

integer

param SecondaryPrivateIpAddressCount:

The number of secondary private IP addresses to assign to a network interface. When you specify a number of secondary IP addresses, Amazon EC2 selects these IP addresses within the subnet 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 Private IP Addresses Per ENI Per Instance Type in the Amazon Elastic Compute Cloud User Guide for Linux.

type DryRun:

boolean

param DryRun:

rtype:

dict

returns:

Response Syntax

{
    'NetworkInterface': {
        'NetworkInterfaceId': 'string',
        'SubnetId': 'string',
        'VpcId': 'string',
        'AvailabilityZone': 'string',
        'Description': 'string',
        'OwnerId': 'string',
        'RequesterId': 'string',
        'RequesterManaged': True|False,
        'Status': 'available'|'attaching'|'in-use'|'detaching',
        'MacAddress': 'string',
        'PrivateIpAddress': 'string',
        'PrivateDnsName': 'string',
        'SourceDestCheck': True|False,
        'Groups': [
            {
                'GroupName': 'string',
                'GroupId': 'string'
            },
        ],
        'Attachment': {
            'AttachmentId': 'string',
            'InstanceId': 'string',
            'InstanceOwnerId': 'string',
            'DeviceIndex': 123,
            'Status': 'attaching'|'attached'|'detaching'|'detached',
            'AttachTime': datetime(2015, 1, 1),
            'DeleteOnTermination': True|False
        },
        'Association': {
            'PublicIp': 'string',
            'PublicDnsName': 'string',
            'IpOwnerId': 'string',
            'AllocationId': 'string',
            'AssociationId': 'string'
        },
        'TagSet': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'PrivateIpAddresses': [
            {
                'PrivateIpAddress': 'string',
                'PrivateDnsName': 'string',
                'Primary': True|False,
                'Association': {
                    'PublicIp': 'string',
                    'PublicDnsName': 'string',
                    'IpOwnerId': 'string',
                    'AllocationId': 'string',
                    'AssociationId': 'string'
                }
            },
        ]
    }
}

Response Structure

  • (dict) --

    • NetworkInterface (dict) --

      Information about the network interface.

      • NetworkInterfaceId (string) --

        The ID of the network interface.

      • SubnetId (string) --

        The ID of the subnet.

      • VpcId (string) --

        The ID of the VPC.

      • AvailabilityZone (string) --

        The Availability Zone.

      • Description (string) --

        A description.

      • OwnerId (string) --

        The AWS account ID of the owner of the network interface.

      • 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.

      • Status (string) --

        The status of the network interface.

      • MacAddress (string) --

        The MAC address.

      • PrivateIpAddress (string) --

        The IP address of the network interface within the subnet.

      • PrivateDnsName (string) --

        The private DNS name.

      • SourceDestCheck (boolean) --

        Indicates whether traffic to or from the instance is validated.

      • 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.

      • Attachment (dict) --

        The network interface attachment.

        • AttachmentId (string) --

          The ID of the network interface attachment.

        • InstanceId (string) --

          The ID of the instance.

        • InstanceOwnerId (string) --

          The AWS account ID of the owner of the instance.

        • DeviceIndex (integer) --

          The device index of the network interface attachment on the instance.

        • Status (string) --

          The attachment state.

        • AttachTime (datetime) --

          The timestamp indicating when the attachment initiated.

        • DeleteOnTermination (boolean) --

          Indicates whether the network interface is deleted when the instance is terminated.

      • Association (dict) --

        The association information for an Elastic IP associated with the network interface.

        • PublicIp (string) --

          The address of the Elastic IP address bound to the network interface.

        • PublicDnsName (string) --

          The public DNS name.

        • IpOwnerId (string) --

          The ID of the Elastic IP address owner.

        • AllocationId (string) --

          The allocation ID.

        • AssociationId (string) --

          The association ID.

      • 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.

      • PrivateIpAddresses (list) --

        The private IP addresses associated with the network interface.

        • (dict) --

          Describes the private IP address of a network interface.

          • PrivateIpAddress (string) --

            The private IP address.

          • PrivateDnsName (string) --

            The private DNS name.

          • Primary (boolean) --

            Indicates whether this IP address is the primary private IP address of the network interface.

          • Association (dict) --

            The association information for an Elastic IP address associated with the network interface.

            • PublicIp (string) --

              The address of the Elastic IP address bound to the network interface.

            • PublicDnsName (string) --

              The public DNS name.

            • IpOwnerId (string) --

              The ID of the Elastic IP address owner.

            • AllocationId (string) --

              The allocation ID.

            • AssociationId (string) --

              The association ID.

CreateSnapshot (new) Link ¶

Creates a snapshot of an Amazon EBS volume and stores it in Amazon S3. You can use snapshots for backups, to make copies of Amazon 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 Amazon 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 Amazon 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.

For more information, see Amazon Elastic Block Store and Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.create_snapshot(
    DryRun=True|False,
    VolumeId='string',
    Description='string'
)
type DryRun:

boolean

param DryRun:

type VolumeId:

string

param VolumeId:

[REQUIRED]

The ID of the Amazon EBS volume.

type Description:

string

param Description:

A description for the snapshot.

rtype:

dict

returns:

Response Syntax

{
    'SnapshotId': 'string',
    'VolumeId': 'string',
    'State': 'pending'|'completed'|'error',
    'StartTime': datetime(2015, 1, 1),
    'Progress': 'string',
    'OwnerId': 'string',
    'Description': 'string',
    'VolumeSize': 123,
    'OwnerAlias': 'string',
    'Tags': [
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    'Encrypted': True|False,
    'KmsKeyId': 'string'
}

Response Structure

  • (dict) --

    Describes a snapshot.

    • SnapshotId (string) --

      The ID of the snapshot.

    • VolumeId (string) --

      The ID of the volume.

    • State (string) --

      The snapshot state.

    • StartTime (datetime) --

      The time stamp when the snapshot was initiated.

    • Progress (string) --

      The progress of the snapshot, as a percentage.

    • OwnerId (string) --

      The AWS account ID of the Amazon EBS snapshot owner.

    • Description (string) --

      The description for the snapshot.

    • VolumeSize (integer) --

      The size of the volume, in GiB.

    • OwnerAlias (string) --

      The AWS account alias (for example, amazon, self) or AWS account ID that owns the snapshot.

    • 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.

    • Encrypted (boolean) --

      Indicates whether the snapshot is encrypted.

    • KmsKeyId (string) --

      The full ARN of the AWS Key Management Service (KMS) master key that was used to protect the volume encryption key for the parent volume.

ImportSnapshot (new) Link ¶

Import a disk into an Amazon Elastic Block Store (Amazon EBS) snapshot.

Request Syntax

client.import_snapshot(
    DryRun=True|False,
    Description='string',
    DiskContainer={
        'Description': 'string',
        'Format': 'string',
        'Url': 'string',
        'UserBucket': {
            'S3Bucket': 'string',
            'S3Key': 'string'
        }
    },
    ClientData={
        'UploadStart': datetime(2015, 1, 1),
        'UploadEnd': datetime(2015, 1, 1),
        'UploadSize': 123.0,
        'Comment': 'string'
    },
    ClientToken='string',
    RoleName='string'
)
type DryRun:

boolean

param DryRun:

type Description:

string

param Description:

The description string for the ImportSnapshot task.

type DiskContainer:

dict

param DiskContainer:

The disk container object for the ImportSnapshot request.

  • Description (string) --

    The description of the disk image being imported.

  • Format (string) --

    The format of the disk image being imported.

  • Url (string) --

    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://..).

  • UserBucket (dict) --

    User's Amazon S3 bucket details used to access the image.

    • S3Bucket (string) --

      The Amazon S3 bucket name where the disk image is located.

    • S3Key (string) --

      The Amazon S3 Key for the disk image.

type ClientData:

dict

param ClientData:

Client-specific data.

  • UploadStart (datetime) --

    The time that the disk upload starts.

  • UploadEnd (datetime) --

    The time that the disk upload ends.

  • UploadSize (float) --

    The size of the uploaded disk image.

  • Comment (string) --

    User-defined comment about the upload.

type ClientToken:

string

param ClientToken:

Token to enable idempotency for VM import requests (optional).

type RoleName:

string

param RoleName:

The name of the role to use when not using the default role name 'vmimport' (optional).

rtype:

dict

returns:

Response Syntax

{
    'ImportTaskId': 'string',
    'SnapshotTaskDetail': {
        'DiskImageSize': 123.0,
        'Description': 'string',
        'Format': 'string',
        'Url': 'string',
        'UserBucket': {
            'S3Bucket': 'string',
            'S3Key': 'string'
        },
        'SnapshotId': 'string',
        'Progress': 'string',
        'StatusMessage': 'string',
        'Status': 'string'
    },
    'Description': 'string'
}

Response Structure

  • (dict) --

    • ImportTaskId (string) --

      Task ID of the ImportSnapshot task.

    • SnapshotTaskDetail (dict) --

      Details about the import snapshot task.

      • DiskImageSize (float) --

        The size of the disk in the snapshot.

      • Description (string) --

        The description of the snapshot.

      • Format (string) --

        The format of the disk image from which the snapshot is created.

      • Url (string) --

        The URL of the disk image from which the snapshot is created.

      • UserBucket (dict) --

        User's Amazon S3 bucket details used to access the image.

        • S3Bucket (string) --

          The Amazon S3 bucket from which the disk image was created.

        • S3Key (string) --

          The Amazon S3 key from which the disk image was created.

      • SnapshotId (string) --

        The snapshot ID of the disk being imported.

      • Progress (string) --

        The percentage of completion for the ImportSnapshot task.

      • StatusMessage (string) --

        A detailed status message for the ImportSnapshot task.

      • Status (string) --

        A brief status for the ImportSnapshot task.

    • Description (string) --

      Description of the import snapshot task.

ModifyInstanceAttribute (new) Link ¶

Modifies the specified attribute of the specified instance. You can specify only one attribute at a time.

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 for Linux.

Request Syntax

client.modify_instance_attribute(
    DryRun=True|False,
    InstanceId='string',
    Attribute='instanceType'|'kernel'|'ramdisk'|'userData'|'disableApiTermination'|'instanceInitiatedShutdownBehavior'|'rootDeviceName'|'blockDeviceMapping'|'productCodes'|'sourceDestCheck'|'groupSet'|'ebsOptimized'|'sriovNetSupport',
    Value='string',
    BlockDeviceMappings=[
        {
            'DeviceName': 'string',
            'Ebs': {
                'VolumeId': 'string',
                'DeleteOnTermination': True|False
            },
            'VirtualName': 'string',
            'NoDevice': 'string'
        },
    ],
    SourceDestCheck={
        'Value': True|False
    },
    DisableApiTermination={
        'Value': True|False
    },
    InstanceType={
        'Value': 'string'
    },
    Kernel={
        'Value': 'string'
    },
    Ramdisk={
        'Value': 'string'
    },
    UserData={
        'Value': b'bytes'
    },
    InstanceInitiatedShutdownBehavior={
        'Value': 'string'
    },
    Groups=[
        'string',
    ],
    EbsOptimized={
        'Value': True|False
    },
    SriovNetSupport={
        'Value': 'string'
    }
)
type DryRun:

boolean

param DryRun:

type InstanceId:

string

param InstanceId:

[REQUIRED]

The ID of the instance.

type Attribute:

string

param Attribute:

The name of the attribute.

type Value:

string

param Value:

A new value for the attribute. Use only with the kernel, ramdisk, userData, disableApiTermination, or intanceInitiateShutdownBehavior attribute.

type BlockDeviceMappings:

list

param BlockDeviceMappings:

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 for Linux.

  • (dict) --

    Describes a block device mapping entry.

    • DeviceName (string) --

      The device name exposed to the instance (for example, /dev/sdh or xvdh).

    • Ebs (dict) --

      Parameters used to automatically set up Amazon EBS volumes when the instance is launched.

      • VolumeId (string) --

        The ID of the Amazon EBS volume.

      • DeleteOnTermination (boolean) --

        Indicates whether the volume is deleted on instance termination.

    • VirtualName (string) --

      The virtual device name.

    • NoDevice (string) --

      suppress the specified device included in the block device mapping.

type SourceDestCheck:

dict

param SourceDestCheck:

Specifies whether source/destination checking is enabled. A value of true means that checking is enabled, and false means checking is disabled. This value must be false for a NAT instance to perform NAT.

  • Value (boolean) --

    Valid values are true or false.

type DisableApiTermination:

dict

param DisableApiTermination:

If the value is true, you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can.

  • Value (boolean) --

    Valid values are true or false.

type InstanceType:

dict

param InstanceType:

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.

  • Value (string) --

    Valid values are case-sensitive and vary by action.

type Kernel:

dict

param Kernel:

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.

  • Value (string) --

    Valid values are case-sensitive and vary by action.

type Ramdisk:

dict

param Ramdisk:

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.

  • Value (string) --

    Valid values are case-sensitive and vary by action.

type UserData:

dict

param UserData:

Changes the instance's user data to the specified value.

  • Value (bytes) --

type InstanceInitiatedShutdownBehavior:

dict

param InstanceInitiatedShutdownBehavior:

Specifies whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

  • Value (string) --

    Valid values are case-sensitive and vary by action.

type Groups:

list

param Groups:

[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.

  • (string) --

type EbsOptimized:

dict

param EbsOptimized:

Specifies 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.

  • Value (boolean) --

    Valid values are true or false.

type SriovNetSupport:

dict

param SriovNetSupport:

Set to simple to enable enhanced networking for the instance.

There is no way to disable enhanced networking at this time.

This option is supported only for HVM instances. Specifying this option with a PV instance can make it unreachable.

  • Value (string) --

    Valid values are case-sensitive and vary by action.

returns:

None

GetPasswordData (new) Link ¶

Retrieves the encrypted administrator password for an instance running Windows.

The Windows password is generated at boot if the EC2Config service plugin, Ec2SetPassword, is enabled. This usually only happens the first time an AMI is launched, and then Ec2SetPassword is automatically disabled. 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.

Password generation and encryption takes a few moments. We recommend that you wait up to 15 minutes after launching an instance before trying to retrieve the generated password.

Request Syntax

client.get_password_data(
    DryRun=True|False,
    InstanceId='string'
)
type DryRun:

boolean

param DryRun:

type InstanceId:

string

param InstanceId:

[REQUIRED]

The ID of the Windows instance.

rtype:

dict

returns:

Response Syntax

{
    'InstanceId': 'string',
    'Timestamp': datetime(2015, 1, 1),
    'PasswordData': 'string'
}

Response Structure

  • (dict) --

    • InstanceId (string) --

      The ID of the Windows instance.

    • Timestamp (datetime) --

      The time the data was last updated.

    • PasswordData (string) --

      The password of the instance.

CreateTags (new) Link ¶

Adds or overwrites one or more tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 10 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 Linux.

Request Syntax

client.create_tags(
    DryRun=True|False,
    Resources=[
        'string',
    ],
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type DryRun:

boolean

param DryRun:

type Resources:

list

param Resources:

[REQUIRED]

The IDs of one or more resources to tag. For example, ami-1a2b3c4d.

  • (string) --

type Tags:

list

param Tags:

[REQUIRED]

One or more 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.

  • (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.

returns:

None

DeleteNetworkAclEntry (new) Link ¶

Deletes the specified ingress or egress entry (rule) from the specified network ACL.

Request Syntax

client.delete_network_acl_entry(
    DryRun=True|False,
    NetworkAclId='string',
    RuleNumber=123,
    Egress=True|False
)
type DryRun:

boolean

param DryRun:

type NetworkAclId:

string

param NetworkAclId:

[REQUIRED]

The ID of the network ACL.

type RuleNumber:

integer

param RuleNumber:

[REQUIRED]

The rule number of the entry to delete.

type Egress:

boolean

param Egress:

[REQUIRED]

Indicates whether the rule is an egress rule.

returns:

None

ReplaceRouteTableAssociation (new) Link ¶

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.

Request Syntax

client.replace_route_table_association(
    DryRun=True|False,
    AssociationId='string',
    RouteTableId='string'
)
type DryRun:

boolean

param DryRun:

type AssociationId:

string

param AssociationId:

[REQUIRED]

The association ID.

type RouteTableId:

string

param RouteTableId:

[REQUIRED]

The ID of the new route table to associate with the subnet.

rtype:

dict

returns:

Response Syntax

{
    'NewAssociationId': 'string'
}

Response Structure

  • (dict) --

    • NewAssociationId (string) --

      The ID of the new association.

UnmonitorInstances (new) Link ¶

Disables monitoring for a running instance. For more information about monitoring instances, see Monitoring Your Instances and Volumes in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.unmonitor_instances(
    DryRun=True|False,
    InstanceIds=[
        'string',
    ]
)
type DryRun:

boolean

param DryRun:

type InstanceIds:

list

param InstanceIds:

[REQUIRED]

One or more instance IDs.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'InstanceMonitorings': [
        {
            'InstanceId': 'string',
            'Monitoring': {
                'State': 'disabled'|'disabling'|'enabled'|'pending'
            }
        },
    ]
}

Response Structure

  • (dict) --

    • InstanceMonitorings (list) --

      Monitoring information for one or more instances.

      • (dict) --

        Describes the monitoring information of the instance.

        • InstanceId (string) --

          The ID of the instance.

        • Monitoring (dict) --

          The monitoring information.

          • State (string) --

            Indicates whether monitoring is enabled for the instance.

UnassignPrivateIpAddresses (new) Link ¶

Unassigns one or more secondary private IP addresses from a network interface.

Request Syntax

client.unassign_private_ip_addresses(
    NetworkInterfaceId='string',
    PrivateIpAddresses=[
        'string',
    ]
)
type NetworkInterfaceId:

string

param NetworkInterfaceId:

[REQUIRED]

The ID of the network interface.

type PrivateIpAddresses:

list

param PrivateIpAddresses:

[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.

  • (string) --

returns:

None

AttachVolume (new) Link ¶

Attaches an Amazon EBS volume to a running or stopped instance and exposes it to the instance with the specified device name.

Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide for Linux.

For a list of supported device names, see Attaching an Amazon EBS Volume to an Instance. Any device names that aren't reserved for instance store volumes can be used for Amazon EBS volumes. For more information, see Amazon EC2 Instance Store in the Amazon Elastic Compute Cloud User Guide for Linux.

If a volume has an AWS Marketplace product code:

  • The volume can be attached only to a stopped instance.

  • AWS Marketplace product codes are copied from the volume to the instance.

  • You must be subscribed to the product.

  • The instance type and operating system of the instance must support the product. For example, you can't detach a volume from a Windows instance and attach it to a Linux instance.

For an overview of the AWS Marketplace, see Introducing AWS Marketplace.

For more information about Amazon EBS volumes, see Attaching Amazon EBS Volumes in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.attach_volume(
    DryRun=True|False,
    VolumeId='string',
    InstanceId='string',
    Device='string'
)
type DryRun:

boolean

param DryRun:

type VolumeId:

string

param VolumeId:

[REQUIRED]

The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone.

type InstanceId:

string

param InstanceId:

[REQUIRED]

The ID of the instance.

type Device:

string

param Device:

[REQUIRED]

The device name to expose to the instance (for example, /dev/sdh or xvdh).

rtype:

dict

returns:

Response Syntax

{
    'VolumeId': 'string',
    'InstanceId': 'string',
    'Device': 'string',
    'State': 'attaching'|'attached'|'detaching'|'detached',
    'AttachTime': datetime(2015, 1, 1),
    'DeleteOnTermination': True|False
}

Response Structure

  • (dict) --

    Describes volume attachment details.

    • VolumeId (string) --

      The ID of the volume.

    • InstanceId (string) --

      The ID of the instance.

    • Device (string) --

      The device name.

    • State (string) --

      The attachment state of the volume.

    • AttachTime (datetime) --

      The time stamp when the attachment initiated.

    • DeleteOnTermination (boolean) --

      Indicates whether the Amazon EBS volume is deleted on instance termination.

ImportVolume (new) Link ¶

Creates an import volume task using metadata from the specified disk image. After importing the image, you then upload it using the ec2-import-volume command in the Amazon EC2 command-line interface (CLI) tools. For more information, see Using the Command Line Tools to Import Your Virtual Machine to Amazon EC2 in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.import_volume(
    DryRun=True|False,
    AvailabilityZone='string',
    Image={
        'Format': 'VMDK'|'RAW'|'VHD',
        'Bytes': 123,
        'ImportManifestUrl': 'string'
    },
    Description='string',
    Volume={
        'Size': 123
    }
)
type DryRun:

boolean

param DryRun:

type AvailabilityZone:

string

param AvailabilityZone:

[REQUIRED]

The Availability Zone for the resulting Amazon EBS volume.

type Image:

dict

param Image:

[REQUIRED]

  • Format (string) -- [REQUIRED]

    The disk image format.

  • Bytes (integer) -- [REQUIRED]

  • ImportManifestUrl (string) -- [REQUIRED]

    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.

type Description:

string

param Description:

An optional description for the volume being imported.

type Volume:

dict

param Volume:

[REQUIRED]

Describes an Amazon EBS volume.

  • Size (integer) -- [REQUIRED]

    The size of the volume, in GiB.

rtype:

dict

returns:

Response Syntax

{
    'ConversionTask': {
        'ConversionTaskId': 'string',
        'ExpirationTime': 'string',
        'ImportInstance': {
            'Volumes': [
                {
                    'BytesConverted': 123,
                    'AvailabilityZone': 'string',
                    'Image': {
                        'Format': 'VMDK'|'RAW'|'VHD',
                        'Size': 123,
                        'ImportManifestUrl': 'string',
                        'Checksum': 'string'
                    },
                    'Volume': {
                        'Size': 123,
                        'Id': 'string'
                    },
                    'Status': 'string',
                    'StatusMessage': 'string',
                    'Description': 'string'
                },
            ],
            'InstanceId': 'string',
            'Platform': 'Windows',
            'Description': 'string'
        },
        'ImportVolume': {
            'BytesConverted': 123,
            'AvailabilityZone': 'string',
            'Description': 'string',
            'Image': {
                'Format': 'VMDK'|'RAW'|'VHD',
                'Size': 123,
                'ImportManifestUrl': 'string',
                'Checksum': 'string'
            },
            'Volume': {
                'Size': 123,
                'Id': 'string'
            }
        },
        'State': 'active'|'cancelling'|'cancelled'|'completed',
        'StatusMessage': 'string',
        'Tags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • ConversionTask (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.

        • Volumes (list) --

          • (dict) --

            Describes an import volume task.

            • BytesConverted (integer) --

              The number of bytes converted so far.

            • AvailabilityZone (string) --

              The Availability Zone where the resulting instance will reside.

            • Image (dict) --

              The image.

              • Format (string) --

                The disk image format.

              • Size (integer) --

                The size of the disk image.

              • 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.

              • Checksum (string) --

                The checksum computed for the disk image.

            • Volume (dict) --

              The volume.

              • Size (integer) --

                The size of the volume.

              • Id (string) --

                The volume identifier.

            • Status (string) --

              The status of the import of this particular disk image.

            • StatusMessage (string) --

              The status information or errors related to the disk image.

            • Description (string) --

        • InstanceId (string) --

        • Platform (string) --

          The instance operating system.

        • Description (string) --

      • ImportVolume (dict) --

        If the task is for importing a volume, this contains information about the import volume task.

        • BytesConverted (integer) --

          The number of bytes converted so far.

        • AvailabilityZone (string) --

          The Availability Zone where the resulting volume will reside.

        • Description (string) --

          The description you provided when starting the import volume task.

        • Image (dict) --

          The image.

          • Format (string) --

            The disk image format.

          • Size (integer) --

            The size of the disk image.

          • 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.

          • Checksum (string) --

            The checksum computed for the disk image.

        • Volume (dict) --

          The volume.

          • Size (integer) --

            The size of the volume.

          • Id (string) --

            The volume identifier.

      • State (string) --

        The state of the conversion task.

      • StatusMessage (string) --

        The status message related to the conversion task.

      • Tags (list) --

        • (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.

CreateCustomerGateway (new) Link ¶

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 can't 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).

For more information about VPN customer gateways, see Adding a Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.create_customer_gateway(
    DryRun=True|False,
    Type='ipsec.1',
    PublicIp='string',
    BgpAsn=123
)
type DryRun:

boolean

param DryRun:

type Type:

string

param Type:

[REQUIRED]

The type of VPN connection that this customer gateway supports ( ipsec.1).

type PublicIp:

string

param PublicIp:

[REQUIRED]

The Internet-routable IP address for the customer gateway's outside interface. The address must be static.

type BgpAsn:

integer

param BgpAsn:

[REQUIRED]

For devices that support BGP, the customer gateway's BGP ASN.

Default: 65000

rtype:

dict

returns:

Response Syntax

{
    'CustomerGateway': {
        'CustomerGatewayId': 'string',
        'State': 'string',
        'Type': 'string',
        'IpAddress': 'string',
        'BgpAsn': 'string',
        'Tags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • CustomerGateway (dict) --

      Information about the customer gateway.

      • CustomerGatewayId (string) --

        The ID of the customer gateway.

      • 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).

      • IpAddress (string) --

        The Internet-routable IP address of the customer gateway's outside interface.

      • BgpAsn (string) --

        The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).

      • 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.

DetachClassicLinkVpc (new) Link ¶

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.

Request Syntax

client.detach_classic_link_vpc(
    DryRun=True|False,
    InstanceId='string',
    VpcId='string'
)
type DryRun:

boolean

param DryRun:

type InstanceId:

string

param InstanceId:

[REQUIRED]

The ID of the instance to unlink from the VPC.

type VpcId:

string

param VpcId:

[REQUIRED]

The ID of the VPC to which the instance is linked.

rtype:

dict

returns:

Response Syntax

{
    'Return': True|False
}

Response Structure

  • (dict) --

    • Return (boolean) --

      Returns true if the request succeeds; otherwise, it returns an error.

CancelExportTask (new) Link ¶

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.

Request Syntax

client.cancel_export_task(
    ExportTaskId='string'
)
type ExportTaskId:

string

param ExportTaskId:

[REQUIRED]

The ID of the export task. This is the ID returned by CreateInstanceExportTask.

returns:

None

DeleteDhcpOptions (new) Link ¶

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.

Request Syntax

client.delete_dhcp_options(
    DryRun=True|False,
    DhcpOptionsId='string'
)
type DryRun:

boolean

param DryRun:

type DhcpOptionsId:

string

param DhcpOptionsId:

[REQUIRED]

The ID of the DHCP options set.

returns:

None

DescribeNetworkAcls (new) Link ¶

Describes one or more of your network ACLs.

For more information about network ACLs, see Network ACLs in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.describe_network_acls(
    DryRun=True|False,
    NetworkAclIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type NetworkAclIds:

list

param NetworkAclIds:

One or more network ACL IDs.

Default: Describes all your network ACLs.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • association.association-id - The ID of an association ID for the ACL.

  • association.network-acl-id - The ID of the network ACL involved in the association.

  • association.subnet-id - The ID of the subnet involved in the association.

  • default - Indicates whether the ACL is the default network ACL for the VPC.

  • entry.cidr - The CIDR range specified in the entry.

  • entry.egress - Indicates whether the entry applies to egress traffic.

  • entry.icmp.code - The ICMP code specified in the entry, if any.

  • entry.icmp.type - The ICMP type specified in the entry, if any.

  • entry.port-range.from - The start of the port range specified in the entry.

  • entry.port-range.to - The end of the port range specified in the entry.

  • entry.protocol - The protocol specified in the entry ( tcp | udp | icmp or a protocol number).

  • entry.rule-action - Allows or denies the matching traffic ( allow | deny).

  • entry.rule-number - The number of an entry (in other words, rule) in the ACL's set of entries.

  • network-acl-id - The ID of the network ACL.

  • tag:key*=*value - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key*=*value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • vpc-id - The ID of the VPC for the network ACL.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'NetworkAcls': [
        {
            'NetworkAclId': 'string',
            'VpcId': 'string',
            'IsDefault': True|False,
            'Entries': [
                {
                    'RuleNumber': 123,
                    'Protocol': 'string',
                    'RuleAction': 'allow'|'deny',
                    'Egress': True|False,
                    'CidrBlock': 'string',
                    'IcmpTypeCode': {
                        'Type': 123,
                        'Code': 123
                    },
                    'PortRange': {
                        'From': 123,
                        'To': 123
                    }
                },
            ],
            'Associations': [
                {
                    'NetworkAclAssociationId': 'string',
                    'NetworkAclId': 'string',
                    'SubnetId': 'string'
                },
            ],
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • NetworkAcls (list) --

      Information about one or more network ACLs.

      • (dict) --

        Describes a network ACL.

        • NetworkAclId (string) --

          The ID of the network ACL.

        • VpcId (string) --

          The ID of the VPC for the network ACL.

        • IsDefault (boolean) --

          Indicates whether this is the default network ACL for the VPC.

        • Entries (list) --

          One or more entries (rules) in the network ACL.

          • (dict) --

            Describes an entry in a network ACL.

            • RuleNumber (integer) --

              The rule number for the entry. ACL entries are processed in ascending order by rule number.

            • Protocol (string) --

              The protocol. A value of -1 means all protocols.

            • RuleAction (string) --

              Indicates whether to allow or deny the traffic that matches the rule.

            • Egress (boolean) --

              Indicates whether the rule is an egress rule (applied to traffic leaving the subnet).

            • CidrBlock (string) --

              The network range to allow or deny, in CIDR notation.

            • IcmpTypeCode (dict) --

              ICMP protocol: The ICMP type and code.

              • Type (integer) --

                The ICMP code. A value of -1 means all codes for the specified ICMP type.

              • Code (integer) --

                The ICMP type. A value of -1 means all types.

            • 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.

        • 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.

        • 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.

AttachVpnGateway (new) Link ¶

Attaches a virtual private gateway to a VPC. For more information, see Adding a Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.attach_vpn_gateway(
    DryRun=True|False,
    VpnGatewayId='string',
    VpcId='string'
)
type DryRun:

boolean

param DryRun:

type VpnGatewayId:

string

param VpnGatewayId:

[REQUIRED]

The ID of the virtual private gateway.

type VpcId:

string

param VpcId:

[REQUIRED]

The ID of the VPC.

rtype:

dict

returns:

Response Syntax

{
    'VpcAttachment': {
        'VpcId': 'string',
        'State': 'attaching'|'attached'|'detaching'|'detached'
    }
}

Response Structure

  • (dict) --

    • VpcAttachment (dict) --

      Information about the attachment.

      • VpcId (string) --

        The ID of the VPC.

      • State (string) --

        The current state of the attachment.

ImportInstance (new) Link ¶

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. After importing the image, you then upload it using the ec2-import-volume command in the EC2 command line tools. For more information, see Using the Command Line Tools to Import Your Virtual Machine to Amazon EC2 in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.import_instance(
    DryRun=True|False,
    Description='string',
    LaunchSpecification={
        'Architecture': 'i386'|'x86_64',
        'GroupNames': [
            'string',
        ],
        'GroupIds': [
            'string',
        ],
        'AdditionalInfo': 'string',
        'UserData': {
            'Data': 'string'
        },
        'InstanceType': 't1.micro'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'t2.micro'|'t2.small'|'t2.medium'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'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'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'cg1.4xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge',
        'Placement': {
            'AvailabilityZone': 'string',
            'GroupName': 'string',
            'Tenancy': 'default'|'dedicated'
        },
        'Monitoring': True|False,
        'SubnetId': 'string',
        'InstanceInitiatedShutdownBehavior': 'stop'|'terminate',
        'PrivateIpAddress': 'string'
    },
    DiskImages=[
        {
            'Image': {
                'Format': 'VMDK'|'RAW'|'VHD',
                'Bytes': 123,
                'ImportManifestUrl': 'string'
            },
            'Description': 'string',
            'Volume': {
                'Size': 123
            }
        },
    ],
    Platform='Windows'
)
type DryRun:

boolean

param DryRun:

type Description:

string

param Description:

A description for the instance being imported.

type LaunchSpecification:

dict

param LaunchSpecification:
  • Architecture (string) --

    The architecture of the instance.

  • GroupNames (list) --

    One or more security group names.

    • (string) --

  • GroupIds (list) --

    One or more security group IDs.

    • (string) --

  • AdditionalInfo (string) --

  • UserData (dict) --

    User data to be made available to the instance.

    • Data (string) --

  • InstanceType (string) --

    The instance type. This is not supported for VMs imported into a VPC, which are assigned the default security group. After a VM is imported into a VPC, you can specify another security group using the AWS Management Console. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide for Linux. For more information about the Linux instance types you can import, see Before You Get Started in the Amazon Elastic Compute Cloud User Guide for Linux.

  • Placement (dict) --

    Describes the placement for the instance.

    • AvailabilityZone (string) --

      The Availability Zone of the instance.

    • GroupName (string) --

      The name of the placement group the instance is in (for cluster compute instances).

    • 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.

  • Monitoring (boolean) --

  • SubnetId (string) --

    [EC2-VPC] The ID of the subnet to launch the instance into.

  • InstanceInitiatedShutdownBehavior (string) --

    Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

  • PrivateIpAddress (string) --

    [EC2-VPC] Optionally, you can use this parameter to assign the instance a specific available IP address from the IP address range of the subnet.

type DiskImages:

list

param DiskImages:
  • (dict) --

    Describes a disk image.

    • Image (dict) --

      • Format (string) -- [REQUIRED]

        The disk image format.

      • Bytes (integer) -- [REQUIRED]

      • ImportManifestUrl (string) -- [REQUIRED]

        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.

    • Description (string) --

    • Volume (dict) --

      Describes an Amazon EBS volume.

      • Size (integer) -- [REQUIRED]

        The size of the volume, in GiB.

type Platform:

string

param Platform:

[REQUIRED]

The instance operating system.

rtype:

dict

returns:

Response Syntax

{
    'ConversionTask': {
        'ConversionTaskId': 'string',
        'ExpirationTime': 'string',
        'ImportInstance': {
            'Volumes': [
                {
                    'BytesConverted': 123,
                    'AvailabilityZone': 'string',
                    'Image': {
                        'Format': 'VMDK'|'RAW'|'VHD',
                        'Size': 123,
                        'ImportManifestUrl': 'string',
                        'Checksum': 'string'
                    },
                    'Volume': {
                        'Size': 123,
                        'Id': 'string'
                    },
                    'Status': 'string',
                    'StatusMessage': 'string',
                    'Description': 'string'
                },
            ],
            'InstanceId': 'string',
            'Platform': 'Windows',
            'Description': 'string'
        },
        'ImportVolume': {
            'BytesConverted': 123,
            'AvailabilityZone': 'string',
            'Description': 'string',
            'Image': {
                'Format': 'VMDK'|'RAW'|'VHD',
                'Size': 123,
                'ImportManifestUrl': 'string',
                'Checksum': 'string'
            },
            'Volume': {
                'Size': 123,
                'Id': 'string'
            }
        },
        'State': 'active'|'cancelling'|'cancelled'|'completed',
        'StatusMessage': 'string',
        'Tags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • ConversionTask (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.

        • Volumes (list) --

          • (dict) --

            Describes an import volume task.

            • BytesConverted (integer) --

              The number of bytes converted so far.

            • AvailabilityZone (string) --

              The Availability Zone where the resulting instance will reside.

            • Image (dict) --

              The image.

              • Format (string) --

                The disk image format.

              • Size (integer) --

                The size of the disk image.

              • 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.

              • Checksum (string) --

                The checksum computed for the disk image.

            • Volume (dict) --

              The volume.

              • Size (integer) --

                The size of the volume.

              • Id (string) --

                The volume identifier.

            • Status (string) --

              The status of the import of this particular disk image.

            • StatusMessage (string) --

              The status information or errors related to the disk image.

            • Description (string) --

        • InstanceId (string) --

        • Platform (string) --

          The instance operating system.

        • Description (string) --

      • ImportVolume (dict) --

        If the task is for importing a volume, this contains information about the import volume task.

        • BytesConverted (integer) --

          The number of bytes converted so far.

        • AvailabilityZone (string) --

          The Availability Zone where the resulting volume will reside.

        • Description (string) --

          The description you provided when starting the import volume task.

        • Image (dict) --

          The image.

          • Format (string) --

            The disk image format.

          • Size (integer) --

            The size of the disk image.

          • 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.

          • Checksum (string) --

            The checksum computed for the disk image.

        • Volume (dict) --

          The volume.

          • Size (integer) --

            The size of the volume.

          • Id (string) --

            The volume identifier.

      • State (string) --

        The state of the conversion task.

      • StatusMessage (string) --

        The status message related to the conversion task.

      • Tags (list) --

        • (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.

DeleteSnapshot (new) Link ¶

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 Amazon 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 for Linux.

Request Syntax

client.delete_snapshot(
    DryRun=True|False,
    SnapshotId='string'
)
type DryRun:

boolean

param DryRun:

type SnapshotId:

string

param SnapshotId:

[REQUIRED]

The ID of the Amazon EBS snapshot.

returns:

None

ReplaceNetworkAclEntry (new) Link ¶

Replaces an entry (rule) in a network ACL. For more information about network ACLs, see Network ACLs in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.replace_network_acl_entry(
    DryRun=True|False,
    NetworkAclId='string',
    RuleNumber=123,
    Protocol='string',
    RuleAction='allow'|'deny',
    Egress=True|False,
    CidrBlock='string',
    IcmpTypeCode={
        'Type': 123,
        'Code': 123
    },
    PortRange={
        'From': 123,
        'To': 123
    }
)
type DryRun:

boolean

param DryRun:

type NetworkAclId:

string

param NetworkAclId:

[REQUIRED]

The ID of the ACL.

type RuleNumber:

integer

param RuleNumber:

[REQUIRED]

The rule number of the entry to replace.

type Protocol:

string

param Protocol:

[REQUIRED]

The IP protocol. You can specify all or -1 to mean all protocols.

type RuleAction:

string

param RuleAction:

[REQUIRED]

Indicates whether to allow or deny the traffic that matches the rule.

type Egress:

boolean

param Egress:

[REQUIRED]

Indicates whether to replace the egress rule.

Default: If no value is specified, we replace the ingress rule.

type CidrBlock:

string

param CidrBlock:

[REQUIRED]

The network range to allow or deny, in CIDR notation.

type IcmpTypeCode:

dict

param IcmpTypeCode:

ICMP protocol: The ICMP type and code. Required if specifying 1 (ICMP) for the protocol.

  • Type (integer) --

    The ICMP code. A value of -1 means all codes for the specified ICMP type.

  • Code (integer) --

    The ICMP type. A value of -1 means all types.

type PortRange:

dict

param PortRange:

TCP or UDP protocols: The range of ports the rule applies to. Required if specifying 6 (TCP) or 17 (UDP) for the protocol.

  • From (integer) --

    The first port in the range.

  • To (integer) --

    The last port in the range.

returns:

None

ModifyNetworkInterfaceAttribute (new) Link ¶

Modifies the specified network interface attribute. You can specify only one attribute at a time.

Request Syntax

client.modify_network_interface_attribute(
    DryRun=True|False,
    NetworkInterfaceId='string',
    Description={
        'Value': 'string'
    },
    SourceDestCheck={
        'Value': True|False
    },
    Groups=[
        'string',
    ],
    Attachment={
        'AttachmentId': 'string',
        'DeleteOnTermination': True|False
    }
)
type DryRun:

boolean

param DryRun:

type NetworkInterfaceId:

string

param NetworkInterfaceId:

[REQUIRED]

The ID of the network interface.

type Description:

dict

param Description:

A description for the network interface.

  • Value (string) --

    Valid values are case-sensitive and vary by action.

type SourceDestCheck:

dict

param SourceDestCheck:

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.

  • Value (boolean) --

    Valid values are true or false.

type Groups:

list

param Groups:

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.

  • (string) --

type Attachment:

dict

param Attachment:

Information about the interface attachment. If modifying the 'delete on termination' attribute, you must specify the ID of the interface attachment.

  • AttachmentId (string) --

    The ID of the network interface attachment.

  • DeleteOnTermination (boolean) --

    Indicates whether the network interface is deleted when the instance is terminated.

returns:

None

CreateVolume (new) Link ¶

Creates an Amazon 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 Amazon EBS snapshot. Any AWS Marketplace product codes from the snapshot are propagated to the volume.

You can create encrypted volumes with the Encrypted parameter. Encrypted volumes may only 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 for Linux.

For more information, see Creating or Restoring an Amazon EBS Volume in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.create_volume(
    DryRun=True|False,
    Size=123,
    SnapshotId='string',
    AvailabilityZone='string',
    VolumeType='standard'|'io1'|'gp2',
    Iops=123,
    Encrypted=True|False,
    KmsKeyId='string'
)
type DryRun:

boolean

param DryRun:

type Size:

integer

param Size:

The size of the volume, in GiBs.

Constraints: 1-1024 for standard volumes, 1-16384 for gp2 volumes, and 4-16384 for io1 volumes. 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.

type SnapshotId:

string

param SnapshotId:

The snapshot from which to create the volume.

type AvailabilityZone:

string

param AvailabilityZone:

[REQUIRED]

The Availability Zone in which to create the volume. Use DescribeAvailabilityZones to list the Availability Zones that are currently available to you.

type VolumeType:

string

param VolumeType:

The volume type. This can be gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes.

Default: standard

type Iops:

integer

param Iops:

Only valid for Provisioned IOPS (SSD) volumes. The number of I/O operations per second (IOPS) to provision for the volume, with a maximum ratio of 30 IOPS/GiB.

Constraint: Range is 100 to 20000 for Provisioned IOPS (SSD) volumes

type Encrypted:

boolean

param Encrypted:

Specifies whether the volume should be encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are automatically encrypted. There is no way to create an encrypted volume from an unencrypted snapshot or vice versa. If your AMI uses encrypted volumes, you can only launch it on supported instance types. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide for Linux.

type KmsKeyId:

string

param KmsKeyId:

The full ARN of the AWS Key Management Service (KMS) master key to use when creating the encrypted volume. This parameter is only required if you want to use a non-default master key; if this parameter is not specified, the default master key is used. The ARN contains the arn:aws:kms namespace, followed by the region of the master key, the AWS account ID of the master key owner, the key namespace, and then the master key ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.

rtype:

dict

returns:

Response Syntax

{
    'VolumeId': 'string',
    'Size': 123,
    'SnapshotId': 'string',
    'AvailabilityZone': 'string',
    'State': 'creating'|'available'|'in-use'|'deleting'|'deleted'|'error',
    'CreateTime': datetime(2015, 1, 1),
    'Attachments': [
        {
            'VolumeId': 'string',
            'InstanceId': 'string',
            'Device': 'string',
            'State': 'attaching'|'attached'|'detaching'|'detached',
            'AttachTime': datetime(2015, 1, 1),
            'DeleteOnTermination': True|False
        },
    ],
    'Tags': [
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    'VolumeType': 'standard'|'io1'|'gp2',
    'Iops': 123,
    'Encrypted': True|False,
    'KmsKeyId': 'string'
}

Response Structure

  • (dict) --

    Describes a volume.

    • VolumeId (string) --

      The ID of the volume.

    • Size (integer) --

      The size of the volume, in GiBs.

    • SnapshotId (string) --

      The snapshot from which the volume was created, if applicable.

    • AvailabilityZone (string) --

      The Availability Zone for the volume.

    • State (string) --

      The volume state.

    • CreateTime (datetime) --

      The time stamp when volume creation was initiated.

    • Attachments (list) --

      • (dict) --

        Describes volume attachment details.

        • VolumeId (string) --

          The ID of the volume.

        • InstanceId (string) --

          The ID of the instance.

        • Device (string) --

          The device name.

        • State (string) --

          The attachment state of the volume.

        • AttachTime (datetime) --

          The time stamp when the attachment initiated.

        • DeleteOnTermination (boolean) --

          Indicates whether the Amazon EBS volume is deleted on instance termination.

    • 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) volumes, io1 for Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes.

    • 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 on General Purpose (SSD) baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide for Linux.

      Constraint: Range is 100 to 20000 for Provisioned IOPS (SSD) volumes and 3 to 10000 for General Purpose (SSD) volumes.

      Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create standard or gp2 volumes.

    • Encrypted (boolean) --

      Indicates whether the volume will be encrypted.

    • KmsKeyId (string) --

      The full ARN of the AWS Key Management Service (KMS) master key that was used to protect the volume encryption key for the volume.

DeleteVpnGateway (new) Link ¶

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.

Request Syntax

client.delete_vpn_gateway(
    DryRun=True|False,
    VpnGatewayId='string'
)
type DryRun:

boolean

param DryRun:

type VpnGatewayId:

string

param VpnGatewayId:

[REQUIRED]

The ID of the virtual private gateway.

returns:

None

ResetInstanceAttribute (new) Link ¶

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.

Request Syntax

client.reset_instance_attribute(
    DryRun=True|False,
    InstanceId='string',
    Attribute='instanceType'|'kernel'|'ramdisk'|'userData'|'disableApiTermination'|'instanceInitiatedShutdownBehavior'|'rootDeviceName'|'blockDeviceMapping'|'productCodes'|'sourceDestCheck'|'groupSet'|'ebsOptimized'|'sriovNetSupport'
)
type DryRun:

boolean

param DryRun:

type InstanceId:

string

param InstanceId:

[REQUIRED]

The ID of the instance.

type Attribute:

string

param Attribute:

[REQUIRED]

The attribute to reset.

returns:

None

DeleteNetworkInterface (new) Link ¶

Deletes the specified network interface. You must detach the network interface before you can delete it.

Request Syntax

client.delete_network_interface(
    DryRun=True|False,
    NetworkInterfaceId='string'
)
type DryRun:

boolean

param DryRun:

type NetworkInterfaceId:

string

param NetworkInterfaceId:

[REQUIRED]

The ID of the network interface.

returns:

None

DescribeInternetGateways (new) Link ¶

Describes one or more of your Internet gateways.

Request Syntax

client.describe_internet_gateways(
    DryRun=True|False,
    InternetGatewayIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type InternetGatewayIds:

list

param InternetGatewayIds:

One or more Internet gateway IDs.

Default: Describes all your Internet gateways.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • attachment.state - The current state of the attachment between the gateway and the VPC ( available). Present only if a VPC is attached.

  • attachment.vpc-id - The ID of an attached VPC.

  • internet-gateway-id - The ID of the Internet gateway.

  • tag:key*=*value - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key*=*value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'InternetGateways': [
        {
            'InternetGatewayId': 'string',
            'Attachments': [
                {
                    'VpcId': 'string',
                    'State': 'attaching'|'attached'|'detaching'|'detached'
                },
            ],
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • InternetGateways (list) --

      Information about one or more Internet gateways.

      • (dict) --

        Describes an Internet gateway.

        • InternetGatewayId (string) --

          The ID of the Internet gateway.

        • Attachments (list) --

          Any VPCs attached to the Internet gateway.

          • (dict) --

            Describes the attachment of a VPC to an Internet gateway.

            • VpcId (string) --

              The ID of the VPC.

            • State (string) --

              The current state of the attachment.

        • 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.

RebootInstances (new) Link ¶

Requests a reboot of one or more 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 a Linux/Unix 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 for Linux.

Request Syntax

client.reboot_instances(
    DryRun=True|False,
    InstanceIds=[
        'string',
    ]
)
type DryRun:

boolean

param DryRun:

type InstanceIds:

list

param InstanceIds:

[REQUIRED]

One or more instance IDs.

  • (string) --

returns:

None

CreateInstanceExportTask (new) Link ¶

Exports a running or stopped instance to an Amazon S3 bucket.

For information about the supported operating systems, image formats, and known limitations for the types of instances you can export, see Exporting EC2 Instances in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.create_instance_export_task(
    Description='string',
    InstanceId='string',
    TargetEnvironment='citrix'|'vmware'|'microsoft',
    ExportToS3Task={
        'DiskImageFormat': 'VMDK'|'RAW'|'VHD',
        'ContainerFormat': 'ova',
        'S3Bucket': 'string',
        'S3Prefix': 'string'
    }
)
type Description:

string

param Description:

A description for the conversion task or the resource being exported. The maximum length is 255 bytes.

type InstanceId:

string

param InstanceId:

[REQUIRED]

The ID of the instance.

type TargetEnvironment:

string

param TargetEnvironment:

The target virtualization environment.

type ExportToS3Task:

dict

param ExportToS3Task:
  • DiskImageFormat (string) --

  • ContainerFormat (string) --

  • S3Bucket (string) --

  • S3Prefix (string) --

    The image is written to a single object in the Amazon S3 bucket at the S3 key s3prefix + exportTaskId + '.' + diskImageFormat.

rtype:

dict

returns:

Response Syntax

{
    'ExportTask': {
        'ExportTaskId': 'string',
        'Description': 'string',
        'State': 'active'|'cancelling'|'cancelled'|'completed',
        'StatusMessage': 'string',
        'InstanceExportDetails': {
            'InstanceId': 'string',
            'TargetEnvironment': 'citrix'|'vmware'|'microsoft'
        },
        'ExportToS3Task': {
            'DiskImageFormat': 'VMDK'|'RAW'|'VHD',
            'ContainerFormat': 'ova',
            'S3Bucket': 'string',
            'S3Key': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • ExportTask (dict) --

      Describes an export task.

      • ExportTaskId (string) --

        The ID of the export task.

      • Description (string) --

        A description of the resource being exported.

      • State (string) --

        The state of the conversion task.

      • StatusMessage (string) --

        The status message related to the export task.

      • InstanceExportDetails (dict) --

        The instance being exported.

        • InstanceId (string) --

          The ID of the resource being exported.

        • TargetEnvironment (string) --

          The target virtualization environment.

      • ExportToS3Task (dict) --

        • DiskImageFormat (string) --

          The format for the exported image.

        • ContainerFormat (string) --

          The container format used to combine disk images with metadata (such as OVF). If absent, only the disk image is exported.

        • S3Bucket (string) --

          The Amazon 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) --

CreateKeyPair (new) Link ¶

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#8 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. To create a key pair that is available in all regions, use ImportKeyPair.

For more information about key pairs, see Key Pairs in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.create_key_pair(
    DryRun=True|False,
    KeyName='string'
)
type DryRun:

boolean

param DryRun:

type KeyName:

string

param KeyName:

[REQUIRED]

A unique name for the key pair.

Constraints: Up to 255 ASCII characters

rtype:

dict

returns:

Response Syntax

{
    'KeyName': 'string',
    'KeyFingerprint': 'string',
    'KeyMaterial': 'string'
}

Response Structure

  • (dict) --

    Information about the key pair.

    • KeyName (string) --

      The name of the key pair.

    • KeyFingerprint (string) --

      The SHA-1 digest of the DER encoded private key.

    • KeyMaterial (string) --

      An unencrypted PEM encoded RSA private key.

DescribeSpotDatafeedSubscription (new) Link ¶

Describes the data feed for Spot Instances. For more information, see Spot Instance Data Feed in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.describe_spot_datafeed_subscription(
    DryRun=True|False
)
type DryRun:

boolean

param DryRun:

rtype:

dict

returns:

Response Syntax

{
    'SpotDatafeedSubscription': {
        'OwnerId': 'string',
        'Bucket': 'string',
        'Prefix': 'string',
        'State': 'Active'|'Inactive',
        'Fault': {
            'Code': 'string',
            'Message': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • SpotDatafeedSubscription (dict) --

      The Spot Instance data feed subscription.

      • OwnerId (string) --

        The AWS account ID of the account.

      • Bucket (string) --

        The Amazon S3 bucket where the Spot Instance data feed is located.

      • Prefix (string) --

        The prefix that is prepended to data feed files.

      • State (string) --

        The state of the Spot Instance data feed subscription.

      • 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.

CreateSubnet (new) Link ¶

Creates a subnet in an existing VPC.

When you create each subnet, you provide the VPC ID and the CIDR block you want for the subnet. After you create a subnet, you can't change its CIDR block. The subnet's CIDR block can be the same as the VPC's CIDR block (assuming you want only a single subnet in the VPC), or a subset of the VPC's CIDR block. If you create more than one subnet in a VPC, the subnets' CIDR blocks must not overlap. The smallest subnet (and VPC) you can create uses a /28 netmask (16 IP addresses), and the largest uses a /16 netmask (65,536 IP addresses).

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.

Request Syntax

client.create_subnet(
    DryRun=True|False,
    VpcId='string',
    CidrBlock='string',
    AvailabilityZone='string'
)
type DryRun:

boolean

param DryRun:

type VpcId:

string

param VpcId:

[REQUIRED]

The ID of the VPC.

type CidrBlock:

string

param CidrBlock:

[REQUIRED]

The network range for the subnet, in CIDR notation. For example, 10.0.0.0/24.

type AvailabilityZone:

string

param AvailabilityZone:

The Availability Zone for the subnet.

Default: Amazon EC2 selects one for you (recommended).

rtype:

dict

returns:

Response Syntax

{
    'Subnet': {
        'SubnetId': 'string',
        'State': 'pending'|'available',
        'VpcId': 'string',
        'CidrBlock': 'string',
        'AvailableIpAddressCount': 123,
        'AvailabilityZone': 'string',
        'DefaultForAz': True|False,
        'MapPublicIpOnLaunch': True|False,
        'Tags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • Subnet (dict) --

      Information about the subnet.

      • SubnetId (string) --

        The ID of the subnet.

      • State (string) --

        The current state of the subnet.

      • VpcId (string) --

        The ID of the VPC the subnet is in.

      • CidrBlock (string) --

        The CIDR block assigned to the subnet.

      • AvailableIpAddressCount (integer) --

        The number of unused IP addresses in the subnet. Note that the IP addresses for any stopped instances are considered unavailable.

      • AvailabilityZone (string) --

        The Availability Zone of 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 IP address.

      • 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.

DescribeInstanceAttribute (new) Link ¶

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

Request Syntax

client.describe_instance_attribute(
    DryRun=True|False,
    InstanceId='string',
    Attribute='instanceType'|'kernel'|'ramdisk'|'userData'|'disableApiTermination'|'instanceInitiatedShutdownBehavior'|'rootDeviceName'|'blockDeviceMapping'|'productCodes'|'sourceDestCheck'|'groupSet'|'ebsOptimized'|'sriovNetSupport'
)
type DryRun:

boolean

param DryRun:

type InstanceId:

string

param InstanceId:

[REQUIRED]

The ID of the instance.

type Attribute:

string

param Attribute:

[REQUIRED]

The instance attribute.

rtype:

dict

returns:

Response Syntax

{
    'InstanceId': 'string',
    'InstanceType': {
        'Value': 'string'
    },
    'KernelId': {
        'Value': 'string'
    },
    'RamdiskId': {
        'Value': 'string'
    },
    'UserData': {
        'Value': 'string'
    },
    'DisableApiTermination': {
        'Value': True|False
    },
    'InstanceInitiatedShutdownBehavior': {
        'Value': 'string'
    },
    'RootDeviceName': {
        'Value': 'string'
    },
    'BlockDeviceMappings': [
        {
            'DeviceName': 'string',
            'Ebs': {
                'VolumeId': 'string',
                'Status': 'attaching'|'attached'|'detaching'|'detached',
                'AttachTime': datetime(2015, 1, 1),
                'DeleteOnTermination': True|False
            }
        },
    ],
    'ProductCodes': [
        {
            'ProductCodeId': 'string',
            'ProductCodeType': 'devpay'|'marketplace'
        },
    ],
    'EbsOptimized': {
        'Value': True|False
    },
    'SriovNetSupport': {
        'Value': 'string'
    },
    'SourceDestCheck': {
        'Value': True|False
    },
    'Groups': [
        {
            'GroupName': 'string',
            'GroupId': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Describes an instance attribute.

    • InstanceId (string) --

      The ID of the instance.

    • InstanceType (dict) --

      The instance type.

      • Value (string) --

        Valid values are case-sensitive and vary by action.

    • KernelId (dict) --

      The kernel ID.

      • Value (string) --

        Valid values are case-sensitive and vary by action.

    • RamdiskId (dict) --

      The RAM disk ID.

      • Value (string) --

        Valid values are case-sensitive and vary by action.

    • UserData (dict) --

      The Base64-encoded MIME user data.

      • Value (string) --

        Valid values are case-sensitive and vary by action.

    • 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) --

        Valid values are true or false.

    • 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) --

        Valid values are case-sensitive and vary by action.

    • RootDeviceName (dict) --

      The name of the root device (for example, /dev/sda1 or /dev/xvda).

      • Value (string) --

        Valid values are case-sensitive and vary by action.

    • BlockDeviceMappings (list) --

      The block device mapping of the instance.

      • (dict) --

        Describes a block device mapping.

        • DeviceName (string) --

          The device name exposed to the instance (for example, /dev/sdh or xvdh).

        • Ebs (dict) --

          Parameters used to automatically set up Amazon EBS volumes when the instance is launched.

          • VolumeId (string) --

            The ID of the Amazon EBS volume.

          • Status (string) --

            The attachment state.

          • AttachTime (datetime) --

            The time stamp when the attachment initiated.

          • DeleteOnTermination (boolean) --

            Indicates whether the volume is deleted on instance termination.

    • ProductCodes (list) --

      A list of product codes.

      • (dict) --

        Describes a product code.

        • ProductCodeId (string) --

          The product code.

        • ProductCodeType (string) --

          The type of product code.

    • EbsOptimized (dict) --

      Indicates whether the instance is optimized for EBS I/O.

      • Value (boolean) --

        Valid values are true or false.

    • SriovNetSupport (dict) --

      The value to use for a resource attribute.

      • Value (string) --

        Valid values are case-sensitive and vary by action.

    • SourceDestCheck (dict) --

      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.

      • Value (boolean) --

        Valid values are true or false.

    • 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.

CreateNetworkAcl (new) Link ¶

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 about network ACLs, see Network ACLs in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.create_network_acl(
    DryRun=True|False,
    VpcId='string'
)
type DryRun:

boolean

param DryRun:

type VpcId:

string

param VpcId:

[REQUIRED]

The ID of the VPC.

rtype:

dict

returns:

Response Syntax

{
    'NetworkAcl': {
        'NetworkAclId': 'string',
        'VpcId': 'string',
        'IsDefault': True|False,
        'Entries': [
            {
                'RuleNumber': 123,
                'Protocol': 'string',
                'RuleAction': 'allow'|'deny',
                'Egress': True|False,
                'CidrBlock': 'string',
                'IcmpTypeCode': {
                    'Type': 123,
                    'Code': 123
                },
                'PortRange': {
                    'From': 123,
                    'To': 123
                }
            },
        ],
        'Associations': [
            {
                'NetworkAclAssociationId': 'string',
                'NetworkAclId': 'string',
                'SubnetId': 'string'
            },
        ],
        'Tags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • NetworkAcl (dict) --

      Information about the network ACL.

      • NetworkAclId (string) --

        The ID of the network ACL.

      • VpcId (string) --

        The ID of the VPC for the network ACL.

      • IsDefault (boolean) --

        Indicates whether this is the default network ACL for the VPC.

      • Entries (list) --

        One or more entries (rules) in the network ACL.

        • (dict) --

          Describes an entry in a network ACL.

          • RuleNumber (integer) --

            The rule number for the entry. ACL entries are processed in ascending order by rule number.

          • Protocol (string) --

            The protocol. A value of -1 means all protocols.

          • RuleAction (string) --

            Indicates whether to allow or deny the traffic that matches the rule.

          • Egress (boolean) --

            Indicates whether the rule is an egress rule (applied to traffic leaving the subnet).

          • CidrBlock (string) --

            The network range to allow or deny, in CIDR notation.

          • IcmpTypeCode (dict) --

            ICMP protocol: The ICMP type and code.

            • Type (integer) --

              The ICMP code. A value of -1 means all codes for the specified ICMP type.

            • Code (integer) --

              The ICMP type. A value of -1 means all types.

          • 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.

      • 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.

      • 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.

DetachVpnGateway (new) Link ¶

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.

Request Syntax

client.detach_vpn_gateway(
    DryRun=True|False,
    VpnGatewayId='string',
    VpcId='string'
)
type DryRun:

boolean

param DryRun:

type VpnGatewayId:

string

param VpnGatewayId:

[REQUIRED]

The ID of the virtual private gateway.

type VpcId:

string

param VpcId:

[REQUIRED]

The ID of the VPC.

returns:

None

DescribeTags (new) Link ¶

Describes one or more of the tags for your EC2 resources.

For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.describe_tags(
    DryRun=True|False,
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    MaxResults=123,
    NextToken='string'
)
type DryRun:

boolean

param DryRun:

type Filters:

list

param Filters:

One or more filters.

  • key - The tag key.

  • resource-id - The resource ID.

  • resource-type - The resource type ( customer-gateway | dhcp-options | image | instance | internet-gateway | network-acl | network-interface | reserved-instances | route-table | security-group | snapshot | spot-instances-request | subnet | volume | vpc | vpn-connection | vpn-gateway).

  • value - The tag value.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

type MaxResults:

integer

param MaxResults:

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 larger than 1000, only 1000 results are returned.

type NextToken:

string

param NextToken:

The token to retrieve the next page of results.

rtype:

dict

returns:

Response Syntax

{
    'Tags': [
        {
            'ResourceId': 'string',
            'ResourceType': 'customer-gateway'|'dhcp-options'|'image'|'instance'|'internet-gateway'|'network-acl'|'network-interface'|'reserved-instances'|'route-table'|'snapshot'|'spot-instances-request'|'subnet'|'security-group'|'volume'|'vpc'|'vpn-connection'|'vpn-gateway',
            'Key': 'string',
            'Value': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Tags (list) --

      A list of tags.

      • (dict) --

        Describes a tag.

        • ResourceId (string) --

          The ID of the resource. For example, ami-1a2b3c4d.

        • ResourceType (string) --

          The resource type.

        • Key (string) --

          The tag key.

        • Value (string) --

          The tag value.

    • 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..

DetachInternetGateway (new) Link ¶

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.

Request Syntax

client.detach_internet_gateway(
    DryRun=True|False,
    InternetGatewayId='string',
    VpcId='string'
)
type DryRun:

boolean

param DryRun:

type InternetGatewayId:

string

param InternetGatewayId:

[REQUIRED]

The ID of the Internet gateway.

type VpcId:

string

param VpcId:

[REQUIRED]

The ID of the VPC.

returns:

None

AssignPrivateIpAddresses (new) Link ¶

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 Linux. For more information about Elastic IP addresses, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide for Linux.

AssignPrivateIpAddresses is available only in EC2-VPC.

Request Syntax

client.assign_private_ip_addresses(
    NetworkInterfaceId='string',
    PrivateIpAddresses=[
        'string',
    ],
    SecondaryPrivateIpAddressCount=123,
    AllowReassignment=True|False
)
type NetworkInterfaceId:

string

param NetworkInterfaceId:

[REQUIRED]

The ID of the network interface.

type PrivateIpAddresses:

list

param PrivateIpAddresses:

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.

  • (string) --

type SecondaryPrivateIpAddressCount:

integer

param SecondaryPrivateIpAddressCount:

The number of secondary IP addresses to assign to the network interface. You can't specify this parameter when also specifying private IP addresses.

type AllowReassignment:

boolean

param AllowReassignment:

Indicates whether to allow an IP address that is already assigned to another network interface or instance to be reassigned to the specified network interface.

returns:

None

AssociateRouteTable (new) Link ¶

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 about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.associate_route_table(
    DryRun=True|False,
    SubnetId='string',
    RouteTableId='string'
)
type DryRun:

boolean

param DryRun:

type SubnetId:

string

param SubnetId:

[REQUIRED]

The ID of the subnet.

type RouteTableId:

string

param RouteTableId:

[REQUIRED]

The ID of the route table.

rtype:

dict

returns:

Response Syntax

{
    'AssociationId': 'string'
}

Response Structure

  • (dict) --

    • AssociationId (string) --

      The route table association ID (needed to disassociate the route table).

AttachClassicLinkVpc (new) Link ¶

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.

Request Syntax

client.attach_classic_link_vpc(
    DryRun=True|False,
    InstanceId='string',
    VpcId='string',
    Groups=[
        'string',
    ]
)
type DryRun:

boolean

param DryRun:

type InstanceId:

string

param InstanceId:

[REQUIRED]

The ID of an EC2-Classic instance to link to the ClassicLink-enabled VPC.

type VpcId:

string

param VpcId:

[REQUIRED]

The ID of a ClassicLink-enabled VPC.

type Groups:

list

param Groups:

[REQUIRED]

The ID of one or more of the VPC's security groups. You cannot specify security groups from a different VPC.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'Return': True|False
}

Response Structure

  • (dict) --

    • Return (boolean) --

      Returns true if the request succeeds; otherwise, it returns an error.

CreateVpnConnection (new) Link ¶

Creates a VPN connection between an existing virtual private gateway and a VPN customer gateway. The only supported connection type is ipsec.1.

The response includes information that you need to give to your network administrator to configure 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.

For more information about VPN connections, see Adding a Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.create_vpn_connection(
    DryRun=True|False,
    Type='string',
    CustomerGatewayId='string',
    VpnGatewayId='string',
    Options={
        'StaticRoutesOnly': True|False
    }
)
type DryRun:

boolean

param DryRun:

type Type:

string

param Type:

[REQUIRED]

The type of VPN connection ( ipsec.1).

type CustomerGatewayId:

string

param CustomerGatewayId:

[REQUIRED]

The ID of the customer gateway.

type VpnGatewayId:

string

param VpnGatewayId:

[REQUIRED]

The ID of the virtual private gateway.

type Options:

dict

param Options:

Indicates whether the VPN connection requires static routes. If you are creating a VPN connection for a device that does not support BGP, you must specify true.

Default: false

  • StaticRoutesOnly (boolean) --

    Indicates whether the VPN connection uses static routes only. Static routes must be used for devices that don't support BGP.

rtype:

dict

returns:

Response Syntax

{
    'VpnConnection': {
        'VpnConnectionId': 'string',
        'State': 'pending'|'available'|'deleting'|'deleted',
        'CustomerGatewayConfiguration': 'string',
        'Type': 'ipsec.1',
        'CustomerGatewayId': 'string',
        'VpnGatewayId': 'string',
        'Tags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'VgwTelemetry': [
            {
                'OutsideIpAddress': 'string',
                'Status': 'UP'|'DOWN',
                'LastStatusChange': datetime(2015, 1, 1),
                'StatusMessage': 'string',
                'AcceptedRouteCount': 123
            },
        ],
        'Options': {
            'StaticRoutesOnly': True|False
        },
        'Routes': [
            {
                'DestinationCidrBlock': 'string',
                'Source': 'Static',
                'State': 'pending'|'available'|'deleting'|'deleted'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • VpnConnection (dict) --

      Information about the VPN connection.

      • VpnConnectionId (string) --

        The ID of the VPN connection.

      • State (string) --

        The current state of 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.

      • Type (string) --

        The type of VPN connection.

      • CustomerGatewayId (string) --

        The ID of the customer gateway at your end of the VPN connection.

      • VpnGatewayId (string) --

        The ID of the virtual private gateway at the AWS side of the VPN connection.

      • 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.

          • OutsideIpAddress (string) --

            The Internet-routable IP address of the virtual private gateway's outside interface.

          • Status (string) --

            The status of the VPN tunnel.

          • LastStatusChange (datetime) --

            The date and time of the last change in status.

          • StatusMessage (string) --

            If an error occurs, a description of the error.

          • AcceptedRouteCount (integer) --

            The number of accepted routes.

      • 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.

DescribeImportSnapshotTasks (new) Link ¶

Displays details about an import snapshot tasks that is already created.

Request Syntax

client.describe_import_snapshot_tasks(
    DryRun=True|False,
    ImportTaskIds=[
        'string',
    ],
    NextToken='string',
    MaxResults=123,
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type ImportTaskIds:

list

param ImportTaskIds:

A list of IDs of the ImportSnapshot tasks to describe.

  • (string) --

type NextToken:

string

param NextToken:

The token to get to the next page of paginated describe requests.

type MaxResults:

integer

param MaxResults:

The maximum number of results in a page.

type Filters:

list

param Filters:

The filters to be applied on a describe request.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'ImportSnapshotTasks': [
        {
            'ImportTaskId': 'string',
            'SnapshotTaskDetail': {
                'DiskImageSize': 123.0,
                'Description': 'string',
                'Format': 'string',
                'Url': 'string',
                'UserBucket': {
                    'S3Bucket': 'string',
                    'S3Key': 'string'
                },
                'SnapshotId': 'string',
                'Progress': 'string',
                'StatusMessage': 'string',
                'Status': 'string'
            },
            'Description': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • ImportSnapshotTasks (list) --

      A list of zero or more ImportSnapshot tasks that are currently active or completed/cancelled in the previous 7 days.

      • (dict) --

        • ImportTaskId (string) --

          The task ID of the ImportSnapshot task.

        • SnapshotTaskDetail (dict) --

          Details about the import snapshot task.

          • DiskImageSize (float) --

            The size of the disk in the snapshot.

          • Description (string) --

            The description of the snapshot.

          • Format (string) --

            The format of the disk image from which the snapshot is created.

          • Url (string) --

            The URL of the disk image from which the snapshot is created.

          • UserBucket (dict) --

            User's Amazon S3 bucket details used to access the image.

            • S3Bucket (string) --

              The Amazon S3 bucket from which the disk image was created.

            • S3Key (string) --

              The Amazon S3 key from which the disk image was created.

          • SnapshotId (string) --

            The snapshot ID of the disk being imported.

          • Progress (string) --

            The percentage of completion for the ImportSnapshot task.

          • StatusMessage (string) --

            A detailed status message for the ImportSnapshot task.

          • Status (string) --

            A brief status for the ImportSnapshot task.

        • Description (string) --

          Description for the import snapshot task.

    • NextToken (string) --

      The token to get to the next page of paginated describe requests.

DescribeVolumeAttribute (new) Link ¶

Describes the specified attribute of the specified volume. You can specify only one attribute at a time.

For more information about Amazon EBS volumes, see Amazon EBS Volumes in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.describe_volume_attribute(
    DryRun=True|False,
    VolumeId='string',
    Attribute='autoEnableIO'|'productCodes'
)
type DryRun:

boolean

param DryRun:

type VolumeId:

string

param VolumeId:

[REQUIRED]

The ID of the volume.

type Attribute:

string

param Attribute:

The instance attribute.

rtype:

dict

returns:

Response Syntax

{
    'VolumeId': 'string',
    'AutoEnableIO': {
        'Value': True|False
    },
    'ProductCodes': [
        {
            'ProductCodeId': 'string',
            'ProductCodeType': 'devpay'|'marketplace'
        },
    ]
}

Response Structure

  • (dict) --

    • VolumeId (string) --

      The ID of the volume.

    • AutoEnableIO (dict) --

      The state of autoEnableIO attribute.

      • Value (boolean) --

        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.

DescribeClassicLinkInstances (new) Link ¶

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.

Request Syntax

client.describe_classic_link_instances(
    DryRun=True|False,
    InstanceIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    NextToken='string',
    MaxResults=123
)
type DryRun:

boolean

param DryRun:

type InstanceIds:

list

param InstanceIds:

One or more instance IDs. Must be instances linked to a VPC through ClassicLink.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • group-id - The ID of a VPC security group that's associated with the instance.

  • instance-id - The ID of the instance.

  • tag:key*=*value - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key*=*value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • vpc-id - The ID of the VPC that the instance is linked to.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

type NextToken:

string

param NextToken:

The token to retrieve the next page of results.

type MaxResults:

integer

param MaxResults:

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 larger than 1000, only 1000 results are returned. You cannot specify this parameter and the instance IDs parameter in the same request.

Constraint: If the value is greater than 1000, we return only 1000 items.

rtype:

dict

returns:

Response Syntax

{
    'Instances': [
        {
            'InstanceId': 'string',
            'VpcId': 'string',
            'Groups': [
                {
                    'GroupName': 'string',
                    'GroupId': 'string'
                },
            ],
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Instances (list) --

      Information about one or more linked EC2-Classic instances.

      • (dict) --

        Describes a linked EC2-Classic instance.

        • InstanceId (string) --

          The ID of the instance.

        • VpcId (string) --

          The ID of the VPC.

        • 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.

        • 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.

    • 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.

DescribeImages (new) Link ¶

Describes one or more of the images (AMIs, AKIs, and ARIs) available to you. Images available to you include public images, private images that you own, and private images owned by other AWS accounts but for which you have explicit launch permissions.

Request Syntax

client.describe_images(
    DryRun=True|False,
    ImageIds=[
        'string',
    ],
    Owners=[
        'string',
    ],
    ExecutableUsers=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type ImageIds:

list

param ImageIds:

One or more image IDs.

Default: Describes all images available to you.

  • (string) --

type Owners:

list

param Owners:

Filters the images by the owner. Specify an AWS account ID, amazon (owner is Amazon), aws-marketplace (owner is AWS Marketplace), self (owner is the sender of the request). Omitting this option returns all images for which you have launch permissions, regardless of ownership.

  • (string) --

type ExecutableUsers:

list

param ExecutableUsers:

Scopes the images by users with explicit launch permissions. Specify an AWS account ID, self (the sender of the request), or all (public AMIs).

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • architecture - The image architecture ( i386 | x86_64).

  • block-device-mapping.delete-on-termination - A Boolean value that indicates whether the Amazon EBS volume is deleted on instance termination.

  • block-device-mapping.device-name - The device name for the Amazon EBS volume (for example, /dev/sdh).

  • block-device-mapping.snapshot-id - The ID of the snapshot used for the Amazon EBS volume.

  • block-device-mapping.volume-size - The volume size of the Amazon EBS volume, in GiB.

  • block-device-mapping.volume-type - The volume type of the Amazon EBS volume ( gp2 | standard | io1).

  • description - The description of the image (provided during image creation).

  • hypervisor - The hypervisor type ( ovm | xen).

  • image-id - The ID of the image.

  • image-type - The image type ( machine | kernel | ramdisk).

  • is-public - A Boolean that indicates whether the image is public.

  • kernel-id - The kernel ID.

  • manifest-location - The location of the image manifest.

  • name - The name of the AMI (provided during image creation).

  • owner-alias - The AWS account alias (for example, amazon).

  • owner-id - The AWS account ID of the image owner.

  • platform - The platform. To only list Windows-based AMIs, use windows.

  • product-code - The product code.

  • product-code.type - The type of the product code ( devpay | marketplace).

  • ramdisk-id - The RAM disk ID.

  • root-device-name - The name of the root device volume (for example, /dev/sda1).

  • root-device-type - The type of the root device volume ( ebs | instance-store).

  • state - The state of the image ( available | pending | failed).

  • state-reason-code - The reason code for the state change.

  • state-reason-message - The message for the state change.

  • tag:key*=*value - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key*=*value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • virtualization-type - The virtualization type ( paravirtual | hvm).

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'Images': [
        {
            'ImageId': 'string',
            'ImageLocation': 'string',
            'State': 'pending'|'available'|'invalid'|'deregistered'|'transient'|'failed'|'error',
            'OwnerId': 'string',
            'CreationDate': 'string',
            'Public': True|False,
            'ProductCodes': [
                {
                    'ProductCodeId': 'string',
                    'ProductCodeType': 'devpay'|'marketplace'
                },
            ],
            'Architecture': 'i386'|'x86_64',
            'ImageType': 'machine'|'kernel'|'ramdisk',
            'KernelId': 'string',
            'RamdiskId': 'string',
            'Platform': 'Windows',
            'SriovNetSupport': 'string',
            'StateReason': {
                'Code': 'string',
                'Message': 'string'
            },
            'ImageOwnerAlias': 'string',
            'Name': 'string',
            'Description': 'string',
            'RootDeviceType': 'ebs'|'instance-store',
            'RootDeviceName': 'string',
            'BlockDeviceMappings': [
                {
                    'VirtualName': 'string',
                    'DeviceName': 'string',
                    'Ebs': {
                        'SnapshotId': 'string',
                        'VolumeSize': 123,
                        'DeleteOnTermination': True|False,
                        'VolumeType': 'standard'|'io1'|'gp2',
                        'Iops': 123,
                        'Encrypted': True|False
                    },
                    'NoDevice': 'string'
                },
            ],
            'VirtualizationType': 'hvm'|'paravirtual',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'Hypervisor': 'ovm'|'xen'
        },
    ]
}

Response Structure

  • (dict) --

    • Images (list) --

      Information about one or more images.

      • (dict) --

        Describes an image.

        • ImageId (string) --

          The ID of the AMI.

        • ImageLocation (string) --

          The location of the AMI.

        • 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.

        • OwnerId (string) --

          The AWS account ID of the image owner.

        • CreationDate (string) --

          The date and time the image was created.

        • 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.

        • 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.

        • Architecture (string) --

          The architecture of the image.

        • ImageType (string) --

          The type of image.

        • KernelId (string) --

          The kernel associated with the image, if any. Only applicable for machine images.

        • RamdiskId (string) --

          The RAM disk associated with the image, if any. Only applicable for machine images.

        • Platform (string) --

          The value is Windows for Windows AMIs; otherwise blank.

        • SriovNetSupport (string) --

          Specifies whether enhanced networking 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.

            • Server.SpotInstanceTermination: A Spot Instance was terminated due to an increase in the market price.

            • Server.InternalError: An internal error occurred during instance launch, resulting in termination.

            • Server.InsufficientInstanceCapacity: There was insufficient instance capacity to satisfy the launch request.

            • Client.InternalError: A client error caused the instance to terminate on launch.

            • Client.InstanceInitiatedShutdown: The instance was shut down using the shutdown -h command from the instance.

            • Client.UserInitiatedShutdown: The instance was shut down using the Amazon EC2 API.

            • Client.VolumeLimitExceeded: The volume limit was exceeded.

            • Client.InvalidSnapshot.NotFound: The specified snapshot was not found.

        • 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.

        • Description (string) --

          The description of the AMI that was provided during image creation.

        • RootDeviceType (string) --

          The type of root device used by the AMI. The AMI can use an Amazon EBS volume or an instance store volume.

        • RootDeviceName (string) --

          The device name of the root device (for example, /dev/sda1 or /dev/xvda).

        • BlockDeviceMappings (list) --

          Any block device mapping entries.

          • (dict) --

            Describes a block device mapping.

            • 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.

              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.

            • DeviceName (string) --

              The device name exposed to the instance (for example, /dev/sdh or xvdh).

            • Ebs (dict) --

              Parameters used to automatically set up Amazon EBS volumes when the instance is launched.

              • SnapshotId (string) --

                The ID of the snapshot.

              • VolumeSize (integer) --

                The size of the volume, in GiB.

                Constraints: 1-1024 for standard volumes, 1-16384 for gp2 volumes, and 4-16384 for io1 volumes. 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.

              • DeleteOnTermination (boolean) --

                Indicates whether the Amazon EBS volume is deleted on instance termination.

              • VolumeType (string) --

                The volume type. gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic volumes.

                Default: standard

              • 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 on General Purpose (SSD) baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide for Linux.

                Constraint: Range is 100 to 20000 for Provisioned IOPS (SSD) volumes and 3 to 10000 for General Purpose (SSD) volumes.

                Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create standard or gp2 volumes.

              • Encrypted (boolean) --

                Indicates whether the Amazon EBS volume is encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption.

            • NoDevice (string) --

              Suppresses the specified device included in the block device mapping of the AMI.

        • VirtualizationType (string) --

          The type of virtualization of the AMI.

        • 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.

        • Hypervisor (string) --

          The hypervisor type of the image.

RequestSpotInstances (new) Link ¶

Creates a Spot Instance request. Spot Instances are instances that Amazon EC2 launches when the bid price that you specify exceeds the current Spot Price. Amazon EC2 periodically sets the Spot Price based on available Spot Instance capacity and current Spot Instance requests. For more information, see Spot Instance Requests in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.request_spot_instances(
    DryRun=True|False,
    SpotPrice='string',
    InstanceCount=123,
    Type='one-time'|'persistent',
    ValidFrom=datetime(2015, 1, 1),
    ValidUntil=datetime(2015, 1, 1),
    LaunchGroup='string',
    AvailabilityZoneGroup='string',
    LaunchSpecification={
        'ImageId': 'string',
        'KeyName': 'string',
        'SecurityGroups': [
            'string',
        ],
        'UserData': 'string',
        'AddressingType': 'string',
        'InstanceType': 't1.micro'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'t2.micro'|'t2.small'|'t2.medium'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'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'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'cg1.4xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge',
        'Placement': {
            'AvailabilityZone': 'string',
            'GroupName': 'string'
        },
        'KernelId': 'string',
        'RamdiskId': 'string',
        'BlockDeviceMappings': [
            {
                'VirtualName': 'string',
                'DeviceName': 'string',
                'Ebs': {
                    'SnapshotId': 'string',
                    'VolumeSize': 123,
                    'DeleteOnTermination': True|False,
                    'VolumeType': 'standard'|'io1'|'gp2',
                    'Iops': 123,
                    'Encrypted': True|False
                },
                'NoDevice': 'string'
            },
        ],
        'SubnetId': 'string',
        'NetworkInterfaces': [
            {
                'NetworkInterfaceId': 'string',
                'DeviceIndex': 123,
                'SubnetId': 'string',
                'Description': 'string',
                'PrivateIpAddress': 'string',
                'Groups': [
                    'string',
                ],
                'DeleteOnTermination': True|False,
                'PrivateIpAddresses': [
                    {
                        'PrivateIpAddress': 'string',
                        'Primary': True|False
                    },
                ],
                'SecondaryPrivateIpAddressCount': 123,
                'AssociatePublicIpAddress': True|False
            },
        ],
        'IamInstanceProfile': {
            'Arn': 'string',
            'Name': 'string'
        },
        'EbsOptimized': True|False,
        'Monitoring': {
            'Enabled': True|False
        },
        'SecurityGroupIds': [
            'string',
        ]
    }
)
type DryRun:

boolean

param DryRun:

type SpotPrice:

string

param SpotPrice:

[REQUIRED]

The maximum hourly price (bid) for any Spot Instance launched to fulfill the request.

type InstanceCount:

integer

param InstanceCount:

The maximum number of Spot Instances to launch.

Default: 1

type Type:

string

param Type:

The Spot Instance request type.

Default: one-time

type ValidFrom:

datetime

param ValidFrom:

The start date of the request. If this is a one-time request, the request becomes active at this date and time and remains active until all instances launch, the request expires, or the request is canceled. If the request is persistent, the request becomes active at this date and time and remains active until it expires or is canceled.

Default: The request is effective indefinitely.

type ValidUntil:

datetime

param ValidUntil:

The end date of the request. If this is 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.

Default: The request is effective indefinitely.

type LaunchGroup:

string

param LaunchGroup:

The instance launch group. Launch groups are Spot Instances that launch together and terminate together.

Default: Instances are launched and terminated individually

type AvailabilityZoneGroup:

string

param AvailabilityZoneGroup:

The user-specified name for a logical grouping of bids.

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 bids 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 bid is expired, or the bid falls below current market), 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.

type LaunchSpecification:

dict

param LaunchSpecification:

Describes the launch specification for an instance.

  • ImageId (string) --

    The ID of the AMI.

  • KeyName (string) --

    The name of the key pair.

  • SecurityGroups (list) --

    • (string) --

  • UserData (string) --

    The Base64-encoded MIME user data to make available to the instances.

  • AddressingType (string) --

    Deprecated.

  • InstanceType (string) --

    The instance type.

  • Placement (dict) --

    The placement information for the instance.

    • AvailabilityZone (string) --

      The Availability Zone.

    • GroupName (string) --

      The name of the placement group (for cluster instances).

  • KernelId (string) --

    The ID of the kernel.

  • RamdiskId (string) --

    The ID of the RAM disk.

  • BlockDeviceMappings (list) --

    One or more block device mapping entries.

    • (dict) --

      Describes a block device mapping.

      • 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.

        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.

      • DeviceName (string) --

        The device name exposed to the instance (for example, /dev/sdh or xvdh).

      • Ebs (dict) --

        Parameters used to automatically set up Amazon EBS volumes when the instance is launched.

        • SnapshotId (string) --

          The ID of the snapshot.

        • VolumeSize (integer) --

          The size of the volume, in GiB.

          Constraints: 1-1024 for standard volumes, 1-16384 for gp2 volumes, and 4-16384 for io1 volumes. 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.

        • DeleteOnTermination (boolean) --

          Indicates whether the Amazon EBS volume is deleted on instance termination.

        • VolumeType (string) --

          The volume type. gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic volumes.

          Default: standard

        • 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 on General Purpose (SSD) baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide for Linux.

          Constraint: Range is 100 to 20000 for Provisioned IOPS (SSD) volumes and 3 to 10000 for General Purpose (SSD) volumes.

          Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create standard or gp2 volumes.

        • Encrypted (boolean) --

          Indicates whether the Amazon EBS volume is encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption.

      • NoDevice (string) --

        Suppresses the specified device included in the block device mapping of the AMI.

  • SubnetId (string) --

    The ID of the subnet in which to launch the instance.

  • NetworkInterfaces (list) --

    One or more network interfaces.

    • (dict) --

      Describes a network interface.

      • NetworkInterfaceId (string) --

        The ID of the network interface.

      • DeviceIndex (integer) --

        The index of the device on the instance for the network interface attachment. If you are specifying a network interface in a RunInstances request, you must provide the device index.

      • SubnetId (string) --

        The ID of the subnet associated with the network string. Applies only if creating a 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.

      • PrivateIpAddress (string) --

        The private IP address of the network interface. Applies only if creating a network interface when launching an instance.

      • Groups (list) --

        The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.

        • (string) --

      • 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.

      • PrivateIpAddresses (list) --

        One or more private IP addresses to assign to the network interface. Only one private IP address can be designated as primary.

        • (dict) --

          Describes a secondary private IP address for a network interface.

          • PrivateIpAddress (string) -- [REQUIRED]

            The private IP addresses.

          • Primary (boolean) --

            Indicates whether the private IP address is the primary private IP address. Only one IP address can be designated as primary.

      • SecondaryPrivateIpAddressCount (integer) --

        The number of secondary private IP addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option.

      • AssociatePublicIpAddress (boolean) --

        Indicates whether to assign a public IP 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.

  • 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.

  • 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

  • Monitoring (dict) --

    Describes the monitoring for the instance.

    • Enabled (boolean) -- [REQUIRED]

      Indicates whether monitoring is enabled for the instance.

  • SecurityGroupIds (list) --

    • (string) --

rtype:

dict

returns:

Response Syntax

{
    'SpotInstanceRequests': [
        {
            'SpotInstanceRequestId': 'string',
            'SpotPrice': 'string',
            'Type': 'one-time'|'persistent',
            'State': 'open'|'active'|'closed'|'cancelled'|'failed',
            'Fault': {
                'Code': 'string',
                'Message': 'string'
            },
            'Status': {
                'Code': 'string',
                'UpdateTime': datetime(2015, 1, 1),
                'Message': 'string'
            },
            'ValidFrom': datetime(2015, 1, 1),
            'ValidUntil': datetime(2015, 1, 1),
            'LaunchGroup': 'string',
            'AvailabilityZoneGroup': 'string',
            'LaunchSpecification': {
                'ImageId': 'string',
                'KeyName': 'string',
                'SecurityGroups': [
                    {
                        'GroupName': 'string',
                        'GroupId': 'string'
                    },
                ],
                'UserData': 'string',
                'AddressingType': 'string',
                'InstanceType': 't1.micro'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'t2.micro'|'t2.small'|'t2.medium'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'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'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'cg1.4xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge',
                'Placement': {
                    'AvailabilityZone': 'string',
                    'GroupName': 'string'
                },
                'KernelId': 'string',
                'RamdiskId': 'string',
                'BlockDeviceMappings': [
                    {
                        'VirtualName': 'string',
                        'DeviceName': 'string',
                        'Ebs': {
                            'SnapshotId': 'string',
                            'VolumeSize': 123,
                            'DeleteOnTermination': True|False,
                            'VolumeType': 'standard'|'io1'|'gp2',
                            'Iops': 123,
                            'Encrypted': True|False
                        },
                        'NoDevice': 'string'
                    },
                ],
                'SubnetId': 'string',
                'NetworkInterfaces': [
                    {
                        'NetworkInterfaceId': 'string',
                        'DeviceIndex': 123,
                        'SubnetId': 'string',
                        'Description': 'string',
                        'PrivateIpAddress': 'string',
                        'Groups': [
                            'string',
                        ],
                        'DeleteOnTermination': True|False,
                        'PrivateIpAddresses': [
                            {
                                'PrivateIpAddress': 'string',
                                'Primary': True|False
                            },
                        ],
                        'SecondaryPrivateIpAddressCount': 123,
                        'AssociatePublicIpAddress': True|False
                    },
                ],
                'IamInstanceProfile': {
                    'Arn': 'string',
                    'Name': 'string'
                },
                'EbsOptimized': True|False,
                'Monitoring': {
                    'Enabled': True|False
                }
            },
            'InstanceId': 'string',
            'CreateTime': datetime(2015, 1, 1),
            'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'LaunchedAvailabilityZone': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • SpotInstanceRequests (list) --

      One or more Spot Instance requests.

      • (dict) --

        Describe a Spot Instance request.

        • SpotInstanceRequestId (string) --

          The ID of the Spot Instance request.

        • SpotPrice (string) --

          The maximum hourly price (bid) for any Spot Instance launched to fulfill the request.

        • Type (string) --

          The Spot Instance request type.

        • State (string) --

          The state of the Spot Instance request. Spot bid status information can help you track your Spot Instance requests. For more information, see Spot Bid Status in the Amazon Elastic Compute Cloud User Guide for Linux.

        • 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.

        • Status (dict) --

          The status code and status message describing the Spot Instance request.

          • Code (string) --

            The status code.

          • UpdateTime (datetime) --

            The time of the most recent status update.

          • Message (string) --

            The description for the status code.

        • ValidFrom (datetime) --

          The start date of the request. If this is a one-time request, the request becomes active at this date and time and remains active until all instances launch, the request expires, or the request is canceled. If the request is persistent, the request becomes active at this date and time and remains active until it expires or is canceled.

        • ValidUntil (datetime) --

          The end date of the request. If this is 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 is reached.

        • LaunchGroup (string) --

          The instance launch group. Launch groups are Spot Instances that launch together and terminate together.

        • 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.

        • LaunchSpecification (dict) --

          Additional information for launching instances.

          • ImageId (string) --

            The ID of the AMI.

          • KeyName (string) --

            The name of the key pair.

          • SecurityGroups (list) --

            One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.

            • (dict) --

              Describes a security group.

              • GroupName (string) --

                The name of the security group.

              • GroupId (string) --

                The ID of the security group.

          • UserData (string) --

            The Base64-encoded MIME user data to make available to the instances.

          • AddressingType (string) --

            Deprecated.

          • InstanceType (string) --

            The instance type.

          • Placement (dict) --

            The placement information for the instance.

            • AvailabilityZone (string) --

              The Availability Zone.

            • GroupName (string) --

              The name of the placement group (for cluster instances).

          • KernelId (string) --

            The ID of the kernel.

          • RamdiskId (string) --

            The ID of the RAM disk.

          • BlockDeviceMappings (list) --

            One or more block device mapping entries.

            • (dict) --

              Describes a block device mapping.

              • 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.

                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.

              • DeviceName (string) --

                The device name exposed to the instance (for example, /dev/sdh or xvdh).

              • Ebs (dict) --

                Parameters used to automatically set up Amazon EBS volumes when the instance is launched.

                • SnapshotId (string) --

                  The ID of the snapshot.

                • VolumeSize (integer) --

                  The size of the volume, in GiB.

                  Constraints: 1-1024 for standard volumes, 1-16384 for gp2 volumes, and 4-16384 for io1 volumes. 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.

                • DeleteOnTermination (boolean) --

                  Indicates whether the Amazon EBS volume is deleted on instance termination.

                • VolumeType (string) --

                  The volume type. gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic volumes.

                  Default: standard

                • 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 on General Purpose (SSD) baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide for Linux.

                  Constraint: Range is 100 to 20000 for Provisioned IOPS (SSD) volumes and 3 to 10000 for General Purpose (SSD) volumes.

                  Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create standard or gp2 volumes.

                • Encrypted (boolean) --

                  Indicates whether the Amazon EBS volume is encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption.

              • NoDevice (string) --

                Suppresses the specified device included in the block device mapping of the AMI.

          • SubnetId (string) --

            The ID of the subnet in which to launch the instance.

          • NetworkInterfaces (list) --

            One or more network interfaces.

            • (dict) --

              Describes a network interface.

              • NetworkInterfaceId (string) --

                The ID of the network interface.

              • DeviceIndex (integer) --

                The index of the device on the instance for the network interface attachment. If you are specifying a network interface in a RunInstances request, you must provide the device index.

              • SubnetId (string) --

                The ID of the subnet associated with the network string. Applies only if creating a 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.

              • PrivateIpAddress (string) --

                The private IP address of the network interface. Applies only if creating a network interface when launching an instance.

              • Groups (list) --

                The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.

                • (string) --

              • 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.

              • PrivateIpAddresses (list) --

                One or more private IP addresses to assign to the network interface. Only one private IP address can be designated as primary.

                • (dict) --

                  Describes a secondary private IP address for a network interface.

                  • PrivateIpAddress (string) --

                    The private IP addresses.

                  • Primary (boolean) --

                    Indicates whether the private IP address is the primary private IP address. Only one IP address can be designated as primary.

              • SecondaryPrivateIpAddressCount (integer) --

                The number of secondary private IP addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option.

              • AssociatePublicIpAddress (boolean) --

                Indicates whether to assign a public IP 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.

          • 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.

          • 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

          • Monitoring (dict) --

            Describes the monitoring for the instance.

            • Enabled (boolean) --

              Indicates whether monitoring is enabled for the instance.

        • InstanceId (string) --

          The instance ID, if an instance has been launched to fulfill the Spot Instance request.

        • CreateTime (datetime) --

          The time stamp when the Spot Instance request was created.

        • ProductDescription (string) --

          The product description associated with the Spot 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.

        • LaunchedAvailabilityZone (string) --

          The Availability Zone in which the bid is launched.

CreatePlacementGroup (new) Link ¶

Creates a placement group that you launch cluster instances into. You must give the group a name that's unique within the scope of your account.

For more information about placement groups and cluster instances, see Cluster Instances in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.create_placement_group(
    DryRun=True|False,
    GroupName='string',
    Strategy='cluster'
)
type DryRun:

boolean

param DryRun:

type GroupName:

string

param GroupName:

[REQUIRED]

A name for the placement group.

Constraints: Up to 255 ASCII characters

type Strategy:

string

param Strategy:

[REQUIRED]

The placement strategy.

returns:

None

DescribeVolumes (new) Link ¶

Describes the specified Amazon 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 Amazon EBS volumes, see Amazon EBS Volumes in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.describe_volumes(
    DryRun=True|False,
    VolumeIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    NextToken='string',
    MaxResults=123
)
type DryRun:

boolean

param DryRun:

type VolumeIds:

list

param VolumeIds:

One or more volume IDs.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • attachment.attach-time - The time stamp when the attachment initiated.

  • attachment.delete-on-termination - Whether the volume is deleted on instance termination.

  • attachment.device - The device name that is exposed to the instance (for example, /dev/sda1).

  • attachment.instance-id - The ID of the instance the volume is attached to.

  • attachment.status - The attachment state ( attaching | attached | detaching | detached).

  • availability-zone - The Availability Zone in which the volume was created.

  • create-time - The time stamp when the volume was created.

  • encrypted - The encryption status of the volume.

  • size - The size of the volume, in GiB.

  • snapshot-id - The snapshot from which the volume was created.

  • status - The status of the volume ( creating | available | in-use | deleting | deleted | error).

  • tag:key*=*value - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key*=*value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • volume-id - The volume ID.

  • volume-type - The Amazon EBS volume type. This can be gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

type NextToken:

string

param NextToken:

The NextToken value returned from a previous paginated DescribeVolumes request where MaxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the NextToken value. This value is null when there are no more results to return.

type MaxResults:

integer

param MaxResults:

The maximum number of volume results returned by DescribeVolumes in paginated output. When this parameter is used, DescribeVolumes only returns MaxResults results in a single page along with a NextToken response element. The remaining results of the initial request can be seen by sending another DescribeVolumes request with the returned NextToken value. This value can be between 5 and 1000; if MaxResults is given a value larger than 1000, only 1000 results are returned. If this parameter is not used, then DescribeVolumes returns all results. You cannot specify this parameter and the volume IDs parameter in the same request.

rtype:

dict

returns:

Response Syntax

{
    'Volumes': [
        {
            'VolumeId': 'string',
            'Size': 123,
            'SnapshotId': 'string',
            'AvailabilityZone': 'string',
            'State': 'creating'|'available'|'in-use'|'deleting'|'deleted'|'error',
            'CreateTime': datetime(2015, 1, 1),
            'Attachments': [
                {
                    'VolumeId': 'string',
                    'InstanceId': 'string',
                    'Device': 'string',
                    'State': 'attaching'|'attached'|'detaching'|'detached',
                    'AttachTime': datetime(2015, 1, 1),
                    'DeleteOnTermination': True|False
                },
            ],
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'VolumeType': 'standard'|'io1'|'gp2',
            'Iops': 123,
            'Encrypted': True|False,
            'KmsKeyId': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Volumes (list) --

      • (dict) --

        Describes a volume.

        • VolumeId (string) --

          The ID of the volume.

        • Size (integer) --

          The size of the volume, in GiBs.

        • SnapshotId (string) --

          The snapshot from which the volume was created, if applicable.

        • AvailabilityZone (string) --

          The Availability Zone for the volume.

        • State (string) --

          The volume state.

        • CreateTime (datetime) --

          The time stamp when volume creation was initiated.

        • Attachments (list) --

          • (dict) --

            Describes volume attachment details.

            • VolumeId (string) --

              The ID of the volume.

            • InstanceId (string) --

              The ID of the instance.

            • Device (string) --

              The device name.

            • State (string) --

              The attachment state of the volume.

            • AttachTime (datetime) --

              The time stamp when the attachment initiated.

            • DeleteOnTermination (boolean) --

              Indicates whether the Amazon EBS volume is deleted on instance termination.

        • 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) volumes, io1 for Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes.

        • 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 on General Purpose (SSD) baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide for Linux.

          Constraint: Range is 100 to 20000 for Provisioned IOPS (SSD) volumes and 3 to 10000 for General Purpose (SSD) volumes.

          Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create standard or gp2 volumes.

        • Encrypted (boolean) --

          Indicates whether the volume will be encrypted.

        • KmsKeyId (string) --

          The full ARN of the AWS Key Management Service (KMS) master key that was used to protect the volume encryption key for the volume.

    • 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.

DescribeSpotInstanceRequests (new) Link ¶

Describes the Spot Instance requests that belong to your account. Spot Instances are instances that Amazon EC2 launches when the bid price that you specify exceeds the current Spot Price. Amazon EC2 periodically sets the Spot Price based on available Spot Instance capacity and current Spot Instance requests. For more information, see Spot Instance Requests in the Amazon Elastic Compute Cloud User Guide for Linux.

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.

Request Syntax

client.describe_spot_instance_requests(
    DryRun=True|False,
    SpotInstanceRequestIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type SpotInstanceRequestIds:

list

param SpotInstanceRequestIds:

One or more Spot Instance request IDs.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • availability-zone-group - The Availability Zone group.

  • create-time - The time stamp when the Spot Instance request was created.

  • fault-code - The fault code related to the request.

  • fault-message - The fault message related to the request.

  • instance-id - The ID of the instance that fulfilled the request.

  • launch-group - The Spot Instance launch group.

  • launch.block-device-mapping.delete-on-termination - Indicates whether the Amazon EBS volume is deleted on instance termination.

  • launch.block-device-mapping.device-name - The device name for the Amazon EBS volume (for example, /dev/sdh).

  • launch.block-device-mapping.snapshot-id - The ID of the snapshot used for the Amazon EBS volume.

  • launch.block-device-mapping.volume-size - The size of the Amazon EBS volume, in GiB.

  • launch.block-device-mapping.volume-type - The type of the Amazon EBS volume ( gp2 | standard | io1).

  • launch.group-id - The security group for the instance.

  • launch.image-id - The ID of the AMI.

  • launch.instance-type - The type of instance (for example, m1.small).

  • launch.kernel-id - The kernel ID.

  • launch.key-name - The name of the key pair the instance launched with.

  • launch.monitoring-enabled - Whether monitoring is enabled for the Spot Instance.

  • launch.ramdisk-id - The RAM disk ID.

  • network-interface.network-interface-id - The ID of the network interface.

  • network-interface.device-index - The index of the device for the network interface attachment on the instance.

  • network-interface.subnet-id - The ID of the subnet for the instance.

  • network-interface.description - A description of the network interface.

  • network-interface.private-ip-address - The primary private IP address of the network interface.

  • network-interface.delete-on-termination - Indicates whether the network interface is deleted when the instance is terminated.

  • network-interface.group-id - The ID of the security group associated with the network interface.

  • network-interface.group-name - The name of the security group associated with the network interface.

  • network-interface.addresses.primary - Indicates whether the IP address is the primary private IP address.

  • product-description - The product description associated with the instance ( Linux/UNIX | Windows).

  • spot-instance-request-id - The Spot Instance request ID.

  • spot-price - The maximum hourly price for any Spot Instance launched to fulfill the request.

  • state - The state of the Spot Instance request ( open | active | closed | cancelled | failed). Spot bid status information can help you track your Amazon EC2 Spot Instance requests. For more information, see Spot Bid Status in the Amazon Elastic Compute Cloud User Guide for Linux.

  • status-code - The short code describing the most recent evaluation of your Spot Instance request.

  • status-message - The message explaining the status of the Spot Instance request.

  • tag:key*=*value - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key*=*value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • type - The type of Spot Instance request ( one-time | persistent).

  • launched-availability-zone - The Availability Zone in which the bid is launched.

  • valid-from - The start date of the request.

  • valid-until - The end date of the request.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'SpotInstanceRequests': [
        {
            'SpotInstanceRequestId': 'string',
            'SpotPrice': 'string',
            'Type': 'one-time'|'persistent',
            'State': 'open'|'active'|'closed'|'cancelled'|'failed',
            'Fault': {
                'Code': 'string',
                'Message': 'string'
            },
            'Status': {
                'Code': 'string',
                'UpdateTime': datetime(2015, 1, 1),
                'Message': 'string'
            },
            'ValidFrom': datetime(2015, 1, 1),
            'ValidUntil': datetime(2015, 1, 1),
            'LaunchGroup': 'string',
            'AvailabilityZoneGroup': 'string',
            'LaunchSpecification': {
                'ImageId': 'string',
                'KeyName': 'string',
                'SecurityGroups': [
                    {
                        'GroupName': 'string',
                        'GroupId': 'string'
                    },
                ],
                'UserData': 'string',
                'AddressingType': 'string',
                'InstanceType': 't1.micro'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'t2.micro'|'t2.small'|'t2.medium'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'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'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'cg1.4xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge',
                'Placement': {
                    'AvailabilityZone': 'string',
                    'GroupName': 'string'
                },
                'KernelId': 'string',
                'RamdiskId': 'string',
                'BlockDeviceMappings': [
                    {
                        'VirtualName': 'string',
                        'DeviceName': 'string',
                        'Ebs': {
                            'SnapshotId': 'string',
                            'VolumeSize': 123,
                            'DeleteOnTermination': True|False,
                            'VolumeType': 'standard'|'io1'|'gp2',
                            'Iops': 123,
                            'Encrypted': True|False
                        },
                        'NoDevice': 'string'
                    },
                ],
                'SubnetId': 'string',
                'NetworkInterfaces': [
                    {
                        'NetworkInterfaceId': 'string',
                        'DeviceIndex': 123,
                        'SubnetId': 'string',
                        'Description': 'string',
                        'PrivateIpAddress': 'string',
                        'Groups': [
                            'string',
                        ],
                        'DeleteOnTermination': True|False,
                        'PrivateIpAddresses': [
                            {
                                'PrivateIpAddress': 'string',
                                'Primary': True|False
                            },
                        ],
                        'SecondaryPrivateIpAddressCount': 123,
                        'AssociatePublicIpAddress': True|False
                    },
                ],
                'IamInstanceProfile': {
                    'Arn': 'string',
                    'Name': 'string'
                },
                'EbsOptimized': True|False,
                'Monitoring': {
                    'Enabled': True|False
                }
            },
            'InstanceId': 'string',
            'CreateTime': datetime(2015, 1, 1),
            'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'LaunchedAvailabilityZone': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • SpotInstanceRequests (list) --

      One or more Spot Instance requests.

      • (dict) --

        Describe a Spot Instance request.

        • SpotInstanceRequestId (string) --

          The ID of the Spot Instance request.

        • SpotPrice (string) --

          The maximum hourly price (bid) for any Spot Instance launched to fulfill the request.

        • Type (string) --

          The Spot Instance request type.

        • State (string) --

          The state of the Spot Instance request. Spot bid status information can help you track your Spot Instance requests. For more information, see Spot Bid Status in the Amazon Elastic Compute Cloud User Guide for Linux.

        • 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.

        • Status (dict) --

          The status code and status message describing the Spot Instance request.

          • Code (string) --

            The status code.

          • UpdateTime (datetime) --

            The time of the most recent status update.

          • Message (string) --

            The description for the status code.

        • ValidFrom (datetime) --

          The start date of the request. If this is a one-time request, the request becomes active at this date and time and remains active until all instances launch, the request expires, or the request is canceled. If the request is persistent, the request becomes active at this date and time and remains active until it expires or is canceled.

        • ValidUntil (datetime) --

          The end date of the request. If this is 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 is reached.

        • LaunchGroup (string) --

          The instance launch group. Launch groups are Spot Instances that launch together and terminate together.

        • 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.

        • LaunchSpecification (dict) --

          Additional information for launching instances.

          • ImageId (string) --

            The ID of the AMI.

          • KeyName (string) --

            The name of the key pair.

          • SecurityGroups (list) --

            One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.

            • (dict) --

              Describes a security group.

              • GroupName (string) --

                The name of the security group.

              • GroupId (string) --

                The ID of the security group.

          • UserData (string) --

            The Base64-encoded MIME user data to make available to the instances.

          • AddressingType (string) --

            Deprecated.

          • InstanceType (string) --

            The instance type.

          • Placement (dict) --

            The placement information for the instance.

            • AvailabilityZone (string) --

              The Availability Zone.

            • GroupName (string) --

              The name of the placement group (for cluster instances).

          • KernelId (string) --

            The ID of the kernel.

          • RamdiskId (string) --

            The ID of the RAM disk.

          • BlockDeviceMappings (list) --

            One or more block device mapping entries.

            • (dict) --

              Describes a block device mapping.

              • 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.

                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.

              • DeviceName (string) --

                The device name exposed to the instance (for example, /dev/sdh or xvdh).

              • Ebs (dict) --

                Parameters used to automatically set up Amazon EBS volumes when the instance is launched.

                • SnapshotId (string) --

                  The ID of the snapshot.

                • VolumeSize (integer) --

                  The size of the volume, in GiB.

                  Constraints: 1-1024 for standard volumes, 1-16384 for gp2 volumes, and 4-16384 for io1 volumes. 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.

                • DeleteOnTermination (boolean) --

                  Indicates whether the Amazon EBS volume is deleted on instance termination.

                • VolumeType (string) --

                  The volume type. gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic volumes.

                  Default: standard

                • 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 on General Purpose (SSD) baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide for Linux.

                  Constraint: Range is 100 to 20000 for Provisioned IOPS (SSD) volumes and 3 to 10000 for General Purpose (SSD) volumes.

                  Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create standard or gp2 volumes.

                • Encrypted (boolean) --

                  Indicates whether the Amazon EBS volume is encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption.

              • NoDevice (string) --

                Suppresses the specified device included in the block device mapping of the AMI.

          • SubnetId (string) --

            The ID of the subnet in which to launch the instance.

          • NetworkInterfaces (list) --

            One or more network interfaces.

            • (dict) --

              Describes a network interface.

              • NetworkInterfaceId (string) --

                The ID of the network interface.

              • DeviceIndex (integer) --

                The index of the device on the instance for the network interface attachment. If you are specifying a network interface in a RunInstances request, you must provide the device index.

              • SubnetId (string) --

                The ID of the subnet associated with the network string. Applies only if creating a 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.

              • PrivateIpAddress (string) --

                The private IP address of the network interface. Applies only if creating a network interface when launching an instance.

              • Groups (list) --

                The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.

                • (string) --

              • 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.

              • PrivateIpAddresses (list) --

                One or more private IP addresses to assign to the network interface. Only one private IP address can be designated as primary.

                • (dict) --

                  Describes a secondary private IP address for a network interface.

                  • PrivateIpAddress (string) --

                    The private IP addresses.

                  • Primary (boolean) --

                    Indicates whether the private IP address is the primary private IP address. Only one IP address can be designated as primary.

              • SecondaryPrivateIpAddressCount (integer) --

                The number of secondary private IP addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option.

              • AssociatePublicIpAddress (boolean) --

                Indicates whether to assign a public IP 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.

          • 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.

          • 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

          • Monitoring (dict) --

            Describes the monitoring for the instance.

            • Enabled (boolean) --

              Indicates whether monitoring is enabled for the instance.

        • InstanceId (string) --

          The instance ID, if an instance has been launched to fulfill the Spot Instance request.

        • CreateTime (datetime) --

          The time stamp when the Spot Instance request was created.

        • ProductDescription (string) --

          The product description associated with the Spot 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.

        • LaunchedAvailabilityZone (string) --

          The Availability Zone in which the bid is launched.

CancelImportTask (new) Link ¶

Cancels an in-process import virtual machine or import snapshot task.

Request Syntax

client.cancel_import_task(
    DryRun=True|False,
    ImportTaskId='string',
    CancelReason='string'
)
type DryRun:

boolean

param DryRun:

type ImportTaskId:

string

param ImportTaskId:

The ID of the ImportImage or ImportSnapshot task to be cancelled.

type CancelReason:

string

param CancelReason:

The reason for canceling the task.

rtype:

dict

returns:

Response Syntax

{
    'ImportTaskId': 'string',
    'State': 'string',
    'PreviousState': 'string'
}

Response Structure

  • (dict) --

    • ImportTaskId (string) --

      The task ID of the ImportImage or ImportSnapshot task being canceled.

    • State (string) --

      The current state of the ImportImage or ImportSnapshot task being canceled.

    • PreviousState (string) --

      The current state of the ImportImage or ImportSnapshot task being canceled.

AllocateAddress (new) Link ¶

Acquires an Elastic IP address.

An Elastic IP address is for use either in the EC2-Classic platform or in a VPC. For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.allocate_address(
    DryRun=True|False,
    Domain='vpc'|'standard'
)
type DryRun:

boolean

param DryRun:

type Domain:

string

param Domain:

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.

rtype:

dict

returns:

Response Syntax

{
    'PublicIp': 'string',
    'Domain': 'vpc'|'standard',
    'AllocationId': 'string'
}

Response Structure

  • (dict) --

    • PublicIp (string) --

      The Elastic IP address.

    • Domain (string) --

      Indicates whether this Elastic IP address is for use with instances in EC2-Classic ( standard) or instances in a VPC ( vpc).

    • 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.

DescribeBundleTasks (new) Link ¶

Describes one or more of your bundling tasks.

Request Syntax

client.describe_bundle_tasks(
    DryRun=True|False,
    BundleIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type BundleIds:

list

param BundleIds:

One or more bundle task IDs.

Default: Describes all your bundle tasks.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • bundle-id - The ID of the bundle task.

  • error-code - If the task failed, the error code returned.

  • error-message - If the task failed, the error message returned.

  • instance-id - The ID of the instance.

  • progress - The level of task completion, as a percentage (for example, 20%).

  • s3-bucket - The Amazon S3 bucket to store the AMI.

  • s3-prefix - The beginning of the AMI name.

  • start-time - The time the task started (for example, 2013-09-15T17:15:20.000Z).

  • state - The state of the task ( pending | waiting-for-shutdown | bundling | storing | cancelling | complete | failed).

  • update-time - The time of the most recent update for the task.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'BundleTasks': [
        {
            'InstanceId': 'string',
            'BundleId': 'string',
            'State': 'pending'|'waiting-for-shutdown'|'bundling'|'storing'|'cancelling'|'complete'|'failed',
            'StartTime': datetime(2015, 1, 1),
            'UpdateTime': datetime(2015, 1, 1),
            'Storage': {
                'S3': {
                    'Bucket': 'string',
                    'Prefix': 'string',
                    'AWSAccessKeyId': 'string',
                    'UploadPolicy': b'bytes',
                    'UploadPolicySignature': 'string'
                }
            },
            'Progress': 'string',
            'BundleTaskError': {
                'Code': 'string',
                'Message': 'string'
            }
        },
    ]
}

Response Structure

  • (dict) --

    • BundleTasks (list) --

      Information about one or more bundle tasks.

      • (dict) --

        Describes a bundle task.

        • InstanceId (string) --

          The ID of the instance associated with this bundle task.

        • BundleId (string) --

          The ID of the bundle task.

        • State (string) --

          The state of the task.

        • StartTime (datetime) --

          The time this task started.

        • UpdateTime (datetime) --

          The time of the most recent update for the task.

        • Storage (dict) --

          The Amazon S3 storage locations.

          • S3 (dict) --

            An Amazon S3 storage location.

            • 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.

            • 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.

            • UploadPolicy (bytes) --

              A Base64-encoded Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.

            • UploadPolicySignature (string) --

              The signature of the Base64 encoded JSON document.

        • Progress (string) --

          The level of task completion, as a percent (for example, 20%).

        • BundleTaskError (dict) --

          If the task fails, a description of the error.

          • Code (string) --

            The error code.

          • Message (string) --

            The error message.

ModifySubnetAttribute (new) Link ¶

Modifies a subnet attribute.

Request Syntax

client.modify_subnet_attribute(
    SubnetId='string',
    MapPublicIpOnLaunch={
        'Value': True|False
    }
)
type SubnetId:

string

param SubnetId:

[REQUIRED]

The ID of the subnet.

type MapPublicIpOnLaunch:

dict

param MapPublicIpOnLaunch:

Specify true to indicate that instances launched into the specified subnet should be assigned public IP address.

  • Value (boolean) --

    Valid values are true or false.

returns:

None

CreateVpnConnectionRoute (new) Link ¶

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 about VPN connections, see Adding a Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.create_vpn_connection_route(
    VpnConnectionId='string',
    DestinationCidrBlock='string'
)
type VpnConnectionId:

string

param VpnConnectionId:

[REQUIRED]

The ID of the VPN connection.

type DestinationCidrBlock:

string

param DestinationCidrBlock:

[REQUIRED]

The CIDR block associated with the local subnet of the customer network.

returns:

None

DisassociateRouteTable (new) Link ¶

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.

Request Syntax

client.disassociate_route_table(
    DryRun=True|False,
    AssociationId='string'
)
type DryRun:

boolean

param DryRun:

type AssociationId:

string

param AssociationId:

[REQUIRED]

The association ID representing the current association between the route table and subnet.

returns:

None

DescribeKeyPairs (new) Link ¶

Describes one or more of your key pairs.

For more information about key pairs, see Key Pairs in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.describe_key_pairs(
    DryRun=True|False,
    KeyNames=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type KeyNames:

list

param KeyNames:

One or more key pair names.

Default: Describes all your key pairs.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • fingerprint - The fingerprint of the key pair.

  • key-name - The name of the key pair.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'KeyPairs': [
        {
            'KeyName': 'string',
            'KeyFingerprint': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • KeyPairs (list) --

      Information about one or more key pairs.

      • (dict) --

        Describes a key pair.

        • KeyName (string) --

          The name of the 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.

DeleteVpcPeeringConnection (new) Link ¶

Deletes a VPC peering connection. Either the owner of the requester VPC or the owner of the peer 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.

Request Syntax

client.delete_vpc_peering_connection(
    DryRun=True|False,
    VpcPeeringConnectionId='string'
)
type DryRun:

boolean

param DryRun:

type VpcPeeringConnectionId:

string

param VpcPeeringConnectionId:

[REQUIRED]

The ID of the VPC peering connection.

rtype:

dict

returns:

Response Syntax

{
    'Return': True|False
}

Response Structure

  • (dict) --

    • Return (boolean) --

      Returns true if the request succeeds; otherwise, it returns an error.

DescribeDhcpOptions (new) Link ¶

Describes one or more of your DHCP options sets.

For more information about DHCP options sets, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.describe_dhcp_options(
    DryRun=True|False,
    DhcpOptionsIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type DhcpOptionsIds:

list

param DhcpOptionsIds:

The IDs of one or more DHCP options sets.

Default: Describes all your DHCP options sets.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • dhcp-options-id - The ID of a set of DHCP options.

  • key - The key for one of the options (for example, domain-name).

  • value - The value for one of the options.

  • tag:key*=*value - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key*=*value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'DhcpOptions': [
        {
            'DhcpOptionsId': 'string',
            'DhcpConfigurations': [
                {
                    'Key': 'string',
                    'Values': [
                        {
                            'Value': '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.

        • DhcpOptionsId (string) --

          The ID of the 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) --

                The value to use for a resource attribute.

                • Value (string) --

                  Valid values are case-sensitive and vary by action.

        • 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.

DeleteKeyPair (new) Link ¶

Deletes the specified key pair, by removing the public key from Amazon EC2.

Request Syntax

client.delete_key_pair(
    DryRun=True|False,
    KeyName='string'
)
type DryRun:

boolean

param DryRun:

type KeyName:

string

param KeyName:

[REQUIRED]

The name of the key pair.

returns:

None

CopyImage (new) Link ¶

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. AMIs that use encrypted Amazon EBS snapshots cannot be copied with this method.

For more information, see Copying AMIs in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.copy_image(
    DryRun=True|False,
    SourceRegion='string',
    SourceImageId='string',
    Name='string',
    Description='string',
    ClientToken='string'
)
type DryRun:

boolean

param DryRun:

type SourceRegion:

string

param SourceRegion:

[REQUIRED]

The name of the region that contains the AMI to copy.

type SourceImageId:

string

param SourceImageId:

[REQUIRED]

The ID of the AMI to copy.

type Name:

string

param Name:

[REQUIRED]

The name of the new AMI in the destination region.

type Description:

string

param Description:

A description for the new AMI in the destination region.

type ClientToken:

string

param ClientToken:

Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide for Linux.

rtype:

dict

returns:

Response Syntax

{
    'ImageId': 'string'
}

Response Structure

  • (dict) --

    • ImageId (string) --

      The ID of the new AMI.

DescribeReservedInstancesListings (new) Link ¶

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 for Linux.

Request Syntax

client.describe_reserved_instances_listings(
    ReservedInstancesId='string',
    ReservedInstancesListingId='string',
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type ReservedInstancesId:

string

param ReservedInstancesId:

One or more Reserved Instance IDs.

type ReservedInstancesListingId:

string

param ReservedInstancesListingId:

One or more Reserved Instance Listing IDs.

type Filters:

list

param Filters:

One or more filters.

  • reserved-instances-id - The ID of the Reserved Instances.

  • reserved-instances-listing-id - The ID of the Reserved Instances listing.

  • status - The status of the Reserved Instance listing ( pending | active | cancelled | closed).

  • status-message - The reason for the status.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'ReservedInstancesListings': [
        {
            'ReservedInstancesListingId': 'string',
            'ReservedInstancesId': 'string',
            'CreateDate': datetime(2015, 1, 1),
            'UpdateDate': datetime(2015, 1, 1),
            'Status': 'active'|'pending'|'cancelled'|'closed',
            'StatusMessage': 'string',
            'InstanceCounts': [
                {
                    'State': 'available'|'sold'|'cancelled'|'pending',
                    'InstanceCount': 123
                },
            ],
            'PriceSchedules': [
                {
                    'Term': 123,
                    'Price': 123.0,
                    'CurrencyCode': 'USD',
                    'Active': True|False
                },
            ],
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'ClientToken': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • ReservedInstancesListings (list) --

      Information about the Reserved Instance listing.

      • (dict) --

        Describes a Reserved Instance listing.

        • ReservedInstancesListingId (string) --

          The ID of the Reserved Instance listing.

        • ReservedInstancesId (string) --

          The ID of the Reserved Instance.

        • CreateDate (datetime) --

          The time the listing was created.

        • UpdateDate (datetime) --

          The last modified timestamp of the 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.

        • InstanceCounts (list) --

          The number of instances in this state.

          • (dict) --

            Describes a Reserved Instance listing state.

            • State (string) --

              The states of the listed Reserved Instances.

            • InstanceCount (integer) --

              he number of listed Reserved Instances in the state specified by the state.

        • PriceSchedules (list) --

          The price of the Reserved Instance listing.

          • (dict) --

            Describes the price for a Reserved Instance.

            • 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.

            • Price (float) --

              The fixed price for the term.

            • CurrencyCode (string) --

              The currency for transacting the Reserved Instance resale. At this time, the only supported currency is USD.

            • 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.

        • 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.

        • ClientToken (string) --

          A unique, case-sensitive key supplied by the client to ensure that the request is idempotent. For more information, see Ensuring Idempotency.

DescribeAddresses (new) Link ¶

Describes one or more 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 for Linux.

Request Syntax

client.describe_addresses(
    DryRun=True|False,
    PublicIps=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    AllocationIds=[
        'string',
    ]
)
type DryRun:

boolean

param DryRun:

type PublicIps:

list

param PublicIps:

[EC2-Classic] One or more Elastic IP addresses.

Default: Describes all your Elastic IP addresses.

  • (string) --

type Filters:

list

param Filters:

One or more filters. Filter names and values are case-sensitive.

  • allocation-id - [EC2-VPC] The allocation ID for the address.

  • association-id - [EC2-VPC] The association ID for the address.

  • domain - Indicates whether the address is for use in EC2-Classic ( standard) or in a VPC ( vpc).

  • instance-id - The ID of the instance the address is associated with, if any.

  • network-interface-id - [EC2-VPC] The ID of the network interface that the address is associated with, if any.

  • network-interface-owner-id - The AWS account ID of the owner.

  • private-ip-address - [EC2-VPC] The private IP address associated with the Elastic IP address.

  • public-ip - The Elastic IP address.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

type AllocationIds:

list

param AllocationIds:

[EC2-VPC] One or more allocation IDs.

Default: Describes all your Elastic IP addresses.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'Addresses': [
        {
            'InstanceId': 'string',
            'PublicIp': 'string',
            'AllocationId': 'string',
            'AssociationId': 'string',
            'Domain': 'vpc'|'standard',
            'NetworkInterfaceId': 'string',
            'NetworkInterfaceOwnerId': 'string',
            'PrivateIpAddress': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • Addresses (list) --

      Information about one or more Elastic IP addresses.

      • (dict) --

        Describes an Elastic IP address.

        • InstanceId (string) --

          The ID of the instance 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.

DescribeNetworkInterfaces (new) Link ¶

Describes one or more of your network interfaces.

Request Syntax

client.describe_network_interfaces(
    DryRun=True|False,
    NetworkInterfaceIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type NetworkInterfaceIds:

list

param NetworkInterfaceIds:

One or more network interface IDs.

Default: Describes all your network interfaces.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • addresses.private-ip-address - The private IP addresses associated with the network interface.

  • addresses.primary - Whether the private IP address is the primary IP address associated with the network interface.

  • addresses.association.public-ip - The association ID returned when the network interface was associated with the Elastic IP address.

  • addresses.association.owner-id - The owner ID of the addresses associated with the network interface.

  • association.association-id - The association ID returned when the network interface was associated with an IP address.

  • association.allocation-id - The allocation ID returned when you allocated the Elastic IP address for your network interface.

  • association.ip-owner-id - The owner of the Elastic IP address associated with the network interface.

  • association.public-ip - The address of the Elastic IP address bound to the network interface.

  • association.public-dns-name - The public DNS name for the network interface.

  • attachment.attachment-id - The ID of the interface attachment.

  • attachment.instance-id - The ID of the instance to which the network interface is attached.

  • attachment.instance-owner-id - The owner ID of the instance to which the network interface is attached.

  • attachment.device-index - The device index to which the network interface is attached.

  • attachment.status - The status of the attachment ( attaching | attached | detaching | detached).

  • attachment.attach.time - The time that the network interface was attached to an instance.

  • attachment.delete-on-termination - Indicates whether the attachment is deleted when an instance is terminated.

  • availability-zone - The Availability Zone of the network interface.

  • description - The description of the network interface.

  • group-id - The ID of a security group associated with the network interface.

  • group-name - The name of a security group associated with the network interface.

  • mac-address - The MAC address of the network interface.

  • network-interface-id - The ID of the network interface.

  • owner-id - The AWS account ID of the network interface owner.

  • private-ip-address - The private IP address or addresses of the network interface.

  • private-dns-name - The private DNS name of the network interface.

  • requester-id - The ID of the entity that launched the instance on your behalf (for example, AWS Management Console, Auto Scaling, and so on).

  • requester-managed - Indicates whether the network interface is being managed by an AWS service (for example, AWS Management Console, Auto Scaling, and so on).

  • source-desk-check - Indicates whether the network interface performs source/destination checking. A value of true means checking is enabled, and false means checking is disabled. The value must be false for the network interface to perform Network Address Translation (NAT) in your VPC.

  • status - The status of the network interface. If the network interface is not attached to an instance, the status is available; if a network interface is attached to an instance the status is in-use.

  • subnet-id - The ID of the subnet for the network interface.

  • tag:key*=*value - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key*=*value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • vpc-id - The ID of the VPC for the network interface.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'NetworkInterfaces': [
        {
            'NetworkInterfaceId': 'string',
            'SubnetId': 'string',
            'VpcId': 'string',
            'AvailabilityZone': 'string',
            'Description': 'string',
            'OwnerId': 'string',
            'RequesterId': 'string',
            'RequesterManaged': True|False,
            'Status': 'available'|'attaching'|'in-use'|'detaching',
            'MacAddress': 'string',
            'PrivateIpAddress': 'string',
            'PrivateDnsName': 'string',
            'SourceDestCheck': True|False,
            'Groups': [
                {
                    'GroupName': 'string',
                    'GroupId': 'string'
                },
            ],
            'Attachment': {
                'AttachmentId': 'string',
                'InstanceId': 'string',
                'InstanceOwnerId': 'string',
                'DeviceIndex': 123,
                'Status': 'attaching'|'attached'|'detaching'|'detached',
                'AttachTime': datetime(2015, 1, 1),
                'DeleteOnTermination': True|False
            },
            'Association': {
                'PublicIp': 'string',
                'PublicDnsName': 'string',
                'IpOwnerId': 'string',
                'AllocationId': 'string',
                'AssociationId': 'string'
            },
            'TagSet': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'PrivateIpAddresses': [
                {
                    'PrivateIpAddress': 'string',
                    'PrivateDnsName': 'string',
                    'Primary': True|False,
                    'Association': {
                        'PublicIp': 'string',
                        'PublicDnsName': 'string',
                        'IpOwnerId': 'string',
                        'AllocationId': 'string',
                        'AssociationId': 'string'
                    }
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • NetworkInterfaces (list) --

      Information about one or more network interfaces.

      • (dict) --

        Describes a network interface.

        • NetworkInterfaceId (string) --

          The ID of the network interface.

        • SubnetId (string) --

          The ID of the subnet.

        • VpcId (string) --

          The ID of the VPC.

        • AvailabilityZone (string) --

          The Availability Zone.

        • Description (string) --

          A description.

        • OwnerId (string) --

          The AWS account ID of the owner of the network interface.

        • 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.

        • Status (string) --

          The status of the network interface.

        • MacAddress (string) --

          The MAC address.

        • PrivateIpAddress (string) --

          The IP address of the network interface within the subnet.

        • PrivateDnsName (string) --

          The private DNS name.

        • SourceDestCheck (boolean) --

          Indicates whether traffic to or from the instance is validated.

        • 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.

        • Attachment (dict) --

          The network interface attachment.

          • AttachmentId (string) --

            The ID of the network interface attachment.

          • InstanceId (string) --

            The ID of the instance.

          • InstanceOwnerId (string) --

            The AWS account ID of the owner of the instance.

          • DeviceIndex (integer) --

            The device index of the network interface attachment on the instance.

          • Status (string) --

            The attachment state.

          • AttachTime (datetime) --

            The timestamp indicating when the attachment initiated.

          • DeleteOnTermination (boolean) --

            Indicates whether the network interface is deleted when the instance is terminated.

        • Association (dict) --

          The association information for an Elastic IP associated with the network interface.

          • PublicIp (string) --

            The address of the Elastic IP address bound to the network interface.

          • PublicDnsName (string) --

            The public DNS name.

          • IpOwnerId (string) --

            The ID of the Elastic IP address owner.

          • AllocationId (string) --

            The allocation ID.

          • AssociationId (string) --

            The association ID.

        • 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.

        • PrivateIpAddresses (list) --

          The private IP addresses associated with the network interface.

          • (dict) --

            Describes the private IP address of a network interface.

            • PrivateIpAddress (string) --

              The private IP address.

            • PrivateDnsName (string) --

              The private DNS name.

            • Primary (boolean) --

              Indicates whether this IP address is the primary private IP address of the network interface.

            • Association (dict) --

              The association information for an Elastic IP address associated with the network interface.

              • PublicIp (string) --

                The address of the Elastic IP address bound to the network interface.

              • PublicDnsName (string) --

                The public DNS name.

              • IpOwnerId (string) --

                The ID of the Elastic IP address owner.

              • AllocationId (string) --

                The allocation ID.

              • AssociationId (string) --

                The association ID.

DescribeAccountAttributes (new) Link ¶

Describes attributes of your AWS account. The following are the supported account attributes:

  • supported-platforms: Indicates whether your account can launch instances into EC2-Classic and EC2-VPC, or only into EC2-VPC.

  • default-vpc: The ID of the default VPC for your account, or none.

  • max-instances: The maximum number of On-Demand instances that you can run.

  • vpc-max-security-groups-per-interface: The maximum number of security groups that you can assign to a network interface.

  • max-elastic-ips: The maximum number of Elastic IP addresses that you can allocate for use with EC2-Classic.

  • vpc-max-elastic-ips: The maximum number of Elastic IP addresses that you can allocate for use with EC2-VPC.

Request Syntax

client.describe_account_attributes(
    DryRun=True|False,
    AttributeNames=[
        'supported-platforms'|'default-vpc',
    ]
)
type DryRun:

boolean

param DryRun:

type AttributeNames:

list

param AttributeNames:

One or more account attribute names.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'AccountAttributes': [
        {
            'AttributeName': 'string',
            'AttributeValues': [
                {
                    'AttributeValue': 'string'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • AccountAttributes (list) --

      Information about one or more account attributes.

      • (dict) --

        Describes an account attribute.

        • AttributeName (string) --

          The name of the account attribute.

        • AttributeValues (list) --

          One or more values for the account attribute.

          • (dict) --

            Describes a value of an account attribute.

            • AttributeValue (string) --

              The value of the attribute.

DeleteVpc (new) Link ¶

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.

Request Syntax

client.delete_vpc(
    DryRun=True|False,
    VpcId='string'
)
type DryRun:

boolean

param DryRun:

type VpcId:

string

param VpcId:

[REQUIRED]

The ID of the VPC.

returns:

None

DeregisterImage (new) Link ¶

Deregisters the specified AMI. After you deregister an AMI, it can't be used to launch new instances.

This command does not delete the AMI.

Request Syntax

client.deregister_image(
    DryRun=True|False,
    ImageId='string'
)
type DryRun:

boolean

param DryRun:

type ImageId:

string

param ImageId:

[REQUIRED]

The ID of the AMI.

returns:

None

DescribeCustomerGateways (new) Link ¶

Describes one or more of your VPN customer gateways.

For more information about VPN customer gateways, see Adding a Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.describe_customer_gateways(
    DryRun=True|False,
    CustomerGatewayIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type CustomerGatewayIds:

list

param CustomerGatewayIds:

One or more customer gateway IDs.

Default: Describes all your customer gateways.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • bgp-asn - The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).

  • customer-gateway-id - The ID of the customer gateway.

  • ip-address - The IP address of the customer gateway's Internet-routable external interface.

  • state - The state of the customer gateway ( pending | available | deleting | deleted).

  • type - The type of customer gateway. Currently, the only supported type is ipsec.1.

  • tag:key*=*value - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key*=*value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'CustomerGateways': [
        {
            'CustomerGatewayId': 'string',
            'State': 'string',
            'Type': 'string',
            'IpAddress': 'string',
            'BgpAsn': 'string',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • CustomerGateways (list) --

      Information about one or more customer gateways.

      • (dict) --

        Describes a customer gateway.

        • CustomerGatewayId (string) --

          The ID of the customer gateway.

        • 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).

        • IpAddress (string) --

          The Internet-routable IP address of the customer gateway's outside interface.

        • BgpAsn (string) --

          The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).

        • 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.

DescribeExportTasks (new) Link ¶

Describes one or more of your export tasks.

Request Syntax

client.describe_export_tasks(
    ExportTaskIds=[
        'string',
    ]
)
type ExportTaskIds:

list

param ExportTaskIds:

One or more export task IDs.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'ExportTasks': [
        {
            'ExportTaskId': 'string',
            'Description': 'string',
            'State': 'active'|'cancelling'|'cancelled'|'completed',
            'StatusMessage': 'string',
            'InstanceExportDetails': {
                'InstanceId': 'string',
                'TargetEnvironment': 'citrix'|'vmware'|'microsoft'
            },
            'ExportToS3Task': {
                'DiskImageFormat': 'VMDK'|'RAW'|'VHD',
                'ContainerFormat': 'ova',
                'S3Bucket': 'string',
                'S3Key': 'string'
            }
        },
    ]
}

Response Structure

  • (dict) --

    • ExportTasks (list) --

      • (dict) --

        Describes an export task.

        • ExportTaskId (string) --

          The ID of the export task.

        • Description (string) --

          A description of the resource being exported.

        • State (string) --

          The state of the conversion task.

        • StatusMessage (string) --

          The status message related to the export task.

        • InstanceExportDetails (dict) --

          The instance being exported.

          • InstanceId (string) --

            The ID of the resource being exported.

          • TargetEnvironment (string) --

            The target virtualization environment.

        • ExportToS3Task (dict) --

          • DiskImageFormat (string) --

            The format for the exported image.

          • ContainerFormat (string) --

            The container format used to combine disk images with metadata (such as OVF). If absent, only the disk image is exported.

          • S3Bucket (string) --

            The Amazon 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) --

DescribeVpnGateways (new) Link ¶

Describes one or more of your virtual private gateways.

For more information about virtual private gateways, see Adding an IPsec Hardware VPN to Your VPC in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.describe_vpn_gateways(
    DryRun=True|False,
    VpnGatewayIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type VpnGatewayIds:

list

param VpnGatewayIds:

One or more virtual private gateway IDs.

Default: Describes all your virtual private gateways.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • attachment.state - The current state of the attachment between the gateway and the VPC ( attaching | attached | detaching | detached).

  • attachment.vpc-id - The ID of an attached VPC.

  • availability-zone - The Availability Zone for the virtual private gateway.

  • state - The state of the virtual private gateway ( pending | available | deleting | deleted).

  • tag:key*=*value - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key*=*value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • type - The type of virtual private gateway. Currently the only supported type is ipsec.1.

  • vpn-gateway-id - The ID of the virtual private gateway.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'VpnGateways': [
        {
            'VpnGatewayId': 'string',
            'State': 'pending'|'available'|'deleting'|'deleted',
            'Type': 'ipsec.1',
            'AvailabilityZone': 'string',
            'VpcAttachments': [
                {
                    'VpcId': 'string',
                    'State': 'attaching'|'attached'|'detaching'|'detached'
                },
            ],
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • VpnGateways (list) --

      Information about one or more virtual private gateways.

      • (dict) --

        Describes a virtual private gateway.

        • VpnGatewayId (string) --

          The ID of the virtual private gateway.

        • State (string) --

          The current state of the virtual private gateway.

        • Type (string) --

          The type of VPN connection the virtual private gateway supports.

        • AvailabilityZone (string) --

          The Availability Zone where the virtual private gateway was created.

        • VpcAttachments (list) --

          Any VPCs attached to the virtual private gateway.

          • (dict) --

            Describes an attachment between a virtual private gateway and a VPC.

            • VpcId (string) --

              The ID of the VPC.

            • State (string) --

              The current state of the attachment.

        • 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.

DeleteVolume (new) Link ¶

Deletes the specified Amazon EBS volume. The volume must be in the available state (not attached to an instance).

For more information, see Deleting an Amazon EBS Volume in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.delete_volume(
    DryRun=True|False,
    VolumeId='string'
)
type DryRun:

boolean

param DryRun:

type VolumeId:

string

param VolumeId:

[REQUIRED]

The ID of the volume.

returns:

None

DescribeVpcAttribute (new) Link ¶

Describes the specified attribute of the specified VPC. You can specify only one attribute at a time.

Request Syntax

client.describe_vpc_attribute(
    DryRun=True|False,
    VpcId='string',
    Attribute='enableDnsSupport'|'enableDnsHostnames'
)
type DryRun:

boolean

param DryRun:

type VpcId:

string

param VpcId:

[REQUIRED]

The ID of the VPC.

type Attribute:

string

param Attribute:

The VPC attribute.

rtype:

dict

returns:

Response Syntax

{
    'VpcId': 'string',
    'EnableDnsSupport': {
        'Value': True|False
    },
    'EnableDnsHostnames': {
        'Value': True|False
    }
}

Response Structure

  • (dict) --

    • VpcId (string) --

      The ID of the VPC.

    • 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) --

        Valid values are true or false.

    • 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) --

        Valid values are true or false.

ReplaceRoute (new) Link ¶

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, VPC peering connection, or network interface.

For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.replace_route(
    DryRun=True|False,
    RouteTableId='string',
    DestinationCidrBlock='string',
    GatewayId='string',
    InstanceId='string',
    NetworkInterfaceId='string',
    VpcPeeringConnectionId='string'
)
type DryRun:

boolean

param DryRun:

type RouteTableId:

string

param RouteTableId:

[REQUIRED]

The ID of the route table.

type DestinationCidrBlock:

string

param DestinationCidrBlock:

[REQUIRED]

The CIDR address block used for the destination match. The value you provide must match the CIDR of an existing route in the table.

type GatewayId:

string

param GatewayId:

The ID of an Internet gateway or virtual private gateway.

type InstanceId:

string

param InstanceId:

The ID of a NAT instance in your VPC.

type NetworkInterfaceId:

string

param NetworkInterfaceId:

The ID of a network interface.

type VpcPeeringConnectionId:

string

param VpcPeeringConnectionId:

The ID of a VPC peering connection.

returns:

None

DescribeReservedInstancesOfferings (new) Link ¶

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.

For more information, see Reserved Instance Marketplace in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.describe_reserved_instances_offerings(
    DryRun=True|False,
    ReservedInstancesOfferingIds=[
        'string',
    ],
    InstanceType='t1.micro'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'t2.micro'|'t2.small'|'t2.medium'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'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'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'cg1.4xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge',
    AvailabilityZone='string',
    ProductDescription='Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    InstanceTenancy='default'|'dedicated',
    OfferingType='Heavy Utilization'|'Medium Utilization'|'Light Utilization'|'No Upfront'|'Partial Upfront'|'All Upfront',
    NextToken='string',
    MaxResults=123,
    IncludeMarketplace=True|False,
    MinDuration=123,
    MaxDuration=123,
    MaxInstanceCount=123
)
type DryRun:

boolean

param DryRun:

type ReservedInstancesOfferingIds:

list

param ReservedInstancesOfferingIds:

One or more Reserved Instances offering IDs.

  • (string) --

type InstanceType:

string

param InstanceType:

The instance type on which the Reserved Instance can be used. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide for Linux.

type AvailabilityZone:

string

param AvailabilityZone:

The Availability Zone in which the Reserved Instance can be used.

type ProductDescription:

string

param ProductDescription:

The Reserved Instance description. Instances that include (Amazon VPC) in the description are for use with Amazon VPC.

type Filters:

list

param Filters:

One or more filters.

  • availability-zone - The Availability Zone where the Reserved Instance can be used.

  • duration - The duration of the Reserved Instance (for example, one year or three years), in seconds ( 31536000 | 94608000).

  • fixed-price - The purchase price of the Reserved Instance (for example, 9800.0).

  • instance-type - The instance type on which the Reserved Instance can be used.

  • marketplace - Set to true to show only Reserved Instance Marketplace offerings. When this filter is not used, which is the default behavior, all offerings from AWS and Reserved Instance Marketplace are listed.

  • product-description - The description of the Reserved Instance ( Linux/UNIX | Linux/UNIX (Amazon VPC) | Windows | Windows (Amazon VPC)).

  • reserved-instances-offering-id - The Reserved Instances offering ID.

  • usage-price - The usage price of the Reserved Instance, per hour (for example, 0.84).

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

type InstanceTenancy:

string

param InstanceTenancy:

The tenancy of the Reserved Instance offering. A Reserved Instance with dedicated tenancy runs on single-tenant hardware and can only be launched within a VPC.

Default: default

type OfferingType:

string

param OfferingType:

The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the Medium Utilization Reserved Instance offering type.

type NextToken:

string

param NextToken:

The token to retrieve the next page of results.

type MaxResults:

integer

param MaxResults:

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

type IncludeMarketplace:

boolean

param IncludeMarketplace:

Include Marketplace offerings in the response.

type MinDuration:

integer

param MinDuration:

The minimum duration (in seconds) to filter when searching for offerings.

Default: 2592000 (1 month)

type MaxDuration:

integer

param MaxDuration:

The maximum duration (in seconds) to filter when searching for offerings.

Default: 94608000 (3 years)

type MaxInstanceCount:

integer

param MaxInstanceCount:

The maximum number of instances to filter when searching for offerings.

Default: 20

rtype:

dict

returns:

Response Syntax

{
    'ReservedInstancesOfferings': [
        {
            'ReservedInstancesOfferingId': 'string',
            'InstanceType': 't1.micro'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'t2.micro'|'t2.small'|'t2.medium'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'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'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'cg1.4xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge',
            'AvailabilityZone': 'string',
            'Duration': 123,
            'UsagePrice': ...,
            'FixedPrice': ...,
            'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
            'InstanceTenancy': 'default'|'dedicated',
            'CurrencyCode': 'USD',
            'OfferingType': 'Heavy Utilization'|'Medium Utilization'|'Light Utilization'|'No Upfront'|'Partial Upfront'|'All Upfront',
            'RecurringCharges': [
                {
                    'Frequency': 'Hourly',
                    'Amount': 123.0
                },
            ],
            'Marketplace': True|False,
            'PricingDetails': [
                {
                    'Price': 123.0,
                    'Count': 123
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • ReservedInstancesOfferings (list) --

      A list of Reserved Instances offerings.

      • (dict) --

        Describes a Reserved Instance offering.

        • ReservedInstancesOfferingId (string) --

          The ID of the Reserved Instance offering.

        • InstanceType (string) --

          The instance type on which the Reserved Instance can be used.

        • AvailabilityZone (string) --

          The Availability Zone in which the Reserved Instance can be used.

        • Duration (integer) --

          The duration of the Reserved Instance, in seconds.

        • UsagePrice (float) --

          The usage price of the Reserved Instance, per hour.

        • FixedPrice (float) --

          The purchase price of the Reserved Instance.

        • ProductDescription (string) --

          The Reserved Instance description.

        • InstanceTenancy (string) --

          The tenancy of the reserved instance.

        • 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.

        • OfferingType (string) --

          The Reserved Instance offering type.

        • RecurringCharges (list) --

          The recurring charge tag assigned to the resource.

          • (dict) --

            Describes a recurring charge.

            • Frequency (string) --

              The frequency of the recurring charge.

            • Amount (float) --

              The amount of the recurring charge.

        • 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.

        • PricingDetails (list) --

          The pricing details of the Reserved Instance offering.

          • (dict) --

            Describes a Reserved Instance offering.

            • Price (float) --

              The price per instance.

            • Count (integer) --

              The number of instances available for the price.

    • 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.

DetachVolume (new) Link ¶

Detaches an Amazon 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 results in the volume being stuck in a busy state while detaching.

If an Amazon 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 for Linux.

Request Syntax

client.detach_volume(
    DryRun=True|False,
    VolumeId='string',
    InstanceId='string',
    Device='string',
    Force=True|False
)
type DryRun:

boolean

param DryRun:

type VolumeId:

string

param VolumeId:

[REQUIRED]

The ID of the volume.

type InstanceId:

string

param InstanceId:

The ID of the instance.

type Device:

string

param Device:

The device name.

type Force:

boolean

param Force:

Forces detachment if the previous detachment attempt did not occur cleanly (for example, logging into an instance, unmounting the volume, and detaching normally). This option can lead to data loss or a corrupted file system. Use this option only as a last resort to detach a volume from a failed instance. The instance won't 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.

rtype:

dict

returns:

Response Syntax

{
    'VolumeId': 'string',
    'InstanceId': 'string',
    'Device': 'string',
    'State': 'attaching'|'attached'|'detaching'|'detached',
    'AttachTime': datetime(2015, 1, 1),
    'DeleteOnTermination': True|False
}

Response Structure

  • (dict) --

    Describes volume attachment details.

    • VolumeId (string) --

      The ID of the volume.

    • InstanceId (string) --

      The ID of the instance.

    • Device (string) --

      The device name.

    • State (string) --

      The attachment state of the volume.

    • AttachTime (datetime) --

      The time stamp when the attachment initiated.

    • DeleteOnTermination (boolean) --

      Indicates whether the Amazon EBS volume is deleted on instance termination.

RegisterImage (new) Link ¶

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 for Linux.

You can also use RegisterImage to create an Amazon EBS-backed AMI from a snapshot of a root device volume. For more information, see Launching an Instance from a Snapshot in the Amazon Elastic Compute Cloud User Guide for Linux.

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.

Request Syntax

client.register_image(
    DryRun=True|False,
    ImageLocation='string',
    Name='string',
    Description='string',
    Architecture='i386'|'x86_64',
    KernelId='string',
    RamdiskId='string',
    RootDeviceName='string',
    BlockDeviceMappings=[
        {
            'VirtualName': 'string',
            'DeviceName': 'string',
            'Ebs': {
                'SnapshotId': 'string',
                'VolumeSize': 123,
                'DeleteOnTermination': True|False,
                'VolumeType': 'standard'|'io1'|'gp2',
                'Iops': 123,
                'Encrypted': True|False
            },
            'NoDevice': 'string'
        },
    ],
    VirtualizationType='string',
    SriovNetSupport='string'
)
type DryRun:

boolean

param DryRun:

type ImageLocation:

string

param ImageLocation:

The full path to your AMI manifest in Amazon S3 storage.

type Name:

string

param Name:

[REQUIRED]

A name for your AMI.

Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)

type Description:

string

param Description:

A description for your AMI.

type Architecture:

string

param Architecture:

The architecture of the AMI.

Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, the architecture specified in the manifest file.

type KernelId:

string

param KernelId:

The ID of the kernel.

type RamdiskId:

string

param RamdiskId:

The ID of the RAM disk.

type RootDeviceName:

string

param RootDeviceName:

The name of the root device (for example, /dev/sda1, or /dev/xvda).

type BlockDeviceMappings:

list

param BlockDeviceMappings:

One or more block device mapping entries.

  • (dict) --

    Describes a block device mapping.

    • 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.

      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.

    • DeviceName (string) --

      The device name exposed to the instance (for example, /dev/sdh or xvdh).

    • Ebs (dict) --

      Parameters used to automatically set up Amazon EBS volumes when the instance is launched.

      • SnapshotId (string) --

        The ID of the snapshot.

      • VolumeSize (integer) --

        The size of the volume, in GiB.

        Constraints: 1-1024 for standard volumes, 1-16384 for gp2 volumes, and 4-16384 for io1 volumes. 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.

      • DeleteOnTermination (boolean) --

        Indicates whether the Amazon EBS volume is deleted on instance termination.

      • VolumeType (string) --

        The volume type. gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic volumes.

        Default: standard

      • 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 on General Purpose (SSD) baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide for Linux.

        Constraint: Range is 100 to 20000 for Provisioned IOPS (SSD) volumes and 3 to 10000 for General Purpose (SSD) volumes.

        Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create standard or gp2 volumes.

      • Encrypted (boolean) --

        Indicates whether the Amazon EBS volume is encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption.

    • NoDevice (string) --

      Suppresses the specified device included in the block device mapping of the AMI.

type VirtualizationType:

string

param VirtualizationType:

The type of virtualization.

Default: paravirtual

type SriovNetSupport:

string

param SriovNetSupport:

Set to simple to enable enhanced networking for the AMI and any instances that you launch from the AMI.

There is no way to disable enhanced networking 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.

rtype:

dict

returns:

Response Syntax

{
    'ImageId': 'string'
}

Response Structure

  • (dict) --

    • ImageId (string) --

      The ID of the newly registered AMI.

DescribeReservedInstances (new) Link ¶

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 for Linux.

Request Syntax

client.describe_reserved_instances(
    DryRun=True|False,
    ReservedInstancesIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    OfferingType='Heavy Utilization'|'Medium Utilization'|'Light Utilization'|'No Upfront'|'Partial Upfront'|'All Upfront'
)
type DryRun:

boolean

param DryRun:

type ReservedInstancesIds:

list

param ReservedInstancesIds:

One or more Reserved Instance IDs.

Default: Describes all your Reserved Instances, or only those otherwise specified.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • availability-zone - The Availability Zone where the Reserved Instance can be used.

  • duration - The duration of the Reserved Instance (one year or three years), in seconds ( 31536000 | 94608000).

  • end - The time when the Reserved Instance expires (for example, 2014-08-07T11:54:42.000Z).

  • fixed-price - The purchase price of the Reserved Instance (for example, 9800.0).

  • instance-type - The instance type on which the Reserved Instance can be used.

  • product-description - The product description of the Reserved Instance ( Linux/UNIX | Linux/UNIX (Amazon VPC) | Windows | Windows (Amazon VPC)).

  • reserved-instances-id - The ID of the Reserved Instance.

  • start - The time at which the Reserved Instance purchase request was placed (for example, 2014-08-07T11:54:42.000Z).

  • state - The state of the Reserved Instance ( pending-payment | active | payment-failed | retired).

  • tag:key*=*value - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key*=*value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • usage-price - The usage price of the Reserved Instance, per hour (for example, 0.84).

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

type OfferingType:

string

param OfferingType:

The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the Medium Utilization Reserved Instance offering type.

rtype:

dict

returns:

Response Syntax

{
    'ReservedInstances': [
        {
            'ReservedInstancesId': 'string',
            'InstanceType': 't1.micro'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'t2.micro'|'t2.small'|'t2.medium'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'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'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'cg1.4xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge',
            'AvailabilityZone': 'string',
            'Start': datetime(2015, 1, 1),
            'End': datetime(2015, 1, 1),
            'Duration': 123,
            'UsagePrice': ...,
            'FixedPrice': ...,
            'InstanceCount': 123,
            'ProductDescription': 'Linux/UNIX'|'Linux/UNIX (Amazon VPC)'|'Windows'|'Windows (Amazon VPC)',
            'State': 'payment-pending'|'active'|'payment-failed'|'retired',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'InstanceTenancy': 'default'|'dedicated',
            'CurrencyCode': 'USD',
            'OfferingType': 'Heavy Utilization'|'Medium Utilization'|'Light Utilization'|'No Upfront'|'Partial Upfront'|'All Upfront',
            'RecurringCharges': [
                {
                    'Frequency': 'Hourly',
                    'Amount': 123.0
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • ReservedInstances (list) --

      A list of Reserved Instances.

      • (dict) --

        Describes a Reserved Instance.

        • ReservedInstancesId (string) --

          The ID of the Reserved Instance.

        • InstanceType (string) --

          The instance type on which the Reserved Instance can be used.

        • AvailabilityZone (string) --

          The Availability Zone in which the Reserved Instance can be used.

        • Start (datetime) --

          The date and time the Reserved Instance started.

        • End (datetime) --

          The time when the Reserved Instance expires.

        • Duration (integer) --

          The duration of the Reserved Instance, in seconds.

        • UsagePrice (float) --

          The usage price of the Reserved Instance, per hour.

        • FixedPrice (float) --

          The purchase price of the Reserved Instance.

        • InstanceCount (integer) --

          The number of Reserved Instances purchased.

        • ProductDescription (string) --

          The Reserved Instance description.

        • State (string) --

          The state of the Reserved Instance purchase.

        • 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.

        • InstanceTenancy (string) --

          The tenancy of the reserved instance.

        • 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.

        • OfferingType (string) --

          The Reserved Instance offering type.

        • RecurringCharges (list) --

          The recurring charge tag assigned to the resource.

          • (dict) --

            Describes a recurring charge.

            • Frequency (string) --

              The frequency of the recurring charge.

            • Amount (float) --

              The amount of the recurring charge.

CreateRoute (new) Link ¶

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, VPC peering connection, or network interface.

When determining how to route traffic, we use the route with the most specific match. For example, let's say the traffic is destined for 192.0.2.3, and the route table includes the following two routes:

  • 192.0.2.0/24 (goes to some target A)

  • 192.0.2.0/28 (goes to some target B)

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.

Request Syntax

client.create_route(
    DryRun=True|False,
    RouteTableId='string',
    DestinationCidrBlock='string',
    GatewayId='string',
    InstanceId='string',
    NetworkInterfaceId='string',
    VpcPeeringConnectionId='string'
)
type DryRun:

boolean

param DryRun:

type RouteTableId:

string

param RouteTableId:

[REQUIRED]

The ID of the route table for the route.

type DestinationCidrBlock:

string

param DestinationCidrBlock:

[REQUIRED]

The CIDR address block used for the destination match. Routing decisions are based on the most specific match.

type GatewayId:

string

param GatewayId:

The ID of an Internet gateway or virtual private gateway attached to your VPC.

type InstanceId:

string

param InstanceId:

The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.

type NetworkInterfaceId:

string

param NetworkInterfaceId:

The ID of a network interface.

type VpcPeeringConnectionId:

string

param VpcPeeringConnectionId:

The ID of a VPC peering connection.

returns:

None

DeletePlacementGroup (new) Link ¶

Deletes the specified placement group. You must terminate all instances in the placement group before you can delete the placement group. For more information about placement groups and cluster instances, see Cluster Instances in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.delete_placement_group(
    DryRun=True|False,
    GroupName='string'
)
type DryRun:

boolean

param DryRun:

type GroupName:

string

param GroupName:

[REQUIRED]

The name of the placement group.

returns:

None

DescribeSnapshots (new) Link ¶

Describes one or more of the Amazon EBS snapshots available to you. Available snapshots include public snapshots available for any AWS account to launch, private snapshots that you own, and private snapshots owned by another AWS account but for which you've been given explicit create volume permissions.

The create volume permissions fall into the following categories:

  • public: The owner of the snapshot granted create volume permissions for the snapshot to the all group. All AWS accounts have create volume permissions for these snapshots.

  • explicit: The owner of the snapshot granted create volume permissions to a specific AWS account.

  • implicit: An AWS account has implicit create volume permissions for all snapshots it owns.

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, 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 Amazon EBS snapshots, see Amazon EBS Snapshots in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.describe_snapshots(
    DryRun=True|False,
    SnapshotIds=[
        'string',
    ],
    OwnerIds=[
        'string',
    ],
    RestorableByUserIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    NextToken='string',
    MaxResults=123
)
type DryRun:

boolean

param DryRun:

type SnapshotIds:

list

param SnapshotIds:

One or more snapshot IDs.

Default: Describes snapshots for which you have launch permissions.

  • (string) --

type OwnerIds:

list

param OwnerIds:

Returns the snapshots owned by the specified owner. Multiple owners can be specified.

  • (string) --

type RestorableByUserIds:

list

param RestorableByUserIds:

One or more AWS accounts IDs that can create volumes from the snapshot.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • description - A description of the snapshot.

  • owner-alias - The AWS account alias (for example, amazon) that owns the snapshot.

  • owner-id - The ID of the AWS account that owns the snapshot.

  • progress - The progress of the snapshot, as a percentage (for example, 80%).

  • snapshot-id - The snapshot ID.

  • start-time - The time stamp when the snapshot was initiated.

  • status - The status of the snapshot ( pending | completed | error).

  • tag:key*=*value - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key*=*value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • volume-id - The ID of the volume the snapshot is for.

  • volume-size - The size of the volume, in GiB.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

type NextToken:

string

param NextToken:

The NextToken value returned from a previous paginated DescribeSnapshots request where MaxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the NextToken value. This value is null when there are no more results to return.

type MaxResults:

integer

param MaxResults:

The maximum number of snapshot results returned by DescribeSnapshots in paginated output. When this parameter is used, DescribeSnapshots only returns MaxResults results in a single page along with a NextToken response element. The remaining results of the initial request can be seen by sending another DescribeSnapshots request with the returned NextToken value. This value can be between 5 and 1000; if MaxResults is given a value larger than 1000, only 1000 results are returned. If this parameter is not used, then DescribeSnapshots returns all results. You cannot specify this parameter and the snapshot IDs parameter in the same request.

rtype:

dict

returns:

Response Syntax

{
    'Snapshots': [
        {
            'SnapshotId': 'string',
            'VolumeId': 'string',
            'State': 'pending'|'completed'|'error',
            'StartTime': datetime(2015, 1, 1),
            'Progress': 'string',
            'OwnerId': 'string',
            'Description': 'string',
            'VolumeSize': 123,
            'OwnerAlias': 'string',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'Encrypted': True|False,
            'KmsKeyId': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Snapshots (list) --

      • (dict) --

        Describes a snapshot.

        • SnapshotId (string) --

          The ID of the snapshot.

        • VolumeId (string) --

          The ID of the volume.

        • State (string) --

          The snapshot state.

        • StartTime (datetime) --

          The time stamp when the snapshot was initiated.

        • Progress (string) --

          The progress of the snapshot, as a percentage.

        • OwnerId (string) --

          The AWS account ID of the Amazon EBS snapshot owner.

        • Description (string) --

          The description for the snapshot.

        • VolumeSize (integer) --

          The size of the volume, in GiB.

        • OwnerAlias (string) --

          The AWS account alias (for example, amazon, self) or AWS account ID that owns the snapshot.

        • 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.

        • Encrypted (boolean) --

          Indicates whether the snapshot is encrypted.

        • KmsKeyId (string) --

          The full ARN of the AWS Key Management Service (KMS) master key that was used to protect the volume encryption key for the parent volume.

    • 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.

DisableVgwRoutePropagation (new) Link ¶

Disables a virtual private gateway (VGW) from propagating routes to a specified route table of a VPC.

Request Syntax

client.disable_vgw_route_propagation(
    RouteTableId='string',
    GatewayId='string'
)
type RouteTableId:

string

param RouteTableId:

[REQUIRED]

The ID of the route table.

type GatewayId:

string

param GatewayId:

[REQUIRED]

The ID of the virtual private gateway.

returns:

None

CreateInternetGateway (new) Link ¶

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.

Request Syntax

client.create_internet_gateway(
    DryRun=True|False
)
type DryRun:

boolean

param DryRun:

rtype:

dict

returns:

Response Syntax

{
    'InternetGateway': {
        'InternetGatewayId': 'string',
        'Attachments': [
            {
                'VpcId': 'string',
                'State': 'attaching'|'attached'|'detaching'|'detached'
            },
        ],
        'Tags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • InternetGateway (dict) --

      Information about the Internet gateway.

      • InternetGatewayId (string) --

        The ID of the Internet gateway.

      • Attachments (list) --

        Any VPCs attached to the Internet gateway.

        • (dict) --

          Describes the attachment of a VPC to an Internet gateway.

          • VpcId (string) --

            The ID of the VPC.

          • State (string) --

            The current state of the attachment.

      • 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.

AuthorizeSecurityGroupIngress (new) Link ¶

Adds one or more ingress rules to a security group.

Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay might occur.

[EC2-Classic] This action gives one or more CIDR IP address ranges permission to access a security group in your account, or gives one or more security groups (called the source groups) permission to access a security group for your account. A source group can be for your own AWS account, or another.

[EC2-VPC] This action gives one or more CIDR IP address ranges permission to access a security group in your VPC, or gives one or more other security groups (called the source groups) permission to access a security group for your VPC. The security groups must all be for the same VPC.

Request Syntax

client.authorize_security_group_ingress(
    DryRun=True|False,
    GroupName='string',
    GroupId='string',
    SourceSecurityGroupName='string',
    SourceSecurityGroupOwnerId='string',
    IpProtocol='string',
    FromPort=123,
    ToPort=123,
    CidrIp='string',
    IpPermissions=[
        {
            'IpProtocol': 'string',
            'FromPort': 123,
            'ToPort': 123,
            'UserIdGroupPairs': [
                {
                    'UserId': 'string',
                    'GroupName': 'string',
                    'GroupId': 'string'
                },
            ],
            'IpRanges': [
                {
                    'CidrIp': 'string'
                },
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type GroupName:

string

param GroupName:

[EC2-Classic, default VPC] The name of the security group.

type GroupId:

string

param GroupId:

The ID of the security group. Required for a nondefault VPC.

type SourceSecurityGroupName:

string

param SourceSecurityGroupName:

[EC2-Classic, default VPC] The name of the source security group. You can't specify a source security group and a CIDR IP address range.

type SourceSecurityGroupOwnerId:

string

param SourceSecurityGroupOwnerId:

The ID of the source security group. You can't specify a source security group and a CIDR IP address range.

type IpProtocol:

string

param IpProtocol:

The IP protocol name ( tcp, udp, icmp) or number (see Protocol Numbers). (VPC only) Use -1 to specify all.

type FromPort:

integer

param FromPort:

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 ICMP types.

type ToPort:

integer

param ToPort:

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 ICMP codes for the ICMP type.

type CidrIp:

string

param CidrIp:

The CIDR IP address range. You can't specify this parameter when specifying a source security group.

type IpPermissions:

list

param IpPermissions:

A set of IP permissions. Can be used to specify multiple rules in a single command.

  • (dict) --

    Describes a security group rule.

    • IpProtocol (string) --

      The protocol.

      When you call DescribeSecurityGroups, the protocol value returned is the number. Exception: For TCP, UDP, and ICMP, the value returned is the name (for example, tcp, udp, or icmp). For a list of protocol numbers, see Protocol Numbers. (VPC only) When you call AuthorizeSecurityGroupIngress, you can use -1 to specify all.

    • FromPort (integer) --

      The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.

    • ToPort (integer) --

      The end of port range for the TCP and UDP protocols, or an ICMP code. A value of -1 indicates all ICMP codes for the specified ICMP type.

    • UserIdGroupPairs (list) --

      One or more security group and AWS account ID pairs.

      • (dict) --

        Describes a security group and AWS account ID pair.

        • UserId (string) --

          The ID of an AWS account. EC2-Classic only.

        • 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 GroupId.

        • GroupId (string) --

          The ID of the security group.

    • IpRanges (list) --

      One or more IP ranges.

      • (dict) --

        Describes an IP range.

        • CidrIp (string) --

          The CIDR range. You can either specify a CIDR range or a source security group, not both.

returns:

None

DescribeInstanceStatus (new) Link ¶

Describes the status of one or more instances, including any scheduled events.

Instance status has two main components:

  • System Status reports impaired functionality that stems from issues related to the systems that support an instance, such as such as hardware failures and network connectivity problems. This call reports such problems as impaired reachability.

  • Instance Status reports impaired functionality that arises from problems internal to the instance. This call reports such problems as impaired reachability.

Instance status provides information about four types of scheduled events for an instance that may require your attention:

  • Scheduled Reboot: When Amazon EC2 determines that an instance must be rebooted, the instances status returns one of two event codes: system-reboot or instance-reboot. System reboot commonly occurs if certain maintenance or upgrade operations require a reboot of the underlying host that supports an instance. Instance reboot commonly occurs if the instance must be rebooted, rather than the underlying host. Rebooting events include a scheduled start and end time.

  • System Maintenance: When Amazon EC2 determines that an instance requires maintenance that requires power or network impact, the instance status is the event code system-maintenance. System maintenance is either power maintenance or network maintenance. For power maintenance, your instance will be unavailable for a brief period of time and then rebooted. For network maintenance, your instance will experience a brief loss of network connectivity. System maintenance events include a scheduled start and end time. You will also be notified by email if one of your instances is set for system maintenance. The email message indicates when your instance is scheduled for maintenance.

  • Scheduled Retirement: When Amazon EC2 determines that an instance must be shut down, the instance status is the event code instance-retirement. Retirement commonly occurs when the underlying host is degraded and must be replaced. Retirement events include a scheduled start and end time. You will also be notified by email if one of your instances is set to retiring. The email message indicates when your instance will be permanently retired.

  • Scheduled Stop: When Amazon EC2 determines that an instance must be shut down, the instances status returns an event code called instance-stop. Stop events include a scheduled start and end time. You will also be notified by email if one of your instances is set to stop. The email message indicates when your instance will be stopped.

When your instance is retired, it will either be terminated (if its root device type is the instance-store) or stopped (if its root device type is an EBS volume). Instances stopped due to retirement will not be restarted, but you can do so manually. You can also avoid retirement of EBS-backed instances by manually restarting your instance when its event code is instance-retirement. This ensures that your instance is started on a different underlying host.

For more information about failed status checks, see Troubleshooting Instances with Failed Status Checks in the Amazon Elastic Compute Cloud User Guide for Linux. For more information about working with scheduled events, see Working with an Instance That Has a Scheduled Event in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.describe_instance_status(
    DryRun=True|False,
    InstanceIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    NextToken='string',
    MaxResults=123,
    IncludeAllInstances=True|False
)
type DryRun:

boolean

param DryRun:

type InstanceIds:

list

param InstanceIds:

One or more instance IDs.

Default: Describes all your instances.

Constraints: Maximum 100 explicitly specified instance IDs.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • availability-zone - The Availability Zone of the instance.

  • event.code - The code identifying the type of event ( instance-reboot | system-reboot | system-maintenance | instance-retirement | instance-stop).

  • event.description - A description of the event.

  • event.not-after - The latest end time for the scheduled event, for example: 2010-09-15T17:15:20.000Z.

  • event.not-before - The earliest start time for the scheduled event, for example: 2010-09-15T17:15:20.000Z.

  • instance-state-code - A code representing the state of the instance, as a 16-bit unsigned integer. The high byte is an opaque internal value and should be ignored. The low byte is set based on the state represented. The valid values are 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), and 80 (stopped).

  • instance-state-name - The state of the instance ( pending | running | shutting-down | terminated | stopping | stopped).

  • instance-status.reachability - Filters on instance status where the name is reachability ( passed | failed | initializing | insufficient-data).

  • instance-status.status - The status of the instance ( ok | impaired | initializing | insufficient-data | not-applicable).

  • system-status.reachability - Filters on system status where the name is reachability ( passed | failed | initializing | insufficient-data).

  • system-status.status - The system status of the instance ( ok | impaired | initializing | insufficient-data | not-applicable).

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

type NextToken:

string

param NextToken:

The token to retrieve the next page of results.

type MaxResults:

integer

param MaxResults:

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 larger than 1000, only 1000 results are returned. You cannot specify this parameter and the instance IDs parameter in the same request.

type IncludeAllInstances:

boolean

param IncludeAllInstances:

When true, includes the health status for all instances. When false, includes the health status for running instances only.

Default: false

rtype:

dict

returns:

Response Syntax

{
    'InstanceStatuses': [
        {
            'InstanceId': 'string',
            'AvailabilityZone': 'string',
            'Events': [
                {
                    'Code': 'instance-reboot'|'system-reboot'|'system-maintenance'|'instance-retirement'|'instance-stop',
                    'Description': 'string',
                    'NotBefore': datetime(2015, 1, 1),
                    'NotAfter': datetime(2015, 1, 1)
                },
            ],
            'InstanceState': {
                'Code': 123,
                'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
            },
            'SystemStatus': {
                'Status': 'ok'|'impaired'|'insufficient-data'|'not-applicable',
                'Details': [
                    {
                        'Name': 'reachability',
                        'Status': 'passed'|'failed'|'insufficient-data',
                        'ImpairedSince': datetime(2015, 1, 1)
                    },
                ]
            },
            'InstanceStatus': {
                'Status': 'ok'|'impaired'|'insufficient-data'|'not-applicable',
                'Details': [
                    {
                        'Name': 'reachability',
                        'Status': 'passed'|'failed'|'insufficient-data',
                        'ImpairedSince': datetime(2015, 1, 1)
                    },
                ]
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • InstanceStatuses (list) --

      One or more instance status descriptions.

      • (dict) --

        Describes the status of an instance.

        • InstanceId (string) --

          The ID of the instance.

        • AvailabilityZone (string) --

          The Availability Zone of the instance.

        • Events (list) --

          Extra information regarding events associated with the instance.

          • (dict) --

            Describes an instance event.

            • Code (string) --

              The associated code of the event.

            • Description (string) --

              A description of the event.

            • NotBefore (datetime) --

              The earliest scheduled start time for the event.

            • NotAfter (datetime) --

              The latest scheduled end time for the event.

        • InstanceState (dict) --

          The intended state of the instance. DescribeInstanceStatus requires that an instance be in the running state.

          • Code (integer) --

            The low byte represents the state. The high byte is an opaque internal value and should be ignored.

            • 0 : pending

            • 16 : running

            • 32 : shutting-down

            • 48 : terminated

            • 64 : stopping

            • 80 : stopped

          • Name (string) --

            The current state of the instance.

        • 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.

          • Status (string) --

            The status.

          • Details (list) --

            The system instance health or application instance health.

            • (dict) --

              Describes the instance status.

              • Name (string) --

                The type of instance status.

              • Status (string) --

                The 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.

        • InstanceStatus (dict) --

          Reports impaired functionality that stems from issues internal to the instance, such as impaired reachability.

          • Status (string) --

            The status.

          • Details (list) --

            The system instance health or application instance health.

            • (dict) --

              Describes the instance status.

              • Name (string) --

                The type of instance status.

              • Status (string) --

                The 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.

    • 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.

ResetImageAttribute (new) Link ¶

Resets an attribute of an AMI to its default value.

Request Syntax

client.reset_image_attribute(
    DryRun=True|False,
    ImageId='string',
    Attribute='launchPermission'
)
type DryRun:

boolean

param DryRun:

type ImageId:

string

param ImageId:

[REQUIRED]

The ID of the AMI.

type Attribute:

string

param Attribute:

[REQUIRED]

The attribute to reset (currently you can only reset the launch permission attribute).

returns:

None

EnableVolumeIO (new) Link ¶

Enables I/O operations for a volume that had I/O operations disabled because the data on the volume was potentially inconsistent.

Request Syntax

client.enable_volume_io(
    DryRun=True|False,
    VolumeId='string'
)
type DryRun:

boolean

param DryRun:

type VolumeId:

string

param VolumeId:

[REQUIRED]

The ID of the volume.

returns:

None

ModifyImageAttribute (new) Link ¶

Modifies the specified attribute of the specified AMI. You can specify only one attribute at a time.

Request Syntax

client.modify_image_attribute(
    DryRun=True|False,
    ImageId='string',
    Attribute='string',
    OperationType='string',
    UserIds=[
        'string',
    ],
    UserGroups=[
        'string',
    ],
    ProductCodes=[
        'string',
    ],
    Value='string',
    LaunchPermission={
        'Add': [
            {
                'UserId': 'string',
                'Group': 'all'
            },
        ],
        'Remove': [
            {
                'UserId': 'string',
                'Group': 'all'
            },
        ]
    },
    Description={
        'Value': 'string'
    }
)
type DryRun:

boolean

param DryRun:

type ImageId:

string

param ImageId:

[REQUIRED]

The ID of the AMI.

type Attribute:

string

param Attribute:

The name of the attribute to modify.

type OperationType:

string

param OperationType:

The operation type.

type UserIds:

list

param UserIds:

One or more AWS account IDs. This is only valid when modifying the launchPermission attribute.

  • (string) --

type UserGroups:

list

param UserGroups:

One or more user groups. This is only valid when modifying the launchPermission attribute.

  • (string) --

type ProductCodes:

list

param ProductCodes:

One or more product codes. After you add a product code to an AMI, it can't be removed. This is only valid when modifying the productCodes attribute.

  • (string) --

type Value:

string

param Value:

The value of the attribute being modified. This is only valid when modifying the description attribute.

type LaunchPermission:

dict

param LaunchPermission:

A launch permission modification.

  • Add (list) --

    The AWS account ID to add to the list of launch permissions for the AMI.

    • (dict) --

      Describes a launch permission.

      • UserId (string) --

        The AWS account ID.

      • Group (string) --

        The name of the group.

  • Remove (list) --

    The AWS account ID to remove from the list of launch permissions for the AMI.

    • (dict) --

      Describes a launch permission.

      • UserId (string) --

        The AWS account ID.

      • Group (string) --

        The name of the group.

type Description:

dict

param Description:

A description for the AMI.

  • Value (string) --

    Valid values are case-sensitive and vary by action.

returns:

None

ModifyReservedInstances (new) Link ¶

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 for Linux.

Request Syntax

client.modify_reserved_instances(
    ClientToken='string',
    ReservedInstancesIds=[
        'string',
    ],
    TargetConfigurations=[
        {
            'AvailabilityZone': 'string',
            'Platform': 'string',
            'InstanceCount': 123,
            'InstanceType': 't1.micro'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'t2.micro'|'t2.small'|'t2.medium'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'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'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'cg1.4xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'
        },
    ]
)
type ClientToken:

string

param ClientToken:

A unique, case-sensitive token you provide to ensure idempotency of your modification request. For more information, see Ensuring Idempotency.

type ReservedInstancesIds:

list

param ReservedInstancesIds:

[REQUIRED]

The IDs of the Reserved Instances to modify.

  • (string) --

type TargetConfigurations:

list

param TargetConfigurations:

[REQUIRED]

The configuration settings for the Reserved Instances to modify.

  • (dict) --

    Describes the configuration settings for the modified Reserved Instances.

    • AvailabilityZone (string) --

      The Availability Zone for the modified Reserved Instances.

    • Platform (string) --

      The network platform of the modified Reserved Instances, which is either EC2-Classic or EC2-VPC.

    • InstanceCount (integer) --

      The number of modified Reserved Instances.

    • InstanceType (string) --

      The instance type for the modified Reserved Instances.

rtype:

dict

returns:

Response Syntax

{
    'ReservedInstancesModificationId': 'string'
}

Response Structure

  • (dict) --

    • ReservedInstancesModificationId (string) --

      The ID for the modification.

RejectVpcPeeringConnection (new) Link ¶

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.

Request Syntax

client.reject_vpc_peering_connection(
    DryRun=True|False,
    VpcPeeringConnectionId='string'
)
type DryRun:

boolean

param DryRun:

type VpcPeeringConnectionId:

string

param VpcPeeringConnectionId:

[REQUIRED]

The ID of the VPC peering connection.

rtype:

dict

returns:

Response Syntax

{
    'Return': True|False
}

Response Structure

  • (dict) --

    • Return (boolean) --

      Returns true if the request succeeds; otherwise, it returns an error.

StartInstances (new) Link ¶

Starts an Amazon EBS-backed AMI 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 hourly instance usage. However, your root partition Amazon EBS volume remains, continues to persist your data, and you are charged for Amazon EBS volume usage. You can restart your instance at any time. Each time you transition an instance from stopped to started, Amazon EC2 charges a full instance hour, even if transitions happen multiple times within a single hour.

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 for Linux.

Request Syntax

client.start_instances(
    InstanceIds=[
        'string',
    ],
    AdditionalInfo='string',
    DryRun=True|False
)
type InstanceIds:

list

param InstanceIds:

[REQUIRED]

One or more instance IDs.

  • (string) --

type AdditionalInfo:

string

param AdditionalInfo:

Reserved.

type DryRun:

boolean

param DryRun:

rtype:

dict

returns:

Response Syntax

{
    'StartingInstances': [
        {
            'InstanceId': 'string',
            'CurrentState': {
                'Code': 123,
                'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
            },
            'PreviousState': {
                'Code': 123,
                'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
            }
        },
    ]
}

Response Structure

  • (dict) --

    • StartingInstances (list) --

      Information about one or more started instances.

      • (dict) --

        Describes an instance state change.

        • InstanceId (string) --

          The ID of the instance.

        • CurrentState (dict) --

          The current state of the instance.

          • Code (integer) --

            The low byte represents the state. The high byte is an opaque internal value and should be ignored.

            • 0 : pending

            • 16 : running

            • 32 : shutting-down

            • 48 : terminated

            • 64 : stopping

            • 80 : stopped

          • Name (string) --

            The current state of the instance.

        • PreviousState (dict) --

          The previous state of the instance.

          • Code (integer) --

            The low byte represents the state. The high byte is an opaque internal value and should be ignored.

            • 0 : pending

            • 16 : running

            • 32 : shutting-down

            • 48 : terminated

            • 64 : stopping

            • 80 : stopped

          • Name (string) --

            The current state of the instance.

AcceptVpcPeeringConnection (new) Link ¶

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 the DescribeVpcPeeringConnections request to view your outstanding VPC peering connection requests.

Request Syntax

client.accept_vpc_peering_connection(
    DryRun=True|False,
    VpcPeeringConnectionId='string'
)
type DryRun:

boolean

param DryRun:

type VpcPeeringConnectionId:

string

param VpcPeeringConnectionId:

The ID of the VPC peering connection.

rtype:

dict

returns:

Response Syntax

{
    'VpcPeeringConnection': {
        'AccepterVpcInfo': {
            'CidrBlock': 'string',
            'OwnerId': 'string',
            'VpcId': 'string'
        },
        'ExpirationTime': datetime(2015, 1, 1),
        'RequesterVpcInfo': {
            'CidrBlock': 'string',
            'OwnerId': 'string',
            'VpcId': 'string'
        },
        'Status': {
            'Code': 'string',
            'Message': 'string'
        },
        'Tags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'VpcPeeringConnectionId': 'string'
    }
}

Response Structure

  • (dict) --

    • VpcPeeringConnection (dict) --

      Information about the VPC peering connection.

      • AccepterVpcInfo (dict) --

        The information of the peer VPC.

        • CidrBlock (string) --

          The CIDR block for the VPC.

        • OwnerId (string) --

          The AWS account ID of the VPC owner.

        • VpcId (string) --

          The ID of the VPC.

      • ExpirationTime (datetime) --

        The time that an unaccepted VPC peering connection will expire.

      • RequesterVpcInfo (dict) --

        The information of the requester VPC.

        • CidrBlock (string) --

          The CIDR block for the VPC.

        • OwnerId (string) --

          The AWS account ID of the VPC owner.

        • VpcId (string) --

          The ID of the VPC.

      • 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.

CancelBundleTask (new) Link ¶

Cancels a bundling operation for an instance store-backed Windows instance.

Request Syntax

client.cancel_bundle_task(
    DryRun=True|False,
    BundleId='string'
)
type DryRun:

boolean

param DryRun:

type BundleId:

string

param BundleId:

[REQUIRED]

The ID of the bundle task.

rtype:

dict

returns:

Response Syntax

{
    'BundleTask': {
        'InstanceId': 'string',
        'BundleId': 'string',
        'State': 'pending'|'waiting-for-shutdown'|'bundling'|'storing'|'cancelling'|'complete'|'failed',
        'StartTime': datetime(2015, 1, 1),
        'UpdateTime': datetime(2015, 1, 1),
        'Storage': {
            'S3': {
                'Bucket': 'string',
                'Prefix': 'string',
                'AWSAccessKeyId': 'string',
                'UploadPolicy': b'bytes',
                'UploadPolicySignature': 'string'
            }
        },
        'Progress': 'string',
        'BundleTaskError': {
            'Code': 'string',
            'Message': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • BundleTask (dict) --

      The bundle task.

      • InstanceId (string) --

        The ID of the instance associated with this bundle task.

      • BundleId (string) --

        The ID of the bundle task.

      • State (string) --

        The state of the task.

      • StartTime (datetime) --

        The time this task started.

      • UpdateTime (datetime) --

        The time of the most recent update for the task.

      • Storage (dict) --

        The Amazon S3 storage locations.

        • S3 (dict) --

          An Amazon S3 storage location.

          • 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.

          • 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.

          • UploadPolicy (bytes) --

            A Base64-encoded Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.

          • UploadPolicySignature (string) --

            The signature of the Base64 encoded JSON document.

      • Progress (string) --

        The level of task completion, as a percent (for example, 20%).

      • BundleTaskError (dict) --

        If the task fails, a description of the error.

        • Code (string) --

          The error code.

        • Message (string) --

          The error message.

CreateRouteTable (new) Link ¶

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 about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.create_route_table(
    DryRun=True|False,
    VpcId='string'
)
type DryRun:

boolean

param DryRun:

type VpcId:

string

param VpcId:

[REQUIRED]

The ID of the VPC.

rtype:

dict

returns:

Response Syntax

{
    'RouteTable': {
        'RouteTableId': 'string',
        'VpcId': 'string',
        'Routes': [
            {
                'DestinationCidrBlock': 'string',
                'GatewayId': 'string',
                'InstanceId': 'string',
                'InstanceOwnerId': 'string',
                'NetworkInterfaceId': 'string',
                'VpcPeeringConnectionId': 'string',
                'State': 'active'|'blackhole',
                'Origin': 'CreateRouteTable'|'CreateRoute'|'EnableVgwRoutePropagation'
            },
        ],
        'Associations': [
            {
                'RouteTableAssociationId': 'string',
                'RouteTableId': 'string',
                'SubnetId': 'string',
                'Main': True|False
            },
        ],
        'Tags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'PropagatingVgws': [
            {
                'GatewayId': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • RouteTable (dict) --

      Information about the route table.

      • RouteTableId (string) --

        The ID of the route table.

      • VpcId (string) --

        The ID of the VPC.

      • Routes (list) --

        The routes in the route table.

        • (dict) --

          Describes a route in a route table.

          • DestinationCidrBlock (string) --

            The CIDR block used for the destination match.

          • 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.

          • NetworkInterfaceId (string) --

            The ID of the network interface.

          • VpcPeeringConnectionId (string) --

            The ID of the VPC peering connection.

          • 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).

          • Origin (string) --

            Describes how the route was created.

            • CreateRouteTable indicates that route was automatically created when the route table was created.

            • CreateRoute indicates that the route was manually added to the route table.

            • EnableVgwRoutePropagation indicates that the route was propagated by route propagation.

      • Associations (list) --

        The associations between the route table and one or more subnets.

        • (dict) --

          Describes an association between a route table and a subnet.

          • 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.

          • Main (boolean) --

            Indicates whether this is the main route table.

      • 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.

      • 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 (VGW).

CreateSpotDatafeedSubscription (new) Link ¶

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 Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.create_spot_datafeed_subscription(
    DryRun=True|False,
    Bucket='string',
    Prefix='string'
)
type DryRun:

boolean

param DryRun:

type Bucket:

string

param Bucket:

[REQUIRED]

The Amazon S3 bucket in which to store the Spot Instance data feed.

type Prefix:

string

param Prefix:

A prefix for the data feed file names.

rtype:

dict

returns:

Response Syntax

{
    'SpotDatafeedSubscription': {
        'OwnerId': 'string',
        'Bucket': 'string',
        'Prefix': 'string',
        'State': 'Active'|'Inactive',
        'Fault': {
            'Code': 'string',
            'Message': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • SpotDatafeedSubscription (dict) --

      The Spot Instance data feed subscription.

      • OwnerId (string) --

        The AWS account ID of the account.

      • Bucket (string) --

        The Amazon S3 bucket where the Spot Instance data feed is located.

      • Prefix (string) --

        The prefix that is prepended to data feed files.

      • State (string) --

        The state of the Spot Instance data feed subscription.

      • 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.

CreateVpnGateway (new) Link ¶

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 about virtual private gateways, see Adding a Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.create_vpn_gateway(
    DryRun=True|False,
    Type='ipsec.1',
    AvailabilityZone='string'
)
type DryRun:

boolean

param DryRun:

type Type:

string

param Type:

[REQUIRED]

The type of VPN connection this virtual private gateway supports.

type AvailabilityZone:

string

param AvailabilityZone:

The Availability Zone for the virtual private gateway.

rtype:

dict

returns:

Response Syntax

{
    'VpnGateway': {
        'VpnGatewayId': 'string',
        'State': 'pending'|'available'|'deleting'|'deleted',
        'Type': 'ipsec.1',
        'AvailabilityZone': 'string',
        'VpcAttachments': [
            {
                'VpcId': 'string',
                'State': 'attaching'|'attached'|'detaching'|'detached'
            },
        ],
        'Tags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • VpnGateway (dict) --

      Information about the virtual private gateway.

      • VpnGatewayId (string) --

        The ID of the virtual private gateway.

      • State (string) --

        The current state of the virtual private gateway.

      • Type (string) --

        The type of VPN connection the virtual private gateway supports.

      • AvailabilityZone (string) --

        The Availability Zone where the virtual private gateway was created.

      • VpcAttachments (list) --

        Any VPCs attached to the virtual private gateway.

        • (dict) --

          Describes an attachment between a virtual private gateway and a VPC.

          • VpcId (string) --

            The ID of the VPC.

          • State (string) --

            The current state of the attachment.

      • 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.

DescribeImportImageTasks (new) Link ¶

Displays details about an import virtual machine or import snapshot tasks that are already created.

Request Syntax

client.describe_import_image_tasks(
    DryRun=True|False,
    ImportTaskIds=[
        'string',
    ],
    NextToken='string',
    MaxResults=123,
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type ImportTaskIds:

list

param ImportTaskIds:

A list of ImportImage task IDs to describe.

  • (string) --

type NextToken:

string

param NextToken:

The token to get the next page of paginated describe requests.

type MaxResults:

integer

param MaxResults:

The maximum number of results in a page.

type Filters:

list

param Filters:

Filters to be applied on a describe request.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'ImportImageTasks': [
        {
            'ImportTaskId': 'string',
            'Architecture': 'string',
            'LicenseType': 'string',
            'Platform': 'string',
            'Hypervisor': 'string',
            'Description': 'string',
            'SnapshotDetails': [
                {
                    'DiskImageSize': 123.0,
                    'Description': 'string',
                    'Format': 'string',
                    'Url': 'string',
                    'UserBucket': {
                        'S3Bucket': 'string',
                        'S3Key': 'string'
                    },
                    'DeviceName': 'string',
                    'SnapshotId': 'string',
                    'Progress': 'string',
                    'StatusMessage': 'string',
                    'Status': 'string'
                },
            ],
            'ImageId': 'string',
            'Progress': 'string',
            'StatusMessage': 'string',
            'Status': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • ImportImageTasks (list) --

      A list of zero or more ImportImage tasks that are currently active or completed/cancelled in the previous 7 days.

      • (dict) --

        • ImportTaskId (string) --

          The ID of the import task.

        • Architecture (string) --

          Architecture of the VM being imported.

        • LicenseType (string) --

          License type of the VM being imported.

        • Platform (string) --

          The description string for the import image task.

        • Hypervisor (string) --

          Target hypervisor for the import task.

        • Description (string) --

          Description of the import task.

        • SnapshotDetails (list) --

          • (dict) --

            The details of the snapshot created from the imported disk.

            • DiskImageSize (float) --

              The size of the disk in the snapshot.

            • Description (string) --

              Description for the snapshot.

            • Format (string) --

              The format of the disk image from which the snapshot is created.

            • Url (string) --

              The URL used to access the disk image.

            • UserBucket (dict) --

              User's Amazon S3 bucket details used to access the image.

              • S3Bucket (string) --

                The Amazon S3 bucket from which the disk image was created.

              • S3Key (string) --

                The Amazon S3 key from which the disk image was created.

            • DeviceName (string) --

              The Amazon EBS block device mapping for the snapshot.

            • SnapshotId (string) --

              The snapshot ID of the disk being imported.

            • Progress (string) --

              The percentage of progress for the task.

            • StatusMessage (string) --

              A detailed status message for the snapshot creation.

            • Status (string) --

              A brief status of the snapshot creation.

        • ImageId (string) --

          The Amazon Machine Image (AMI) ID of the imported virtual machine.

        • Progress (string) --

          The percentage of progress of the ImportImage task.

        • StatusMessage (string) --

          A descriptive status message for the ImportImage task.

        • Status (string) --

          A brief status for the ImportImage task.

    • NextToken (string) --

      The token to get the next page of paginated describe requests.

ModifyVolumeAttribute (new) Link ¶

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.

Request Syntax

client.modify_volume_attribute(
    DryRun=True|False,
    VolumeId='string',
    AutoEnableIO={
        'Value': True|False
    }
)
type DryRun:

boolean

param DryRun:

type VolumeId:

string

param VolumeId:

[REQUIRED]

The ID of the volume.

type AutoEnableIO:

dict

param AutoEnableIO:

Indicates whether the volume should be auto-enabled for I/O operations.

  • Value (boolean) --

    Valid values are true or false.

returns:

None

DescribeInstances (new) Link ¶

Describes one or more of your 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.

Request Syntax

client.describe_instances(
    DryRun=True|False,
    InstanceIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    NextToken='string',
    MaxResults=123
)
type DryRun:

boolean

param DryRun:

type InstanceIds:

list

param InstanceIds:

One or more instance IDs.

Default: Describes all your instances.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • architecture - The instance architecture ( i386 | x86_64).

  • availability-zone - The Availability Zone of the instance.

  • block-device-mapping.attach-time - The attach time for an Amazon EBS volume mapped to the instance, for example, 2010-09-15T17:15:20.000Z.

  • block-device-mapping.delete-on-termination - A Boolean that indicates whether the Amazon EBS volume is deleted on instance termination.

  • block-device-mapping.device-name - The device name for the Amazon EBS volume (for example, /dev/sdh or xvdh).

  • block-device-mapping.status - The status for the Amazon EBS volume ( attaching | attached | detaching | detached).

  • block-device-mapping.volume-id - The volume ID of the Amazon EBS volume.

  • client-token - The idempotency token you provided when you launched the instance.

  • dns-name - The public DNS name of the instance.

  • group-id - The ID of the security group for the instance. EC2-Classic only.

  • group-name - The name of the security group for the instance. EC2-Classic only.

  • hypervisor - The hypervisor type of the instance ( ovm | xen).

  • iam-instance-profile.arn - The instance profile associated with the instance. Specified as an ARN.

  • image-id - The ID of the image used to launch the instance.

  • instance-id - The ID of the instance.

  • instance-lifecycle - Indicates whether this is a Spot Instance ( spot).

  • instance-state-code - The state of the instance, as a 16-bit unsigned integer. The high byte is an opaque internal value and should be ignored. The low byte is set based on the state represented. The valid values are: 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), and 80 (stopped).

  • instance-state-name - The state of the instance ( pending | running | shutting-down | terminated | stopping | stopped).

  • instance-type - The type of instance (for example, t2.micro).

  • instance.group-id - The ID of the security group for the instance.

  • instance.group-name - The name of the security group for the instance.

  • ip-address - The public IP address of the instance.

  • kernel-id - The kernel ID.

  • key-name - The name of the key pair used when the instance was launched.

  • launch-index - When launching multiple instances, this is the index for the instance in the launch group (for example, 0, 1, 2, and so on).

  • launch-time - The time when the instance was launched.

  • monitoring-state - Indicates whether monitoring is enabled for the instance ( disabled | enabled).

  • owner-id - The AWS account ID of the instance owner.

  • placement-group-name - The name of the placement group for the instance.

  • platform - The platform. Use windows if you have Windows instances; otherwise, leave blank.

  • private-dns-name - The private DNS name of the instance.

  • private-ip-address - The private IP address of the instance.

  • product-code - The product code associated with the AMI used to launch the instance.

  • product-code.type - The type of product code ( devpay | marketplace).

  • ramdisk-id - The RAM disk ID.

  • reason - The reason for the current state of the instance (for example, shows "User Initiated [date]" when you stop or terminate the instance). Similar to the state-reason-code filter.

  • requester-id - The ID of the entity that launched the instance on your behalf (for example, AWS Management Console, Auto Scaling, and so on).

  • reservation-id - The ID of the instance's reservation. A reservation ID is created any time you launch an instance. A reservation ID has a one-to-one relationship with an instance launch request, but can be associated with more than one instance if you launch multiple instances using the same launch request. For example, if you launch one instance, you'll get one reservation ID. If you launch ten instances using the same launch request, you'll also get one reservation ID.

  • root-device-name - The name of the root device for the instance (for example, /dev/sda1 or /dev/xvda).

  • root-device-type - The type of root device that the instance uses ( ebs | instance-store).

  • source-dest-check - Indicates whether the instance performs source/destination checking. A value of true means that checking is enabled, and false means checking is disabled. The value must be false for the instance to perform network address translation (NAT) in your VPC.

  • spot-instance-request-id - The ID of the Spot Instance request.

  • state-reason-code - The reason code for the state change.

  • state-reason-message - A message that describes the state change.

  • subnet-id - The ID of the subnet for the instance.

  • tag:key*=*value - The key/value combination of a tag assigned to the resource, where tag:key is the tag's key.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key*=*value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • tenancy - The tenancy of an instance ( dedicated | default).

  • virtualization-type - The virtualization type of the instance ( paravirtual | hvm).

  • vpc-id - The ID of the VPC that the instance is running in.

  • network-interface.description - The description of the network interface.

  • network-interface.subnet-id - The ID of the subnet for the network interface.

  • network-interface.vpc-id - The ID of the VPC for the network interface.

  • network-interface.network-interface.id - The ID of the network interface.

  • network-interface.owner-id - The ID of the owner of the network interface.

  • network-interface.availability-zone - The Availability Zone for the network interface.

  • network-interface.requester-id - The requester ID for the network interface.

  • network-interface.requester-managed - Indicates whether the network interface is being managed by AWS.

  • network-interface.status - The status of the network interface ( available) | in-use).

  • network-interface.mac-address - The MAC address of the network interface.

  • network-interface-private-dns-name - The private DNS name of the network interface.

  • network-interface.source-dest-check - Whether the network interface performs source/destination checking. A value of true means checking is enabled, and false means checking is disabled. The value must be false for the network interface to perform network address translation (NAT) in your VPC.

  • network-interface.group-id - The ID of a security group associated with the network interface.

  • network-interface.group-name - The name of a security group associated with the network interface.

  • network-interface.attachment.attachment-id - The ID of the interface attachment.

  • network-interface.attachment.instance-id - The ID of the instance to which the network interface is attached.

  • network-interface.attachment.instance-owner-id - The owner ID of the instance to which the network interface is attached.

  • network-interface.addresses.private-ip-address - The private IP address associated with the network interface.

  • network-interface.attachment.device-index - The device index to which the network interface is attached.

  • network-interface.attachment.status - The status of the attachment ( attaching | attached | detaching | detached).

  • network-interface.attachment.attach-time - The time that the network interface was attached to an instance.

  • network-interface.attachment.delete-on-termination - Specifies whether the attachment is deleted when an instance is terminated.

  • network-interface.addresses.primary - Specifies whether the IP address of the network interface is the primary private IP address.

  • network-interface.addresses.association.public-ip - The ID of the association of an Elastic IP address with a network interface.

  • network-interface.addresses.association.ip-owner-id - The owner ID of the private IP address associated with the network interface.

  • association.public-ip - The address of the Elastic IP address bound to the network interface.

  • association.ip-owner-id - The owner of the Elastic IP address associated with the network interface.

  • association.allocation-id - The allocation ID returned when you allocated the Elastic IP address for your network interface.

  • association.association-id - The association ID returned when the network interface was associated with an IP address.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

type NextToken:

string

param NextToken:

The token to request the next page of results.

type MaxResults:

integer

param MaxResults:

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 larger than 1000, only 1000 results are returned. You cannot specify this parameter and the instance IDs parameter in the same request.

rtype:

dict

returns:

Response Syntax

{
    'Reservations': [
        {
            'ReservationId': 'string',
            'OwnerId': 'string',
            'RequesterId': 'string',
            'Groups': [
                {
                    'GroupName': 'string',
                    'GroupId': 'string'
                },
            ],
            'Instances': [
                {
                    'InstanceId': 'string',
                    'ImageId': 'string',
                    'State': {
                        'Code': 123,
                        'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
                    },
                    'PrivateDnsName': 'string',
                    'PublicDnsName': 'string',
                    'StateTransitionReason': 'string',
                    'KeyName': 'string',
                    'AmiLaunchIndex': 123,
                    'ProductCodes': [
                        {
                            'ProductCodeId': 'string',
                            'ProductCodeType': 'devpay'|'marketplace'
                        },
                    ],
                    'InstanceType': 't1.micro'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'t2.micro'|'t2.small'|'t2.medium'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'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'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'cg1.4xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge',
                    'LaunchTime': datetime(2015, 1, 1),
                    'Placement': {
                        'AvailabilityZone': 'string',
                        'GroupName': 'string',
                        'Tenancy': 'default'|'dedicated'
                    },
                    'KernelId': 'string',
                    'RamdiskId': 'string',
                    'Platform': 'Windows',
                    'Monitoring': {
                        'State': 'disabled'|'disabling'|'enabled'|'pending'
                    },
                    'SubnetId': 'string',
                    'VpcId': 'string',
                    'PrivateIpAddress': 'string',
                    'PublicIpAddress': 'string',
                    'StateReason': {
                        'Code': 'string',
                        'Message': 'string'
                    },
                    'Architecture': 'i386'|'x86_64',
                    'RootDeviceType': 'ebs'|'instance-store',
                    'RootDeviceName': 'string',
                    'BlockDeviceMappings': [
                        {
                            'DeviceName': 'string',
                            'Ebs': {
                                'VolumeId': 'string',
                                'Status': 'attaching'|'attached'|'detaching'|'detached',
                                'AttachTime': datetime(2015, 1, 1),
                                'DeleteOnTermination': True|False
                            }
                        },
                    ],
                    'VirtualizationType': 'hvm'|'paravirtual',
                    'InstanceLifecycle': 'spot',
                    'SpotInstanceRequestId': 'string',
                    'ClientToken': 'string',
                    'Tags': [
                        {
                            'Key': 'string',
                            'Value': 'string'
                        },
                    ],
                    'SecurityGroups': [
                        {
                            'GroupName': 'string',
                            'GroupId': 'string'
                        },
                    ],
                    'SourceDestCheck': True|False,
                    'Hypervisor': 'ovm'|'xen',
                    'NetworkInterfaces': [
                        {
                            'NetworkInterfaceId': 'string',
                            'SubnetId': 'string',
                            'VpcId': 'string',
                            'Description': 'string',
                            'OwnerId': 'string',
                            'Status': 'available'|'attaching'|'in-use'|'detaching',
                            'MacAddress': 'string',
                            'PrivateIpAddress': 'string',
                            'PrivateDnsName': 'string',
                            'SourceDestCheck': True|False,
                            'Groups': [
                                {
                                    'GroupName': 'string',
                                    'GroupId': 'string'
                                },
                            ],
                            'Attachment': {
                                'AttachmentId': 'string',
                                'DeviceIndex': 123,
                                'Status': 'attaching'|'attached'|'detaching'|'detached',
                                'AttachTime': datetime(2015, 1, 1),
                                'DeleteOnTermination': True|False
                            },
                            'Association': {
                                'PublicIp': 'string',
                                'PublicDnsName': 'string',
                                'IpOwnerId': 'string'
                            },
                            'PrivateIpAddresses': [
                                {
                                    'PrivateIpAddress': 'string',
                                    'PrivateDnsName': 'string',
                                    'Primary': True|False,
                                    'Association': {
                                        'PublicIp': 'string',
                                        'PublicDnsName': 'string',
                                        'IpOwnerId': 'string'
                                    }
                                },
                            ]
                        },
                    ],
                    'IamInstanceProfile': {
                        'Arn': 'string',
                        'Id': 'string'
                    },
                    'EbsOptimized': True|False,
                    'SriovNetSupport': 'string'
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Reservations (list) --

      One or more reservations.

      • (dict) --

        Describes a reservation.

        • ReservationId (string) --

          The ID of the reservation.

        • 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).

        • 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.

        • Instances (list) --

          One or more instances.

          • (dict) --

            Describes an instance.

            • InstanceId (string) --

              The ID of the instance.

            • ImageId (string) --

              The ID of the AMI used to launch the instance.

            • State (dict) --

              The current state of the instance.

              • Code (integer) --

                The low byte represents the state. The high byte is an opaque internal value and should be ignored.

                • 0 : pending

                • 16 : running

                • 32 : shutting-down

                • 48 : terminated

                • 64 : stopping

                • 80 : stopped

              • Name (string) --

                The current state of the instance.

            • PrivateDnsName (string) --

              The private DNS name assigned to the instance. This DNS name can only be used inside the Amazon EC2 network. This name is not available until the instance enters the running state.

            • PublicDnsName (string) --

              The public DNS name assigned to the instance. This name is not available until the instance enters the running state.

            • StateTransitionReason (string) --

              The reason for the most recent state transition. This might be an empty string.

            • KeyName (string) --

              The name of the key pair, if this instance was launched with an associated key pair.

            • AmiLaunchIndex (integer) --

              The AMI launch index, which can be used to find this instance in the launch group.

            • ProductCodes (list) --

              The product codes attached to this instance.

              • (dict) --

                Describes a product code.

                • ProductCodeId (string) --

                  The product code.

                • ProductCodeType (string) --

                  The type of product code.

            • InstanceType (string) --

              The instance type.

            • LaunchTime (datetime) --

              The time the instance was launched.

            • Placement (dict) --

              The location where the instance launched.

              • AvailabilityZone (string) --

                The Availability Zone of the instance.

              • GroupName (string) --

                The name of the placement group the instance is in (for cluster compute instances).

              • 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.

            • KernelId (string) --

              The kernel associated with this instance.

            • RamdiskId (string) --

              The RAM disk associated with this instance.

            • Platform (string) --

              The value is Windows for Windows instances; otherwise blank.

            • Monitoring (dict) --

              The monitoring information for the instance.

              • State (string) --

                Indicates whether monitoring is enabled for the instance.

            • SubnetId (string) --

              The ID of the subnet in which the instance is running.

            • VpcId (string) --

              The ID of the VPC in which the instance is running.

            • PrivateIpAddress (string) --

              The private IP address assigned to the instance.

            • PublicIpAddress (string) --

              The public IP address assigned to the instance.

            • 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.

                • Server.SpotInstanceTermination: A Spot Instance was terminated due to an increase in the market price.

                • Server.InternalError: An internal error occurred during instance launch, resulting in termination.

                • Server.InsufficientInstanceCapacity: There was insufficient instance capacity to satisfy the launch request.

                • Client.InternalError: A client error caused the instance to terminate on launch.

                • Client.InstanceInitiatedShutdown: The instance was shut down using the shutdown -h command from the instance.

                • Client.UserInitiatedShutdown: The instance was shut down using the Amazon EC2 API.

                • Client.VolumeLimitExceeded: The volume limit was exceeded.

                • Client.InvalidSnapshot.NotFound: The specified snapshot was not found.

            • Architecture (string) --

              The architecture of the image.

            • RootDeviceType (string) --

              The root device type used by the AMI. The AMI can use an Amazon EBS volume or an instance store volume.

            • RootDeviceName (string) --

              The root device name (for example, /dev/sda1 or /dev/xvda).

            • BlockDeviceMappings (list) --

              Any block device mapping entries for the instance.

              • (dict) --

                Describes a block device mapping.

                • DeviceName (string) --

                  The device name exposed to the instance (for example, /dev/sdh or xvdh).

                • Ebs (dict) --

                  Parameters used to automatically set up Amazon EBS volumes when the instance is launched.

                  • VolumeId (string) --

                    The ID of the Amazon EBS volume.

                  • Status (string) --

                    The attachment state.

                  • AttachTime (datetime) --

                    The time stamp when the attachment initiated.

                  • DeleteOnTermination (boolean) --

                    Indicates whether the volume is deleted on instance termination.

            • VirtualizationType (string) --

              The virtualization type of the instance.

            • InstanceLifecycle (string) --

              Indicates whether this is a Spot Instance.

            • SpotInstanceRequestId (string) --

              The ID of the Spot Instance request.

            • ClientToken (string) --

              The idempotency token you provided when you launched 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.

            • SecurityGroups (list) --

              One or more 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 checking is enabled, and false means 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.

            • Hypervisor (string) --

              The hypervisor type of the instance.

            • NetworkInterfaces (list) --

              [EC2-VPC] One or more network interfaces for the instance.

              • (dict) --

                Describes a network interface.

                • NetworkInterfaceId (string) --

                  The ID of the network interface.

                • SubnetId (string) --

                  The ID of the subnet.

                • VpcId (string) --

                  The ID of the VPC.

                • Description (string) --

                  The description.

                • OwnerId (string) --

                  The ID of the AWS account that created the network interface.

                • Status (string) --

                  The status of the network interface.

                • MacAddress (string) --

                  The MAC address.

                • PrivateIpAddress (string) --

                  The IP address of the network interface within the subnet.

                • PrivateDnsName (string) --

                  The private DNS name.

                • SourceDestCheck (boolean) --

                  Indicates whether to validate network traffic to or from this network interface.

                • 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.

                • Attachment (dict) --

                  The network interface attachment.

                  • AttachmentId (string) --

                    The ID of the network interface attachment.

                  • DeviceIndex (integer) --

                    The index of the device on the instance for the network interface attachment.

                  • Status (string) --

                    The attachment state.

                  • AttachTime (datetime) --

                    The time stamp when the attachment initiated.

                  • DeleteOnTermination (boolean) --

                    Indicates whether the network interface is deleted when the instance is terminated.

                • Association (dict) --

                  The association information for an Elastic IP associated with the network interface.

                  • PublicIp (string) --

                    The public IP address or Elastic IP address bound to the network interface.

                  • PublicDnsName (string) --

                    The public DNS name.

                  • IpOwnerId (string) --

                    The ID of the owner of the Elastic IP address.

                • PrivateIpAddresses (list) --

                  The private IP addresses associated with the network interface.

                  • (dict) --

                    Describes a private IP address.

                    • PrivateIpAddress (string) --

                      The private IP address of the network interface.

                    • PrivateDnsName (string) --

                      The private DNS name.

                    • Primary (boolean) --

                      Indicates whether this IP address is the primary private IP address of the network interface.

                    • Association (dict) --

                      The association information for an Elastic IP address for the network interface.

                      • PublicIp (string) --

                        The public IP address or Elastic IP address bound to the network interface.

                      • PublicDnsName (string) --

                        The public DNS name.

                      • IpOwnerId (string) --

                        The ID of the owner of the Elastic IP address.

            • IamInstanceProfile (dict) --

              The IAM instance profile associated with the instance.

              • Arn (string) --

                The Amazon Resource Name (ARN) of the instance profile.

              • Id (string) --

                The ID of the instance profile.

            • 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 I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.

            • SriovNetSupport (string) --

              Specifies whether enhanced networking is enabled.

    • 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.

AttachNetworkInterface (new) Link ¶

Attaches a network interface to an instance.

Request Syntax

client.attach_network_interface(
    DryRun=True|False,
    NetworkInterfaceId='string',
    InstanceId='string',
    DeviceIndex=123
)
type DryRun:

boolean

param DryRun:

type NetworkInterfaceId:

string

param NetworkInterfaceId:

[REQUIRED]

The ID of the network interface.

type InstanceId:

string

param InstanceId:

[REQUIRED]

The ID of the instance.

type DeviceIndex:

integer

param DeviceIndex:

[REQUIRED]

The index of the device for the network interface attachment.

rtype:

dict

returns:

Response Syntax

{
    'AttachmentId': 'string'
}

Response Structure

  • (dict) --

    • AttachmentId (string) --

      The ID of the network interface attachment.

ReplaceNetworkAclAssociation (new) Link ¶

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 about network ACLs, see Network ACLs in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.replace_network_acl_association(
    DryRun=True|False,
    AssociationId='string',
    NetworkAclId='string'
)
type DryRun:

boolean

param DryRun:

type AssociationId:

string

param AssociationId:

[REQUIRED]

The ID of the current association between the original network ACL and the subnet.

type NetworkAclId:

string

param NetworkAclId:

[REQUIRED]

The ID of the new network ACL to associate with the subnet.

rtype:

dict

returns:

Response Syntax

{
    'NewAssociationId': 'string'
}

Response Structure

  • (dict) --

    • NewAssociationId (string) --

      The ID of the new association.

BundleInstance (new) Link ¶

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.

For more information, see Creating an Instance Store-Backed Windows AMI.

Request Syntax

client.bundle_instance(
    DryRun=True|False,
    InstanceId='string',
    Storage={
        'S3': {
            'Bucket': 'string',
            'Prefix': 'string',
            'AWSAccessKeyId': 'string',
            'UploadPolicy': b'bytes',
            'UploadPolicySignature': 'string'
        }
    }
)
type DryRun:

boolean

param DryRun:

type InstanceId:

string

param InstanceId:

[REQUIRED]

The ID of the instance to bundle.

Type: String

Default: None

Required: Yes

type Storage:

dict

param Storage:

[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.

  • S3 (dict) --

    An Amazon S3 storage location.

    • 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.

    • 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.

    • UploadPolicy (bytes) --

      A Base64-encoded Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.

    • UploadPolicySignature (string) --

      The signature of the Base64 encoded JSON document.

rtype:

dict

returns:

Response Syntax

{
    'BundleTask': {
        'InstanceId': 'string',
        'BundleId': 'string',
        'State': 'pending'|'waiting-for-shutdown'|'bundling'|'storing'|'cancelling'|'complete'|'failed',
        'StartTime': datetime(2015, 1, 1),
        'UpdateTime': datetime(2015, 1, 1),
        'Storage': {
            'S3': {
                'Bucket': 'string',
                'Prefix': 'string',
                'AWSAccessKeyId': 'string',
                'UploadPolicy': b'bytes',
                'UploadPolicySignature': 'string'
            }
        },
        'Progress': 'string',
        'BundleTaskError': {
            'Code': 'string',
            'Message': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • BundleTask (dict) --

      Information about the bundle task.

      • InstanceId (string) --

        The ID of the instance associated with this bundle task.

      • BundleId (string) --

        The ID of the bundle task.

      • State (string) --

        The state of the task.

      • StartTime (datetime) --

        The time this task started.

      • UpdateTime (datetime) --

        The time of the most recent update for the task.

      • Storage (dict) --

        The Amazon S3 storage locations.

        • S3 (dict) --

          An Amazon S3 storage location.

          • 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.

          • 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.

          • UploadPolicy (bytes) --

            A Base64-encoded Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.

          • UploadPolicySignature (string) --

            The signature of the Base64 encoded JSON document.

      • Progress (string) --

        The level of task completion, as a percent (for example, 20%).

      • BundleTaskError (dict) --

        If the task fails, a description of the error.

        • Code (string) --

          The error code.

        • Message (string) --

          The error message.

RunInstances (new) Link ¶

Launches the specified number of instances using an AMI for which you have permissions.

When you launch an instance, it enters the pending state. After the instance is ready for you, it enters the running state. To check the state of your instance, call DescribeInstances.

If you don't specify a security group when launching an instance, Amazon EC2 uses the default security group. For more information, see Security Groups in the Amazon Elastic Compute Cloud User Guide for Linux.

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 Linux.

You can provide optional user data when launching an instance. For more information, see Instance Metadata in the Amazon Elastic Compute Cloud User Guide for Linux.

If any of the AMIs have a product code attached for which the user has not subscribed, RunInstances fails.

T2 instance types can only be launched into a VPC. If you do not have a default VPC, or if you do not specify a subnet ID in the request, RunInstances fails.

For more information about troubleshooting, see What To Do If An Instance Immediately Terminates, and Troubleshooting Connecting to Your Instance in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.run_instances(
    DryRun=True|False,
    ImageId='string',
    MinCount=123,
    MaxCount=123,
    KeyName='string',
    SecurityGroups=[
        'string',
    ],
    SecurityGroupIds=[
        'string',
    ],
    UserData='string',
    InstanceType='t1.micro'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'t2.micro'|'t2.small'|'t2.medium'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'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'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'cg1.4xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge',
    Placement={
        'AvailabilityZone': 'string',
        'GroupName': 'string',
        'Tenancy': 'default'|'dedicated'
    },
    KernelId='string',
    RamdiskId='string',
    BlockDeviceMappings=[
        {
            'VirtualName': 'string',
            'DeviceName': 'string',
            'Ebs': {
                'SnapshotId': 'string',
                'VolumeSize': 123,
                'DeleteOnTermination': True|False,
                'VolumeType': 'standard'|'io1'|'gp2',
                'Iops': 123,
                'Encrypted': True|False
            },
            'NoDevice': 'string'
        },
    ],
    Monitoring={
        'Enabled': True|False
    },
    SubnetId='string',
    DisableApiTermination=True|False,
    InstanceInitiatedShutdownBehavior='stop'|'terminate',
    PrivateIpAddress='string',
    ClientToken='string',
    AdditionalInfo='string',
    NetworkInterfaces=[
        {
            'NetworkInterfaceId': 'string',
            'DeviceIndex': 123,
            'SubnetId': 'string',
            'Description': 'string',
            'PrivateIpAddress': 'string',
            'Groups': [
                'string',
            ],
            'DeleteOnTermination': True|False,
            'PrivateIpAddresses': [
                {
                    'PrivateIpAddress': 'string',
                    'Primary': True|False
                },
            ],
            'SecondaryPrivateIpAddressCount': 123,
            'AssociatePublicIpAddress': True|False
        },
    ],
    IamInstanceProfile={
        'Arn': 'string',
        'Name': 'string'
    },
    EbsOptimized=True|False
)
type DryRun:

boolean

param DryRun:

type ImageId:

string

param ImageId:

[REQUIRED]

The ID of the AMI, which you can get by calling DescribeImages.

type MinCount:

integer

param MinCount:

[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.

type MaxCount:

integer

param MaxCount:

[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 General FAQ.

type KeyName:

string

param KeyName:

The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair.

type SecurityGroups:

list

param SecurityGroups:

[EC2-Classic, default VPC] One or more security group names. For a nondefault VPC, you must use security group IDs instead.

Default: Amazon EC2 uses the default security group.

  • (string) --

type SecurityGroupIds:

list

param SecurityGroupIds:

One or more security group IDs. You can create a security group using CreateSecurityGroup.

Default: Amazon EC2 uses the default security group.

  • (string) --

type UserData:

string

param UserData:

The Base64-encoded MIME user data for the instances.

type InstanceType:

string

param InstanceType:

The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide for Linux.

Default: m1.small

type Placement:

dict

param Placement:

The placement for the instance.

  • AvailabilityZone (string) --

    The Availability Zone of the instance.

  • GroupName (string) --

    The name of the placement group the instance is in (for cluster compute instances).

  • 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.

type KernelId:

string

param KernelId:

The ID of the kernel.

type RamdiskId:

string

param RamdiskId:

The ID of the RAM disk.

type BlockDeviceMappings:

list

param BlockDeviceMappings:

The block device mapping.

  • (dict) --

    Describes a block device mapping.

    • 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.

      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.

    • DeviceName (string) --

      The device name exposed to the instance (for example, /dev/sdh or xvdh).

    • Ebs (dict) --

      Parameters used to automatically set up Amazon EBS volumes when the instance is launched.

      • SnapshotId (string) --

        The ID of the snapshot.

      • VolumeSize (integer) --

        The size of the volume, in GiB.

        Constraints: 1-1024 for standard volumes, 1-16384 for gp2 volumes, and 4-16384 for io1 volumes. 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.

      • DeleteOnTermination (boolean) --

        Indicates whether the Amazon EBS volume is deleted on instance termination.

      • VolumeType (string) --

        The volume type. gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic volumes.

        Default: standard

      • 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 on General Purpose (SSD) baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide for Linux.

        Constraint: Range is 100 to 20000 for Provisioned IOPS (SSD) volumes and 3 to 10000 for General Purpose (SSD) volumes.

        Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create standard or gp2 volumes.

      • Encrypted (boolean) --

        Indicates whether the Amazon EBS volume is encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption.

    • NoDevice (string) --

      Suppresses the specified device included in the block device mapping of the AMI.

type Monitoring:

dict

param Monitoring:

The monitoring for the instance.

  • Enabled (boolean) -- [REQUIRED]

    Indicates whether monitoring is enabled for the instance.

type SubnetId:

string

param SubnetId:

[EC2-VPC] The ID of the subnet to launch the instance into.

type DisableApiTermination:

boolean

param DisableApiTermination:

If you set this parameter to true, you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. If you set this parameter to true and then later want to be able to terminate the instance, you must first change the value of the disableApiTermination attribute to false using ModifyInstanceAttribute. Alternatively, if you set InstanceInitiatedShutdownBehavior to terminate, you can terminate the instance by running the shutdown command from the instance.

Default: false

type InstanceInitiatedShutdownBehavior:

string

param InstanceInitiatedShutdownBehavior:

Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

Default: stop

type PrivateIpAddress:

string

param PrivateIpAddress:

[EC2-VPC] The primary IP address. You must specify a value from the IP address range of the subnet.

Only one private IP address can be designated as primary. Therefore, you can't specify this parameter if PrivateIpAddresses.n.Primary is set to true and PrivateIpAddresses.n.PrivateIpAddress is set to an IP address.

Default: We select an IP address from the IP address range of the subnet.

type ClientToken:

string

param ClientToken:

Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency.

Constraints: Maximum 64 ASCII characters

type AdditionalInfo:

string

param AdditionalInfo:

Reserved.

type NetworkInterfaces:

list

param NetworkInterfaces:

One or more network interfaces.

  • (dict) --

    Describes a network interface.

    • NetworkInterfaceId (string) --

      The ID of the network interface.

    • DeviceIndex (integer) --

      The index of the device on the instance for the network interface attachment. If you are specifying a network interface in a RunInstances request, you must provide the device index.

    • SubnetId (string) --

      The ID of the subnet associated with the network string. Applies only if creating a 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.

    • PrivateIpAddress (string) --

      The private IP address of the network interface. Applies only if creating a network interface when launching an instance.

    • Groups (list) --

      The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.

      • (string) --

    • 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.

    • PrivateIpAddresses (list) --

      One or more private IP addresses to assign to the network interface. Only one private IP address can be designated as primary.

      • (dict) --

        Describes a secondary private IP address for a network interface.

        • PrivateIpAddress (string) -- [REQUIRED]

          The private IP addresses.

        • Primary (boolean) --

          Indicates whether the private IP address is the primary private IP address. Only one IP address can be designated as primary.

    • SecondaryPrivateIpAddressCount (integer) --

      The number of secondary private IP addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option.

    • AssociatePublicIpAddress (boolean) --

      Indicates whether to assign a public IP 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.

type IamInstanceProfile:

dict

param IamInstanceProfile:

The IAM instance profile.

  • Arn (string) --

    The Amazon Resource Name (ARN) of the instance profile.

  • Name (string) --

    The name of the instance profile.

type EbsOptimized:

boolean

param EbsOptimized:

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 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

rtype:

dict

returns:

Response Syntax

{
    'ReservationId': 'string',
    'OwnerId': 'string',
    'RequesterId': 'string',
    'Groups': [
        {
            'GroupName': 'string',
            'GroupId': 'string'
        },
    ],
    'Instances': [
        {
            'InstanceId': 'string',
            'ImageId': 'string',
            'State': {
                'Code': 123,
                'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
            },
            'PrivateDnsName': 'string',
            'PublicDnsName': 'string',
            'StateTransitionReason': 'string',
            'KeyName': 'string',
            'AmiLaunchIndex': 123,
            'ProductCodes': [
                {
                    'ProductCodeId': 'string',
                    'ProductCodeType': 'devpay'|'marketplace'
                },
            ],
            'InstanceType': 't1.micro'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'t2.micro'|'t2.small'|'t2.medium'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'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'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'cg1.4xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge',
            'LaunchTime': datetime(2015, 1, 1),
            'Placement': {
                'AvailabilityZone': 'string',
                'GroupName': 'string',
                'Tenancy': 'default'|'dedicated'
            },
            'KernelId': 'string',
            'RamdiskId': 'string',
            'Platform': 'Windows',
            'Monitoring': {
                'State': 'disabled'|'disabling'|'enabled'|'pending'
            },
            'SubnetId': 'string',
            'VpcId': 'string',
            'PrivateIpAddress': 'string',
            'PublicIpAddress': 'string',
            'StateReason': {
                'Code': 'string',
                'Message': 'string'
            },
            'Architecture': 'i386'|'x86_64',
            'RootDeviceType': 'ebs'|'instance-store',
            'RootDeviceName': 'string',
            'BlockDeviceMappings': [
                {
                    'DeviceName': 'string',
                    'Ebs': {
                        'VolumeId': 'string',
                        'Status': 'attaching'|'attached'|'detaching'|'detached',
                        'AttachTime': datetime(2015, 1, 1),
                        'DeleteOnTermination': True|False
                    }
                },
            ],
            'VirtualizationType': 'hvm'|'paravirtual',
            'InstanceLifecycle': 'spot',
            'SpotInstanceRequestId': 'string',
            'ClientToken': 'string',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'SecurityGroups': [
                {
                    'GroupName': 'string',
                    'GroupId': 'string'
                },
            ],
            'SourceDestCheck': True|False,
            'Hypervisor': 'ovm'|'xen',
            'NetworkInterfaces': [
                {
                    'NetworkInterfaceId': 'string',
                    'SubnetId': 'string',
                    'VpcId': 'string',
                    'Description': 'string',
                    'OwnerId': 'string',
                    'Status': 'available'|'attaching'|'in-use'|'detaching',
                    'MacAddress': 'string',
                    'PrivateIpAddress': 'string',
                    'PrivateDnsName': 'string',
                    'SourceDestCheck': True|False,
                    'Groups': [
                        {
                            'GroupName': 'string',
                            'GroupId': 'string'
                        },
                    ],
                    'Attachment': {
                        'AttachmentId': 'string',
                        'DeviceIndex': 123,
                        'Status': 'attaching'|'attached'|'detaching'|'detached',
                        'AttachTime': datetime(2015, 1, 1),
                        'DeleteOnTermination': True|False
                    },
                    'Association': {
                        'PublicIp': 'string',
                        'PublicDnsName': 'string',
                        'IpOwnerId': 'string'
                    },
                    'PrivateIpAddresses': [
                        {
                            'PrivateIpAddress': 'string',
                            'PrivateDnsName': 'string',
                            'Primary': True|False,
                            'Association': {
                                'PublicIp': 'string',
                                'PublicDnsName': 'string',
                                'IpOwnerId': 'string'
                            }
                        },
                    ]
                },
            ],
            'IamInstanceProfile': {
                'Arn': 'string',
                'Id': 'string'
            },
            'EbsOptimized': True|False,
            'SriovNetSupport': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    One or more reservations.

    • ReservationId (string) --

      The ID of the reservation.

    • 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).

    • 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.

    • Instances (list) --

      One or more instances.

      • (dict) --

        Describes an instance.

        • InstanceId (string) --

          The ID of the instance.

        • ImageId (string) --

          The ID of the AMI used to launch the instance.

        • State (dict) --

          The current state of the instance.

          • Code (integer) --

            The low byte represents the state. The high byte is an opaque internal value and should be ignored.

            • 0 : pending

            • 16 : running

            • 32 : shutting-down

            • 48 : terminated

            • 64 : stopping

            • 80 : stopped

          • Name (string) --

            The current state of the instance.

        • PrivateDnsName (string) --

          The private DNS name assigned to the instance. This DNS name can only be used inside the Amazon EC2 network. This name is not available until the instance enters the running state.

        • PublicDnsName (string) --

          The public DNS name assigned to the instance. This name is not available until the instance enters the running state.

        • StateTransitionReason (string) --

          The reason for the most recent state transition. This might be an empty string.

        • KeyName (string) --

          The name of the key pair, if this instance was launched with an associated key pair.

        • AmiLaunchIndex (integer) --

          The AMI launch index, which can be used to find this instance in the launch group.

        • ProductCodes (list) --

          The product codes attached to this instance.

          • (dict) --

            Describes a product code.

            • ProductCodeId (string) --

              The product code.

            • ProductCodeType (string) --

              The type of product code.

        • InstanceType (string) --

          The instance type.

        • LaunchTime (datetime) --

          The time the instance was launched.

        • Placement (dict) --

          The location where the instance launched.

          • AvailabilityZone (string) --

            The Availability Zone of the instance.

          • GroupName (string) --

            The name of the placement group the instance is in (for cluster compute instances).

          • 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.

        • KernelId (string) --

          The kernel associated with this instance.

        • RamdiskId (string) --

          The RAM disk associated with this instance.

        • Platform (string) --

          The value is Windows for Windows instances; otherwise blank.

        • Monitoring (dict) --

          The monitoring information for the instance.

          • State (string) --

            Indicates whether monitoring is enabled for the instance.

        • SubnetId (string) --

          The ID of the subnet in which the instance is running.

        • VpcId (string) --

          The ID of the VPC in which the instance is running.

        • PrivateIpAddress (string) --

          The private IP address assigned to the instance.

        • PublicIpAddress (string) --

          The public IP address assigned to the instance.

        • 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.

            • Server.SpotInstanceTermination: A Spot Instance was terminated due to an increase in the market price.

            • Server.InternalError: An internal error occurred during instance launch, resulting in termination.

            • Server.InsufficientInstanceCapacity: There was insufficient instance capacity to satisfy the launch request.

            • Client.InternalError: A client error caused the instance to terminate on launch.

            • Client.InstanceInitiatedShutdown: The instance was shut down using the shutdown -h command from the instance.

            • Client.UserInitiatedShutdown: The instance was shut down using the Amazon EC2 API.

            • Client.VolumeLimitExceeded: The volume limit was exceeded.

            • Client.InvalidSnapshot.NotFound: The specified snapshot was not found.

        • Architecture (string) --

          The architecture of the image.

        • RootDeviceType (string) --

          The root device type used by the AMI. The AMI can use an Amazon EBS volume or an instance store volume.

        • RootDeviceName (string) --

          The root device name (for example, /dev/sda1 or /dev/xvda).

        • BlockDeviceMappings (list) --

          Any block device mapping entries for the instance.

          • (dict) --

            Describes a block device mapping.

            • DeviceName (string) --

              The device name exposed to the instance (for example, /dev/sdh or xvdh).

            • Ebs (dict) --

              Parameters used to automatically set up Amazon EBS volumes when the instance is launched.

              • VolumeId (string) --

                The ID of the Amazon EBS volume.

              • Status (string) --

                The attachment state.

              • AttachTime (datetime) --

                The time stamp when the attachment initiated.

              • DeleteOnTermination (boolean) --

                Indicates whether the volume is deleted on instance termination.

        • VirtualizationType (string) --

          The virtualization type of the instance.

        • InstanceLifecycle (string) --

          Indicates whether this is a Spot Instance.

        • SpotInstanceRequestId (string) --

          The ID of the Spot Instance request.

        • ClientToken (string) --

          The idempotency token you provided when you launched 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.

        • SecurityGroups (list) --

          One or more 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 checking is enabled, and false means 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.

        • Hypervisor (string) --

          The hypervisor type of the instance.

        • NetworkInterfaces (list) --

          [EC2-VPC] One or more network interfaces for the instance.

          • (dict) --

            Describes a network interface.

            • NetworkInterfaceId (string) --

              The ID of the network interface.

            • SubnetId (string) --

              The ID of the subnet.

            • VpcId (string) --

              The ID of the VPC.

            • Description (string) --

              The description.

            • OwnerId (string) --

              The ID of the AWS account that created the network interface.

            • Status (string) --

              The status of the network interface.

            • MacAddress (string) --

              The MAC address.

            • PrivateIpAddress (string) --

              The IP address of the network interface within the subnet.

            • PrivateDnsName (string) --

              The private DNS name.

            • SourceDestCheck (boolean) --

              Indicates whether to validate network traffic to or from this network interface.

            • 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.

            • Attachment (dict) --

              The network interface attachment.

              • AttachmentId (string) --

                The ID of the network interface attachment.

              • DeviceIndex (integer) --

                The index of the device on the instance for the network interface attachment.

              • Status (string) --

                The attachment state.

              • AttachTime (datetime) --

                The time stamp when the attachment initiated.

              • DeleteOnTermination (boolean) --

                Indicates whether the network interface is deleted when the instance is terminated.

            • Association (dict) --

              The association information for an Elastic IP associated with the network interface.

              • PublicIp (string) --

                The public IP address or Elastic IP address bound to the network interface.

              • PublicDnsName (string) --

                The public DNS name.

              • IpOwnerId (string) --

                The ID of the owner of the Elastic IP address.

            • PrivateIpAddresses (list) --

              The private IP addresses associated with the network interface.

              • (dict) --

                Describes a private IP address.

                • PrivateIpAddress (string) --

                  The private IP address of the network interface.

                • PrivateDnsName (string) --

                  The private DNS name.

                • Primary (boolean) --

                  Indicates whether this IP address is the primary private IP address of the network interface.

                • Association (dict) --

                  The association information for an Elastic IP address for the network interface.

                  • PublicIp (string) --

                    The public IP address or Elastic IP address bound to the network interface.

                  • PublicDnsName (string) --

                    The public DNS name.

                  • IpOwnerId (string) --

                    The ID of the owner of the Elastic IP address.

        • IamInstanceProfile (dict) --

          The IAM instance profile associated with the instance.

          • Arn (string) --

            The Amazon Resource Name (ARN) of the instance profile.

          • Id (string) --

            The ID of the instance profile.

        • 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 I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.

        • SriovNetSupport (string) --

          Specifies whether enhanced networking is enabled.

StopInstances (new) Link ¶

Stops an Amazon EBS-backed instance. Each time you transition an instance from stopped to started, Amazon EC2 charges a full instance hour, even if transitions happen multiple times within a single hour.

You can't start or stop Spot Instances.

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 hourly instance usage. However, your root partition Amazon EBS volume remains, continues to persist your data, and you are charged for Amazon EBS volume usage. You can restart your instance at any time.

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.

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, the root device and any other devices attached during the instance launch 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 Linux.

For more information about troubleshooting, see Troubleshooting Stopping Your Instance in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.stop_instances(
    DryRun=True|False,
    InstanceIds=[
        'string',
    ],
    Force=True|False
)
type DryRun:

boolean

param DryRun:

type InstanceIds:

list

param InstanceIds:

[REQUIRED]

One or more instance IDs.

  • (string) --

type Force:

boolean

param Force:

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

rtype:

dict

returns:

Response Syntax

{
    'StoppingInstances': [
        {
            'InstanceId': 'string',
            'CurrentState': {
                'Code': 123,
                'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
            },
            'PreviousState': {
                'Code': 123,
                'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
            }
        },
    ]
}

Response Structure

  • (dict) --

    • StoppingInstances (list) --

      Information about one or more stopped instances.

      • (dict) --

        Describes an instance state change.

        • InstanceId (string) --

          The ID of the instance.

        • CurrentState (dict) --

          The current state of the instance.

          • Code (integer) --

            The low byte represents the state. The high byte is an opaque internal value and should be ignored.

            • 0 : pending

            • 16 : running

            • 32 : shutting-down

            • 48 : terminated

            • 64 : stopping

            • 80 : stopped

          • Name (string) --

            The current state of the instance.

        • PreviousState (dict) --

          The previous state of the instance.

          • Code (integer) --

            The low byte represents the state. The high byte is an opaque internal value and should be ignored.

            • 0 : pending

            • 16 : running

            • 32 : shutting-down

            • 48 : terminated

            • 64 : stopping

            • 80 : stopped

          • Name (string) --

            The current state of the instance.

ResetSnapshotAttribute (new) Link ¶

Resets permission settings for the specified snapshot.

For more information on modifying snapshot permissions, see Sharing Snapshots in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.reset_snapshot_attribute(
    DryRun=True|False,
    SnapshotId='string',
    Attribute='productCodes'|'createVolumePermission'
)
type DryRun:

boolean

param DryRun:

type SnapshotId:

string

param SnapshotId:

[REQUIRED]

The ID of the snapshot.

type Attribute:

string

param Attribute:

[REQUIRED]

The attribute to reset (currently only the attribute for permission to create volumes can be reset).

returns:

None

CancelConversionTask (new) Link ¶

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 Using the Command Line Tools to Import Your Virtual Machine to Amazon EC2 in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.cancel_conversion_task(
    DryRun=True|False,
    ConversionTaskId='string',
    ReasonMessage='string'
)
type DryRun:

boolean

param DryRun:

type ConversionTaskId:

string

param ConversionTaskId:

[REQUIRED]

The ID of the conversion task.

type ReasonMessage:

string

param ReasonMessage:

returns:

None

DescribeAvailabilityZones (new) Link ¶

Describes one or more of 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 for Linux.

Request Syntax

client.describe_availability_zones(
    DryRun=True|False,
    ZoneNames=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type ZoneNames:

list

param ZoneNames:

The names of one or more Availability Zones.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • message - Information about the Availability Zone.

  • region-name - The name of the region for the Availability Zone (for example, us-east-1).

  • state - The state of the Availability Zone ( available | impaired | unavailable).

  • zone-name - The name of the Availability Zone (for example, us-east-1a).

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'AvailabilityZones': [
        {
            'ZoneName': 'string',
            'State': 'available',
            'RegionName': 'string',
            'Messages': [
                {
                    'Message': 'string'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • AvailabilityZones (list) --

      Information about one or more Availability Zones.

      • (dict) --

        Describes an Availability Zone.

        • ZoneName (string) --

          The name of the Availability Zone.

        • State (string) --

          The state of the Availability Zone ( available | impaired | unavailable).

        • RegionName (string) --

          The name of the region.

        • Messages (list) --

          Any messages about the Availability Zone.

          • (dict) --

            Describes a message about an Availability Zone.

            • Message (string) --

              The message about the Availability Zone.

DescribeRouteTables (new) Link ¶

Describes one or more of your route tables.

For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.describe_route_tables(
    DryRun=True|False,
    RouteTableIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type RouteTableIds:

list

param RouteTableIds:

One or more route table IDs.

Default: Describes all your route tables.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • association.route-table-association-id - The ID of an association ID for the route table.

  • association.route-table-id - The ID of the route table involved in the association.

  • association.subnet-id - The ID of the subnet involved in the association.

  • association.main - Indicates whether the route table is the main route table for the VPC.

  • route-table-id - The ID of the route table.

  • route.destination-cidr-block - The CIDR range specified in a route in the table.

  • route.gateway-id - The ID of a gateway specified in a route in the table.

  • route.instance-id - The ID of an instance specified in a route in the table.

  • route.origin - Describes how the route was created. CreateRouteTable indicates that the route was automatically created when the route table was created; CreateRoute indicates that the route was manually added to the route table; EnableVgwRoutePropagation indicates that the route was propagated by route propagation.

  • route.state - The state of a route in the route table ( active | blackhole). The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, the specified NAT instance has been terminated, and so on).

  • route.vpc-peering-connection-id - The ID of a VPC peering connection specified in a route in the table.

  • tag:key*=*value - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key*=*value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • vpc-id - The ID of the VPC for the route table.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'RouteTables': [
        {
            'RouteTableId': 'string',
            'VpcId': 'string',
            'Routes': [
                {
                    'DestinationCidrBlock': 'string',
                    'GatewayId': 'string',
                    'InstanceId': 'string',
                    'InstanceOwnerId': 'string',
                    'NetworkInterfaceId': 'string',
                    'VpcPeeringConnectionId': 'string',
                    'State': 'active'|'blackhole',
                    'Origin': 'CreateRouteTable'|'CreateRoute'|'EnableVgwRoutePropagation'
                },
            ],
            'Associations': [
                {
                    'RouteTableAssociationId': 'string',
                    'RouteTableId': 'string',
                    'SubnetId': 'string',
                    'Main': True|False
                },
            ],
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'PropagatingVgws': [
                {
                    'GatewayId': 'string'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • RouteTables (list) --

      Information about one or more route tables.

      • (dict) --

        Describes a route table.

        • RouteTableId (string) --

          The ID of the route table.

        • VpcId (string) --

          The ID of the VPC.

        • Routes (list) --

          The routes in the route table.

          • (dict) --

            Describes a route in a route table.

            • DestinationCidrBlock (string) --

              The CIDR block used for the destination match.

            • 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.

            • NetworkInterfaceId (string) --

              The ID of the network interface.

            • VpcPeeringConnectionId (string) --

              The ID of the VPC peering connection.

            • 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).

            • Origin (string) --

              Describes how the route was created.

              • CreateRouteTable indicates that route was automatically created when the route table was created.

              • CreateRoute indicates that the route was manually added to the route table.

              • EnableVgwRoutePropagation indicates that the route was propagated by route propagation.

        • Associations (list) --

          The associations between the route table and one or more subnets.

          • (dict) --

            Describes an association between a route table and a subnet.

            • 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.

            • Main (boolean) --

              Indicates whether this is the main route table.

        • 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.

        • 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 (VGW).

DeleteCustomerGateway (new) Link ¶

Deletes the specified customer gateway. You must delete the VPN connection before you can delete the customer gateway.

Request Syntax

client.delete_customer_gateway(
    DryRun=True|False,
    CustomerGatewayId='string'
)
type DryRun:

boolean

param DryRun:

type CustomerGatewayId:

string

param CustomerGatewayId:

[REQUIRED]

The ID of the customer gateway.

returns:

None

CreateImage (new) Link ¶

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 for Linux.

Request Syntax

client.create_image(
    DryRun=True|False,
    InstanceId='string',
    Name='string',
    Description='string',
    NoReboot=True|False,
    BlockDeviceMappings=[
        {
            'VirtualName': 'string',
            'DeviceName': 'string',
            'Ebs': {
                'SnapshotId': 'string',
                'VolumeSize': 123,
                'DeleteOnTermination': True|False,
                'VolumeType': 'standard'|'io1'|'gp2',
                'Iops': 123,
                'Encrypted': True|False
            },
            'NoDevice': 'string'
        },
    ]
)
type DryRun:

boolean

param DryRun:

type InstanceId:

string

param InstanceId:

[REQUIRED]

The ID of the instance.

type Name:

string

param Name:

[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(_)

type Description:

string

param Description:

A description for the new image.

type NoReboot:

boolean

param NoReboot:

By default, this parameter is set to false, which means Amazon EC2 attempts to shut down the instance cleanly before image creation and then reboots the instance. When the parameter is set to true, Amazon EC2 doesn't shut down the instance before creating the image. When this option is used, file system integrity on the created image can't be guaranteed.

type BlockDeviceMappings:

list

param BlockDeviceMappings:

Information about one or more block device mappings.

  • (dict) --

    Describes a block device mapping.

    • 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.

      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.

    • DeviceName (string) --

      The device name exposed to the instance (for example, /dev/sdh or xvdh).

    • Ebs (dict) --

      Parameters used to automatically set up Amazon EBS volumes when the instance is launched.

      • SnapshotId (string) --

        The ID of the snapshot.

      • VolumeSize (integer) --

        The size of the volume, in GiB.

        Constraints: 1-1024 for standard volumes, 1-16384 for gp2 volumes, and 4-16384 for io1 volumes. 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.

      • DeleteOnTermination (boolean) --

        Indicates whether the Amazon EBS volume is deleted on instance termination.

      • VolumeType (string) --

        The volume type. gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic volumes.

        Default: standard

      • 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 on General Purpose (SSD) baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide for Linux.

        Constraint: Range is 100 to 20000 for Provisioned IOPS (SSD) volumes and 3 to 10000 for General Purpose (SSD) volumes.

        Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create standard or gp2 volumes.

      • Encrypted (boolean) --

        Indicates whether the Amazon EBS volume is encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption.

    • NoDevice (string) --

      Suppresses the specified device included in the block device mapping of the AMI.

rtype:

dict

returns:

Response Syntax

{
    'ImageId': 'string'
}

Response Structure

  • (dict) --

    • ImageId (string) --

      The ID of the new AMI.

DeleteTags (new) Link ¶

Deletes the specified set of tags from the specified set of resources. This call is designed to follow a DescribeTags request.

For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.delete_tags(
    DryRun=True|False,
    Resources=[
        'string',
    ],
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type DryRun:

boolean

param DryRun:

type Resources:

list

param Resources:

[REQUIRED]

The ID of the resource. For example, ami-1a2b3c4d. You can specify more than one resource ID.

  • (string) --

type Tags:

list

param Tags:

One or more tags to delete. If you omit the value parameter, we delete the tag regardless of its value. If you specify this parameter with an empty string as the value, we delete the key only if its value is an empty string.

  • (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.

returns:

None

RevokeSecurityGroupIngress (new) Link ¶

Removes one or more ingress rules from a security group. The values that you specify in the revoke request (for example, ports) must match the existing rule's values for the rule to be 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.

Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay might occur.

Request Syntax

client.revoke_security_group_ingress(
    DryRun=True|False,
    GroupName='string',
    GroupId='string',
    SourceSecurityGroupName='string',
    SourceSecurityGroupOwnerId='string',
    IpProtocol='string',
    FromPort=123,
    ToPort=123,
    CidrIp='string',
    IpPermissions=[
        {
            'IpProtocol': 'string',
            'FromPort': 123,
            'ToPort': 123,
            'UserIdGroupPairs': [
                {
                    'UserId': 'string',
                    'GroupName': 'string',
                    'GroupId': 'string'
                },
            ],
            'IpRanges': [
                {
                    'CidrIp': 'string'
                },
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type GroupName:

string

param GroupName:

[EC2-Classic, default VPC] The name of the security group.

type GroupId:

string

param GroupId:

The ID of the security group.

type SourceSecurityGroupName:

string

param SourceSecurityGroupName:

[EC2-Classic, default VPC] The name of the source security group. You can't specify a source security group and a CIDR IP address range.

type SourceSecurityGroupOwnerId:

string

param SourceSecurityGroupOwnerId:

The ID of the source security group. You can't specify a source security group and a CIDR IP address range.

type IpProtocol:

string

param IpProtocol:

The IP protocol name ( tcp, udp, icmp) or number (see Protocol Numbers). Use -1 to specify all.

type FromPort:

integer

param FromPort:

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 ICMP types.

type ToPort:

integer

param ToPort:

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 ICMP codes for the ICMP type.

type CidrIp:

string

param CidrIp:

The CIDR IP address range. You can't specify this parameter when specifying a source security group.

type IpPermissions:

list

param IpPermissions:

A set of IP permissions. You can't specify a source security group and a CIDR IP address range.

  • (dict) --

    Describes a security group rule.

    • IpProtocol (string) --

      The protocol.

      When you call DescribeSecurityGroups, the protocol value returned is the number. Exception: For TCP, UDP, and ICMP, the value returned is the name (for example, tcp, udp, or icmp). For a list of protocol numbers, see Protocol Numbers. (VPC only) When you call AuthorizeSecurityGroupIngress, you can use -1 to specify all.

    • FromPort (integer) --

      The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.

    • ToPort (integer) --

      The end of port range for the TCP and UDP protocols, or an ICMP code. A value of -1 indicates all ICMP codes for the specified ICMP type.

    • UserIdGroupPairs (list) --

      One or more security group and AWS account ID pairs.

      • (dict) --

        Describes a security group and AWS account ID pair.

        • UserId (string) --

          The ID of an AWS account. EC2-Classic only.

        • 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 GroupId.

        • GroupId (string) --

          The ID of the security group.

    • IpRanges (list) --

      One or more IP ranges.

      • (dict) --

        Describes an IP range.

        • CidrIp (string) --

          The CIDR range. You can either specify a CIDR range or a source security group, not both.

returns:

None

ModifySnapshotAttribute (new) Link ¶

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 API call. If you need to both add and remove account IDs for a snapshot, you must use multiple API calls.

For more information on modifying snapshot permissions, see Sharing Snapshots in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.modify_snapshot_attribute(
    DryRun=True|False,
    SnapshotId='string',
    Attribute='productCodes'|'createVolumePermission',
    OperationType='string',
    UserIds=[
        'string',
    ],
    GroupNames=[
        'string',
    ],
    CreateVolumePermission={
        'Add': [
            {
                'UserId': 'string',
                'Group': 'all'
            },
        ],
        'Remove': [
            {
                'UserId': 'string',
                'Group': 'all'
            },
        ]
    }
)
type DryRun:

boolean

param DryRun:

type SnapshotId:

string

param SnapshotId:

[REQUIRED]

The ID of the snapshot.

type Attribute:

string

param Attribute:

The snapshot attribute to modify.

type OperationType:

string

param OperationType:

The type of operation to perform to the attribute.

type UserIds:

list

param UserIds:

The account ID to modify for the snapshot.

  • (string) --

type GroupNames:

list

param GroupNames:

The group to modify for the snapshot.

  • (string) --

type CreateVolumePermission:

dict

param CreateVolumePermission:

A JSON representation of the snapshot attribute modification.

  • Add (list) --

    Adds a specific AWS account ID or group to a volume's list of create volume permissions.

    • (dict) --

      • UserId (string) --

        The specific AWS account ID that is to be added or removed from a volume's list of create volume permissions.

      • Group (string) --

        The specific group that is to be added or removed from a volume's list of create volume permissions.

  • Remove (list) --

    Removes a specific AWS account ID or group from a volume's list of create volume permissions.

    • (dict) --

      • UserId (string) --

        The specific AWS account ID that is to be added or removed from a volume's list of create volume permissions.

      • Group (string) --

        The specific group that is to be added or removed from a volume's list of create volume permissions.

returns:

None

AssociateAddress (new) Link ¶

Associates an Elastic IP address with an instance or a network interface.

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 for Linux.

[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.

[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.

This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error.

Request Syntax

client.associate_address(
    DryRun=True|False,
    InstanceId='string',
    PublicIp='string',
    AllocationId='string',
    NetworkInterfaceId='string',
    PrivateIpAddress='string',
    AllowReassociation=True|False
)
type DryRun:

boolean

param DryRun:

type InstanceId:

string

param InstanceId:

The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you can specify either the instance ID or the network interface ID, but not both. The operation fails if you specify an instance ID unless exactly one network interface is attached.

type PublicIp:

string

param PublicIp:

The Elastic IP address. This is required for EC2-Classic.

type AllocationId:

string

param AllocationId:

[EC2-VPC] The allocation ID. This is required for EC2-VPC.

type NetworkInterfaceId:

string

param NetworkInterfaceId:

[EC2-VPC] The ID of the network interface. If the instance has more than one network interface, you must specify a network interface ID.

type PrivateIpAddress:

string

param PrivateIpAddress:

[EC2-VPC] The primary or secondary private IP address to associate with the Elastic IP address. If no private IP address is specified, the Elastic IP address is associated with the primary private IP address.

type AllowReassociation:

boolean

param AllowReassociation:

[EC2-VPC] Allows an Elastic IP address that is already associated with an instance or network interface to be re-associated with the specified instance or network interface. Otherwise, the operation fails.

Default: false

rtype:

dict

returns:

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.

DescribeNetworkInterfaceAttribute (new) Link ¶

Describes a network interface attribute. You can specify only one attribute at a time.

Request Syntax

client.describe_network_interface_attribute(
    DryRun=True|False,
    NetworkInterfaceId='string',
    Attribute='description'|'groupSet'|'sourceDestCheck'|'attachment'
)
type DryRun:

boolean

param DryRun:

type NetworkInterfaceId:

string

param NetworkInterfaceId:

[REQUIRED]

The ID of the network interface.

type Attribute:

string

param Attribute:

The attribute of the network interface.

rtype:

dict

returns:

Response Syntax

{
    'NetworkInterfaceId': 'string',
    'Description': {
        'Value': 'string'
    },
    'SourceDestCheck': {
        'Value': True|False
    },
    'Groups': [
        {
            'GroupName': 'string',
            'GroupId': 'string'
        },
    ],
    'Attachment': {
        'AttachmentId': 'string',
        'InstanceId': 'string',
        'InstanceOwnerId': 'string',
        'DeviceIndex': 123,
        'Status': 'attaching'|'attached'|'detaching'|'detached',
        'AttachTime': datetime(2015, 1, 1),
        'DeleteOnTermination': True|False
    }
}

Response Structure

  • (dict) --

    • NetworkInterfaceId (string) --

      The ID of the network interface.

    • Description (dict) --

      The description of the network interface.

      • Value (string) --

        Valid values are case-sensitive and vary by action.

    • SourceDestCheck (dict) --

      Indicates whether source/destination checking is enabled.

      • Value (boolean) --

        Valid values are true or false.

    • 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.

    • Attachment (dict) --

      The attachment (if any) of the network interface.

      • AttachmentId (string) --

        The ID of the network interface attachment.

      • InstanceId (string) --

        The ID of the instance.

      • InstanceOwnerId (string) --

        The AWS account ID of the owner of the instance.

      • DeviceIndex (integer) --

        The device index of the network interface attachment on the instance.

      • Status (string) --

        The attachment state.

      • AttachTime (datetime) --

        The timestamp indicating when the attachment initiated.

      • DeleteOnTermination (boolean) --

        Indicates whether the network interface is deleted when the instance is terminated.

CreateSecurityGroup (new) Link ¶

Creates a security group.

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 for Linux 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.

Request Syntax

client.create_security_group(
    DryRun=True|False,
    GroupName='string',
    Description='string',
    VpcId='string'
)
type DryRun:

boolean

param DryRun:

type GroupName:

string

param GroupName:

[REQUIRED]

The name of the security group.

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 ._-:/()#,@[]+=&;{}!$*

type Description:

string

param Description:

[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 ._-:/()#,@[]+=&;{}!$*

type VpcId:

string

param VpcId:

[EC2-VPC] The ID of the VPC. Required for EC2-VPC.

rtype:

dict

returns:

Response Syntax

{
    'GroupId': 'string'
}

Response Structure

  • (dict) --

    • GroupId (string) --

      The ID of the security group.

ImportKeyPair (new) Link ¶

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 for Linux.

Request Syntax

client.import_key_pair(
    DryRun=True|False,
    KeyName='string',
    PublicKeyMaterial=b'bytes'
)
type DryRun:

boolean

param DryRun:

type KeyName:

string

param KeyName:

[REQUIRED]

A unique name for the key pair.

type PublicKeyMaterial:

bytes

param PublicKeyMaterial:

[REQUIRED]

The public key. You must base64 encode the public key material before sending it to AWS.

rtype:

dict

returns:

Response Syntax

{
    'KeyName': 'string',
    'KeyFingerprint': 'string'
}

Response Structure

  • (dict) --

    • KeyName (string) --

      The key pair name you provided.

    • KeyFingerprint (string) --

      The MD5 public key fingerprint as specified in section 4 of RFC 4716.

ModifyVpcAttribute (new) Link ¶

Modifies the specified attribute of the specified VPC.

Request Syntax

client.modify_vpc_attribute(
    VpcId='string',
    EnableDnsSupport={
        'Value': True|False
    },
    EnableDnsHostnames={
        'Value': True|False
    }
)
type VpcId:

string

param VpcId:

[REQUIRED]

The ID of the VPC.

type EnableDnsSupport:

dict

param EnableDnsSupport:

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" will succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled.

  • Value (boolean) --

    Valid values are true or false.

type EnableDnsHostnames:

dict

param EnableDnsHostnames:

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 can only enable DNS hostnames if you also enable DNS support.

  • Value (boolean) --

    Valid values are true or false.

returns:

None

MonitorInstances (new) Link ¶

Enables monitoring for a running instance. For more information about monitoring instances, see Monitoring Your Instances and Volumes in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.monitor_instances(
    DryRun=True|False,
    InstanceIds=[
        'string',
    ]
)
type DryRun:

boolean

param DryRun:

type InstanceIds:

list

param InstanceIds:

[REQUIRED]

One or more instance IDs.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'InstanceMonitorings': [
        {
            'InstanceId': 'string',
            'Monitoring': {
                'State': 'disabled'|'disabling'|'enabled'|'pending'
            }
        },
    ]
}

Response Structure

  • (dict) --

    • InstanceMonitorings (list) --

      Monitoring information for one or more instances.

      • (dict) --

        Describes the monitoring information of the instance.

        • InstanceId (string) --

          The ID of the instance.

        • Monitoring (dict) --

          The monitoring information.

          • State (string) --

            Indicates whether monitoring is enabled for the instance.

DeleteNetworkAcl (new) Link ¶

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.

Request Syntax

client.delete_network_acl(
    DryRun=True|False,
    NetworkAclId='string'
)
type DryRun:

boolean

param DryRun:

type NetworkAclId:

string

param NetworkAclId:

[REQUIRED]

The ID of the network ACL.

returns:

None

DeleteRouteTable (new) Link ¶

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.

Request Syntax

client.delete_route_table(
    DryRun=True|False,
    RouteTableId='string'
)
type DryRun:

boolean

param DryRun:

type RouteTableId:

string

param RouteTableId:

[REQUIRED]

The ID of the route table.

returns:

None

DeleteInternetGateway (new) Link ¶

Deletes the specified Internet gateway. You must detach the Internet gateway from the VPC before you can delete it.

Request Syntax

client.delete_internet_gateway(
    DryRun=True|False,
    InternetGatewayId='string'
)
type DryRun:

boolean

param DryRun:

type InternetGatewayId:

string

param InternetGatewayId:

[REQUIRED]

The ID of the Internet gateway.

returns:

None

AuthorizeSecurityGroupEgress (new) Link ¶

Adds one or more egress rules to a security group for use with a VPC. Specifically, this action permits instances to send traffic to one or more destination CIDR IP address ranges, or to one or more destination security groups for the same VPC.

A security group is for use with instances either in the EC2-Classic platform or in a specific VPC. This action doesn't apply to security groups for use in EC2-Classic. For more information, see Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide.

Each rule consists of the protocol (for example, TCP), plus either a CIDR range or a source group. 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.

Request Syntax

client.authorize_security_group_egress(
    DryRun=True|False,
    GroupId='string',
    SourceSecurityGroupName='string',
    SourceSecurityGroupOwnerId='string',
    IpProtocol='string',
    FromPort=123,
    ToPort=123,
    CidrIp='string',
    IpPermissions=[
        {
            'IpProtocol': 'string',
            'FromPort': 123,
            'ToPort': 123,
            'UserIdGroupPairs': [
                {
                    'UserId': 'string',
                    'GroupName': 'string',
                    'GroupId': 'string'
                },
            ],
            'IpRanges': [
                {
                    'CidrIp': 'string'
                },
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type GroupId:

string

param GroupId:

[REQUIRED]

The ID of the security group.

type SourceSecurityGroupName:

string

param SourceSecurityGroupName:

[EC2-Classic, default VPC] The name of the destination security group. You can't specify a destination security group and a CIDR IP address range.

type SourceSecurityGroupOwnerId:

string

param SourceSecurityGroupOwnerId:

The ID of the destination security group. You can't specify a destination security group and a CIDR IP address range.

type IpProtocol:

string

param IpProtocol:

The IP protocol name ( tcp, udp, icmp) or number (see Protocol Numbers). Use -1 to specify all.

type FromPort:

integer

param FromPort:

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 ICMP types.

type ToPort:

integer

param ToPort:

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 ICMP codes for the ICMP type.

type CidrIp:

string

param CidrIp:

The CIDR IP address range. You can't specify this parameter when specifying a source security group.

type IpPermissions:

list

param IpPermissions:

A set of IP permissions. You can't specify a destination security group and a CIDR IP address range.

  • (dict) --

    Describes a security group rule.

    • IpProtocol (string) --

      The protocol.

      When you call DescribeSecurityGroups, the protocol value returned is the number. Exception: For TCP, UDP, and ICMP, the value returned is the name (for example, tcp, udp, or icmp). For a list of protocol numbers, see Protocol Numbers. (VPC only) When you call AuthorizeSecurityGroupIngress, you can use -1 to specify all.

    • FromPort (integer) --

      The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.

    • ToPort (integer) --

      The end of port range for the TCP and UDP protocols, or an ICMP code. A value of -1 indicates all ICMP codes for the specified ICMP type.

    • UserIdGroupPairs (list) --

      One or more security group and AWS account ID pairs.

      • (dict) --

        Describes a security group and AWS account ID pair.

        • UserId (string) --

          The ID of an AWS account. EC2-Classic only.

        • 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 GroupId.

        • GroupId (string) --

          The ID of the security group.

    • IpRanges (list) --

      One or more IP ranges.

      • (dict) --

        Describes an IP range.

        • CidrIp (string) --

          The CIDR range. You can either specify a CIDR range or a source security group, not both.

returns:

None

DescribeReservedInstancesModifications (new) Link ¶

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 for Linux.

Request Syntax

client.describe_reserved_instances_modifications(
    ReservedInstancesModificationIds=[
        'string',
    ],
    NextToken='string',
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type ReservedInstancesModificationIds:

list

param ReservedInstancesModificationIds:

IDs for the submitted modification request.

  • (string) --

type NextToken:

string

param NextToken:

The token to retrieve the next page of results.

type Filters:

list

param Filters:

One or more filters.

  • client-token - The idempotency token for the modification request.

  • create-date - The time when the modification request was created.

  • effective-date - The time when the modification becomes effective.

  • modification-result.reserved-instances-id - The ID for the Reserved Instances created as part of the modification request. This ID is only available when the status of the modification is fulfilled.

  • modification-result.target-configuration.availability-zone - The Availability Zone for the new Reserved Instances.

  • modification-result.target-configuration.instance-count - The number of new Reserved Instances.

  • modification-result.target-configuration.instance-type - The instance type of the new Reserved Instances.

  • modification-result.target-configuration.platform - The network platform of the new Reserved Instances ( EC2-Classic | EC2-VPC).

  • reserved-instances-id - The ID of the Reserved Instances modified.

  • reserved-instances-modification-id - The ID of the modification request.

  • status - The status of the Reserved Instances modification request ( processing | fulfilled | failed).

  • status-message - The reason for the status.

  • update-date - The time when the modification request was last updated.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'ReservedInstancesModifications': [
        {
            'ReservedInstancesModificationId': 'string',
            'ReservedInstancesIds': [
                {
                    'ReservedInstancesId': 'string'
                },
            ],
            'ModificationResults': [
                {
                    'ReservedInstancesId': 'string',
                    'TargetConfiguration': {
                        'AvailabilityZone': 'string',
                        'Platform': 'string',
                        'InstanceCount': 123,
                        'InstanceType': 't1.micro'|'m1.small'|'m1.medium'|'m1.large'|'m1.xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'t2.micro'|'t2.small'|'t2.medium'|'m2.xlarge'|'m2.2xlarge'|'m2.4xlarge'|'cr1.8xlarge'|'i2.xlarge'|'i2.2xlarge'|'i2.4xlarge'|'i2.8xlarge'|'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'|'cc1.4xlarge'|'cc2.8xlarge'|'g2.2xlarge'|'cg1.4xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'d2.xlarge'|'d2.2xlarge'|'d2.4xlarge'|'d2.8xlarge'
                    }
                },
            ],
            'CreateDate': datetime(2015, 1, 1),
            'UpdateDate': datetime(2015, 1, 1),
            'EffectiveDate': datetime(2015, 1, 1),
            'Status': 'string',
            'StatusMessage': 'string',
            'ClientToken': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • ReservedInstancesModifications (list) --

      The Reserved Instance modification information.

      • (dict) --

        Describes a Reserved Instance modification.

        • ReservedInstancesModificationId (string) --

          A unique ID for the Reserved Instance modification.

        • 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.

        • ModificationResults (list) --

          Contains target configurations along with their corresponding new Reserved Instance IDs.

          • (dict) --

            • 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.

              • Platform (string) --

                The network platform of the modified Reserved Instances, which is either EC2-Classic or EC2-VPC.

              • InstanceCount (integer) --

                The number of modified Reserved Instances.

              • InstanceType (string) --

                The instance type for the modified Reserved Instances.

        • CreateDate (datetime) --

          The time when the modification request was created.

        • UpdateDate (datetime) --

          The time when the modification request was last updated.

        • EffectiveDate (datetime) --

          The time for the modification to become effective.

        • Status (string) --

          The status of the Reserved Instances modification request.

        • StatusMessage (string) --

          The reason for the status.

        • ClientToken (string) --

          A unique, case-sensitive key supplied by the client to ensure that the request is idempotent. For more information, see Ensuring Idempotency.

    • 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.

DescribeVpcs (new) Link ¶

Describes one or more of your VPCs.

Request Syntax

client.describe_vpcs(
    DryRun=True|False,
    VpcIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type VpcIds:

list

param VpcIds:

One or more VPC IDs.

Default: Describes all your VPCs.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • cidr - The CIDR block of the VPC. The CIDR block you specify must exactly match the VPC's CIDR block for information to be returned for the VPC. Must contain the slash followed by one or two digits (for example, /28).

  • dhcp-options-id - The ID of a set of DHCP options.

  • isDefault - Indicates whether the VPC is the default VPC.

  • state - The state of the VPC ( pending | available).

  • tag:key*=*value - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key*=*value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • vpc-id - The ID of the VPC.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'Vpcs': [
        {
            'VpcId': 'string',
            'State': 'pending'|'available',
            'CidrBlock': 'string',
            'DhcpOptionsId': 'string',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'InstanceTenancy': 'default'|'dedicated',
            'IsDefault': True|False
        },
    ]
}

Response Structure

  • (dict) --

    • Vpcs (list) --

      Information about one or more VPCs.

      • (dict) --

        Describes a VPC.

        • VpcId (string) --

          The ID of the VPC.

        • State (string) --

          The current state of the VPC.

        • CidrBlock (string) --

          The 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).

        • 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.

        • InstanceTenancy (string) --

          The allowed tenancy of instances launched into the VPC.

        • IsDefault (boolean) --

          Indicates whether the VPC is the default VPC.

ConfirmProductInstance (new) Link ¶

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 needs to verify whether another user's instance is eligible for support.

Request Syntax

client.confirm_product_instance(
    DryRun=True|False,
    ProductCode='string',
    InstanceId='string'
)
type DryRun:

boolean

param DryRun:

type ProductCode:

string

param ProductCode:

[REQUIRED]

The product code. This must be a product code that you own.

type InstanceId:

string

param InstanceId:

[REQUIRED]

The ID of the instance.

rtype:

dict

returns:

Response Syntax

{
    'OwnerId': 'string'
}

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.

RevokeSecurityGroupEgress (new) Link ¶

Removes one or more egress rules from a security group for EC2-VPC. The values that you specify in the revoke request (for example, ports) must match the existing rule's values for the rule to be revoked.

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.

Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay might occur.

Request Syntax

client.revoke_security_group_egress(
    DryRun=True|False,
    GroupId='string',
    SourceSecurityGroupName='string',
    SourceSecurityGroupOwnerId='string',
    IpProtocol='string',
    FromPort=123,
    ToPort=123,
    CidrIp='string',
    IpPermissions=[
        {
            'IpProtocol': 'string',
            'FromPort': 123,
            'ToPort': 123,
            'UserIdGroupPairs': [
                {
                    'UserId': 'string',
                    'GroupName': 'string',
                    'GroupId': 'string'
                },
            ],
            'IpRanges': [
                {
                    'CidrIp': 'string'
                },
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type GroupId:

string

param GroupId:

[REQUIRED]

The ID of the security group.

type SourceSecurityGroupName:

string

param SourceSecurityGroupName:

[EC2-Classic, default VPC] The name of the destination security group. You can't specify a destination security group and a CIDR IP address range.

type SourceSecurityGroupOwnerId:

string

param SourceSecurityGroupOwnerId:

The ID of the destination security group. You can't specify a destination security group and a CIDR IP address range.

type IpProtocol:

string

param IpProtocol:

The IP protocol name ( tcp, udp, icmp) or number (see Protocol Numbers). Use -1 to specify all.

type FromPort:

integer

param FromPort:

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 ICMP types.

type ToPort:

integer

param ToPort:

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 ICMP codes for the ICMP type.

type CidrIp:

string

param CidrIp:

The CIDR IP address range. You can't specify this parameter when specifying a source security group.

type IpPermissions:

list

param IpPermissions:

A set of IP permissions. You can't specify a destination security group and a CIDR IP address range.

  • (dict) --

    Describes a security group rule.

    • IpProtocol (string) --

      The protocol.

      When you call DescribeSecurityGroups, the protocol value returned is the number. Exception: For TCP, UDP, and ICMP, the value returned is the name (for example, tcp, udp, or icmp). For a list of protocol numbers, see Protocol Numbers. (VPC only) When you call AuthorizeSecurityGroupIngress, you can use -1 to specify all.

    • FromPort (integer) --

      The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.

    • ToPort (integer) --

      The end of port range for the TCP and UDP protocols, or an ICMP code. A value of -1 indicates all ICMP codes for the specified ICMP type.

    • UserIdGroupPairs (list) --

      One or more security group and AWS account ID pairs.

      • (dict) --

        Describes a security group and AWS account ID pair.

        • UserId (string) --

          The ID of an AWS account. EC2-Classic only.

        • 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 GroupId.

        • GroupId (string) --

          The ID of the security group.

    • IpRanges (list) --

      One or more IP ranges.

      • (dict) --

        Describes an IP range.

        • CidrIp (string) --

          The CIDR range. You can either specify a CIDR range or a source security group, not both.

returns:

None

ImportImage (new) Link ¶

Import single or multi-volume disk images or Amazon EBS snapshots into an Amazon Machine Image (AMI).

Request Syntax

client.import_image(
    DryRun=True|False,
    Description='string',
    DiskContainers=[
        {
            'Description': 'string',
            'Format': 'string',
            'Url': 'string',
            'UserBucket': {
                'S3Bucket': 'string',
                'S3Key': 'string'
            },
            'DeviceName': 'string',
            'SnapshotId': 'string'
        },
    ],
    LicenseType='string',
    Hypervisor='string',
    Architecture='string',
    Platform='string',
    ClientData={
        'UploadStart': datetime(2015, 1, 1),
        'UploadEnd': datetime(2015, 1, 1),
        'UploadSize': 123.0,
        'Comment': 'string'
    },
    ClientToken='string',
    RoleName='string'
)
type DryRun:

boolean

param DryRun:

type Description:

string

param Description:

A description string for the import image task (optional).

type DiskContainers:

list

param DiskContainers:
  • (dict) --

    The disk container object for an ImportImage task.

    • Description (string) --

      The description of the disk image (optional).

    • Format (string) --

      The format of the disk image being imported (optional).

    • Url (string) --

      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://..)

    • UserBucket (dict) --

      User's Amazon S3 bucket details used to access the image.

      • S3Bucket (string) --

        The Amazon S3 bucket name where the disk image is located.

      • S3Key (string) --

        The Amazon S3 Key for the disk image.

    • DeviceName (string) --

      The Amazon EBS block device mapping for the disk (optional).

    • SnapshotId (string) --

      The Amazon EBS snapshot ID to be used for importing the snapshot.

type LicenseType:

string

param LicenseType:

The license type to be used for the Amazon Machine Image (AMI) after importing (optional).

Note: You may only use BYOL if you have existing licenses with rights to use these licenses in a third party cloud like AWS. For more information, see VM Import/Export Prerequisites in the Amazon Elastic Compute Cloud User Guide for Linux.

Valid Values: AWS | BYOL

type Hypervisor:

string

param Hypervisor:

The target hypervisor platform to use (optional).

type Architecture:

string

param Architecture:

The architecture of the virtual machine being imported (optional).

type Platform:

string

param Platform:

The operating system of the virtual machine being imported (optional).

type ClientData:

dict

param ClientData:

Client-specific data.

  • UploadStart (datetime) --

    The time that the disk upload starts.

  • UploadEnd (datetime) --

    The time that the disk upload ends.

  • UploadSize (float) --

    The size of the uploaded disk image.

  • Comment (string) --

    User-defined comment about the upload.

type ClientToken:

string

param ClientToken:

The token to enable idempotency for VM import requests (optional).

type RoleName:

string

param RoleName:

The name of the role to use when not using the default role name 'vmimport' (optional).

rtype:

dict

returns:

Response Syntax

{
    'ImportTaskId': 'string',
    'Architecture': 'string',
    'LicenseType': 'string',
    'Platform': 'string',
    'Hypervisor': 'string',
    'Description': 'string',
    'SnapshotDetails': [
        {
            'DiskImageSize': 123.0,
            'Description': 'string',
            'Format': 'string',
            'Url': 'string',
            'UserBucket': {
                'S3Bucket': 'string',
                'S3Key': 'string'
            },
            'DeviceName': 'string',
            'SnapshotId': 'string',
            'Progress': 'string',
            'StatusMessage': 'string',
            'Status': 'string'
        },
    ],
    'ImageId': 'string',
    'Progress': 'string',
    'StatusMessage': 'string',
    'Status': 'string'
}

Response Structure

  • (dict) --

    • ImportTaskId (string) --

      The task id of the ImportImage task.

    • Architecture (string) --

      Architecture of the virtual machine being imported.

    • LicenseType (string) --

      License type of the virtual machine being imported.

    • Platform (string) --

      Operating system of the VM being imported.

    • Hypervisor (string) --

      Target hypervisor of the import task.

    • Description (string) --

      A description of the import task.

    • SnapshotDetails (list) --

      • (dict) --

        The details of the snapshot created from the imported disk.

        • DiskImageSize (float) --

          The size of the disk in the snapshot.

        • Description (string) --

          Description for the snapshot.

        • Format (string) --

          The format of the disk image from which the snapshot is created.

        • Url (string) --

          The URL used to access the disk image.

        • UserBucket (dict) --

          User's Amazon S3 bucket details used to access the image.

          • S3Bucket (string) --

            The Amazon S3 bucket from which the disk image was created.

          • S3Key (string) --

            The Amazon S3 key from which the disk image was created.

        • DeviceName (string) --

          The Amazon EBS block device mapping for the snapshot.

        • SnapshotId (string) --

          The snapshot ID of the disk being imported.

        • Progress (string) --

          The percentage of progress for the task.

        • StatusMessage (string) --

          A detailed status message for the snapshot creation.

        • Status (string) --

          A brief status of the snapshot creation.

    • ImageId (string) --

      The Amazon Machine Image (AMI) ID created by the import task.

    • Progress (string) --

      The task's progress.

    • StatusMessage (string) --

      A detailed status message of the import task.

    • Status (string) --

      A brief status of the task.

TerminateInstances (new) Link ¶

Shuts down one or more instances. This operation is idempotent; if you terminate an instance more than once, each call succeeds.

Terminated instances remain visible after termination (for approximately one hour).

By default, Amazon EC2 deletes all Amazon 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, the root device and any other devices attached during the instance launch 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 Linux.

For more information about troubleshooting, see Troubleshooting Terminating Your Instance in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.terminate_instances(
    DryRun=True|False,
    InstanceIds=[
        'string',
    ]
)
type DryRun:

boolean

param DryRun:

type InstanceIds:

list

param InstanceIds:

[REQUIRED]

One or more instance IDs.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'TerminatingInstances': [
        {
            'InstanceId': 'string',
            'CurrentState': {
                'Code': 123,
                'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
            },
            'PreviousState': {
                'Code': 123,
                'Name': 'pending'|'running'|'shutting-down'|'terminated'|'stopping'|'stopped'
            }
        },
    ]
}

Response Structure

  • (dict) --

    • TerminatingInstances (list) --

      Information about one or more terminated instances.

      • (dict) --

        Describes an instance state change.

        • InstanceId (string) --

          The ID of the instance.

        • CurrentState (dict) --

          The current state of the instance.

          • Code (integer) --

            The low byte represents the state. The high byte is an opaque internal value and should be ignored.

            • 0 : pending

            • 16 : running

            • 32 : shutting-down

            • 48 : terminated

            • 64 : stopping

            • 80 : stopped

          • Name (string) --

            The current state of the instance.

        • PreviousState (dict) --

          The previous state of the instance.

          • Code (integer) --

            The low byte represents the state. The high byte is an opaque internal value and should be ignored.

            • 0 : pending

            • 16 : running

            • 32 : shutting-down

            • 48 : terminated

            • 64 : stopping

            • 80 : stopped

          • Name (string) --

            The current state of the instance.

DescribeImageAttribute (new) Link ¶

Describes the specified attribute of the specified AMI. You can specify only one attribute at a time.

Request Syntax

client.describe_image_attribute(
    DryRun=True|False,
    ImageId='string',
    Attribute='description'|'kernel'|'ramdisk'|'launchPermission'|'productCodes'|'blockDeviceMapping'|'sriovNetSupport'
)
type DryRun:

boolean

param DryRun:

type ImageId:

string

param ImageId:

[REQUIRED]

The ID of the AMI.

type Attribute:

string

param Attribute:

[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.

rtype:

dict

returns:

Response Syntax

{
    'ImageId': 'string',
    'LaunchPermissions': [
        {
            'UserId': 'string',
            'Group': 'all'
        },
    ],
    'ProductCodes': [
        {
            'ProductCodeId': 'string',
            'ProductCodeType': 'devpay'|'marketplace'
        },
    ],
    'KernelId': {
        'Value': 'string'
    },
    'RamdiskId': {
        'Value': 'string'
    },
    'Description': {
        'Value': 'string'
    },
    'SriovNetSupport': {
        'Value': 'string'
    },
    'BlockDeviceMappings': [
        {
            'VirtualName': 'string',
            'DeviceName': 'string',
            'Ebs': {
                'SnapshotId': 'string',
                'VolumeSize': 123,
                'DeleteOnTermination': True|False,
                'VolumeType': 'standard'|'io1'|'gp2',
                'Iops': 123,
                'Encrypted': True|False
            },
            'NoDevice': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Information about the image attribute.

    • ImageId (string) --

      The ID of the AMI.

    • LaunchPermissions (list) --

      One or more launch permissions.

      • (dict) --

        Describes a launch permission.

        • UserId (string) --

          The AWS account ID.

        • Group (string) --

          The name of the group.

    • ProductCodes (list) --

      One or more product codes.

      • (dict) --

        Describes a product code.

        • ProductCodeId (string) --

          The product code.

        • ProductCodeType (string) --

          The type of product code.

    • KernelId (dict) --

      The kernel ID.

      • Value (string) --

        Valid values are case-sensitive and vary by action.

    • RamdiskId (dict) --

      The RAM disk ID.

      • Value (string) --

        Valid values are case-sensitive and vary by action.

    • Description (dict) --

      A description for the AMI.

      • Value (string) --

        Valid values are case-sensitive and vary by action.

    • SriovNetSupport (dict) --

      The value to use for a resource attribute.

      • Value (string) --

        Valid values are case-sensitive and vary by action.

    • BlockDeviceMappings (list) --

      One or more block device mapping entries.

      • (dict) --

        Describes a block device mapping.

        • 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.

          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.

        • DeviceName (string) --

          The device name exposed to the instance (for example, /dev/sdh or xvdh).

        • Ebs (dict) --

          Parameters used to automatically set up Amazon EBS volumes when the instance is launched.

          • SnapshotId (string) --

            The ID of the snapshot.

          • VolumeSize (integer) --

            The size of the volume, in GiB.

            Constraints: 1-1024 for standard volumes, 1-16384 for gp2 volumes, and 4-16384 for io1 volumes. 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.

          • DeleteOnTermination (boolean) --

            Indicates whether the Amazon EBS volume is deleted on instance termination.

          • VolumeType (string) --

            The volume type. gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic volumes.

            Default: standard

          • 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 on General Purpose (SSD) baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide for Linux.

            Constraint: Range is 100 to 20000 for Provisioned IOPS (SSD) volumes and 3 to 10000 for General Purpose (SSD) volumes.

            Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create standard or gp2 volumes.

          • Encrypted (boolean) --

            Indicates whether the Amazon EBS volume is encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption.

        • NoDevice (string) --

          Suppresses the specified device included in the block device mapping of the AMI.

ReportInstanceStatus (new) Link ¶

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.

Request Syntax

client.report_instance_status(
    DryRun=True|False,
    Instances=[
        'string',
    ],
    Status='ok'|'impaired',
    StartTime=datetime(2015, 1, 1),
    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',
    ],
    Description='string'
)
type DryRun:

boolean

param DryRun:

type Instances:

list

param Instances:

[REQUIRED]

One or more instances.

  • (string) --

type Status:

string

param Status:

[REQUIRED]

The status of all instances listed.

type StartTime:

datetime

param StartTime:

The time at which the reported instance health state began.

type EndTime:

datetime

param EndTime:

The time at which the reported instance health state ended.

type ReasonCodes:

list

param ReasonCodes:

[REQUIRED]

One or more reason codes that describes the health state of your instance.

  • instance-stuck-in-state: My instance is stuck in a state.

  • unresponsive: My instance is unresponsive.

  • not-accepting-credentials: My instance is not accepting my credentials.

  • password-not-available: A password is not available for my instance.

  • performance-network: My instance is experiencing performance problems which I believe are network related.

  • performance-instance-store: My instance is experiencing performance problems which I believe are related to the instance stores.

  • performance-ebs-volume: My instance is experiencing performance problems which I believe are related to an EBS volume.

  • performance-other: My instance is experiencing performance problems.

  • other: [explain using the description parameter]

  • (string) --

type Description:

string

param Description:

Descriptive text about the health state of your instance.

returns:

None

DeleteSecurityGroup (new) Link ¶

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.

Request Syntax

client.delete_security_group(
    DryRun=True|False,
    GroupName='string',
    GroupId='string'
)
type DryRun:

boolean

param DryRun:

type GroupName:

string

param GroupName:

[EC2-Classic, default VPC] The name of the security group. You can specify either the security group name or the security group ID.

type GroupId:

string

param GroupId:

The ID of the security group. Required for a nondefault VPC.

returns:

None

DescribeSnapshotAttribute (new) Link ¶

Describes the specified attribute of the specified snapshot. You can specify only one attribute at a time.

For more information about Amazon EBS snapshots, see Amazon EBS Snapshots in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.describe_snapshot_attribute(
    DryRun=True|False,
    SnapshotId='string',
    Attribute='productCodes'|'createVolumePermission'
)
type DryRun:

boolean

param DryRun:

type SnapshotId:

string

param SnapshotId:

[REQUIRED]

The ID of the Amazon EBS snapshot.

type Attribute:

string

param Attribute:

[REQUIRED]

The snapshot attribute you would like to view.

rtype:

dict

returns:

Response Syntax

{
    'SnapshotId': 'string',
    'CreateVolumePermissions': [
        {
            'UserId': 'string',
            'Group': 'all'
        },
    ],
    'ProductCodes': [
        {
            'ProductCodeId': 'string',
            'ProductCodeType': 'devpay'|'marketplace'
        },
    ]
}

Response Structure

  • (dict) --

    • SnapshotId (string) --

      The ID of the Amazon EBS snapshot.

    • CreateVolumePermissions (list) --

      A list of permissions for creating volumes from the snapshot.

      • (dict) --

        • UserId (string) --

          The specific AWS account ID that is to be added or removed from a volume's list of create volume permissions.

        • Group (string) --

          The specific group that is to be added or removed from a volume's list of create volume permissions.

    • ProductCodes (list) --

      A list of product codes.

      • (dict) --

        Describes a product code.

        • ProductCodeId (string) --

          The product code.

        • ProductCodeType (string) --

          The type of product code.

DescribeVpnConnections (new) Link ¶

Describes one or more of your VPN connections.

For more information about VPN connections, see Adding a Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.describe_vpn_connections(
    DryRun=True|False,
    VpnConnectionIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type VpnConnectionIds:

list

param VpnConnectionIds:

One or more VPN connection IDs.

Default: Describes your VPN connections.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • customer-gateway-configuration - The configuration information for the customer gateway.

  • customer-gateway-id - The ID of a customer gateway associated with the VPN connection.

  • state - The state of the VPN connection ( pending | available | deleting | deleted).

  • option.static-routes-only - Indicates whether the connection has static routes only. Used for devices that do not support Border Gateway Protocol (BGP).

  • route.destination-cidr-block - The destination CIDR block. This corresponds to the subnet used in a customer data center.

  • bgp-asn - The BGP Autonomous System Number (ASN) associated with a BGP device.

  • tag:key*=*value - The key/value combination of a tag assigned to the resource.

  • tag-key - The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key*=*value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • type - The type of VPN connection. Currently the only supported type is ipsec.1.

  • vpn-connection-id - The ID of the VPN connection.

  • vpn-gateway-id - The ID of a virtual private gateway associated with the VPN connection.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'VpnConnections': [
        {
            'VpnConnectionId': 'string',
            'State': 'pending'|'available'|'deleting'|'deleted',
            'CustomerGatewayConfiguration': 'string',
            'Type': 'ipsec.1',
            'CustomerGatewayId': 'string',
            'VpnGatewayId': 'string',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'VgwTelemetry': [
                {
                    'OutsideIpAddress': 'string',
                    'Status': 'UP'|'DOWN',
                    'LastStatusChange': datetime(2015, 1, 1),
                    'StatusMessage': 'string',
                    'AcceptedRouteCount': 123
                },
            ],
            'Options': {
                'StaticRoutesOnly': True|False
            },
            'Routes': [
                {
                    'DestinationCidrBlock': 'string',
                    'Source': 'Static',
                    'State': 'pending'|'available'|'deleting'|'deleted'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • VpnConnections (list) --

      Information about one or more VPN connections.

      • (dict) --

        Describes a VPN connection.

        • VpnConnectionId (string) --

          The ID of the VPN connection.

        • State (string) --

          The current state of 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.

        • Type (string) --

          The type of VPN connection.

        • CustomerGatewayId (string) --

          The ID of the customer gateway at your end of the VPN connection.

        • VpnGatewayId (string) --

          The ID of the virtual private gateway at the AWS side of the VPN connection.

        • 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.

            • OutsideIpAddress (string) --

              The Internet-routable IP address of the virtual private gateway's outside interface.

            • Status (string) --

              The status of the VPN tunnel.

            • LastStatusChange (datetime) --

              The date and time of the last change in status.

            • StatusMessage (string) --

              If an error occurs, a description of the error.

            • AcceptedRouteCount (integer) --

              The number of accepted routes.

        • 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.

ReleaseAddress (new) Link ¶

Releases the specified Elastic IP address.

After releasing an Elastic IP address, it is released to the IP address pool and might be unavailable to you. 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-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 try to release it. Otherwise, Amazon EC2 returns an error ( InvalidIPAddress.InUse).

Request Syntax

client.release_address(
    DryRun=True|False,
    PublicIp='string',
    AllocationId='string'
)
type DryRun:

boolean

param DryRun:

type PublicIp:

string

param PublicIp:

[EC2-Classic] The Elastic IP address. Required for EC2-Classic.

type AllocationId:

string

param AllocationId:

[EC2-VPC] The allocation ID. Required for EC2-VPC.

returns:

None

DescribeConversionTasks (new) Link ¶

Describes one or more of your conversion tasks. For more information, see Using the Command Line Tools to Import Your Virtual Machine to Amazon EC2 in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Syntax

client.describe_conversion_tasks(
    DryRun=True|False,
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    ConversionTaskIds=[
        'string',
    ]
)
type DryRun:

boolean

param DryRun:

type Filters:

list

param Filters:
  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

type ConversionTaskIds:

list

param ConversionTaskIds:

One or more conversion task IDs.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'ConversionTasks': [
        {
            'ConversionTaskId': 'string',
            'ExpirationTime': 'string',
            'ImportInstance': {
                'Volumes': [
                    {
                        'BytesConverted': 123,
                        'AvailabilityZone': 'string',
                        'Image': {
                            'Format': 'VMDK'|'RAW'|'VHD',
                            'Size': 123,
                            'ImportManifestUrl': 'string',
                            'Checksum': 'string'
                        },
                        'Volume': {
                            'Size': 123,
                            'Id': 'string'
                        },
                        'Status': 'string',
                        'StatusMessage': 'string',
                        'Description': 'string'
                    },
                ],
                'InstanceId': 'string',
                'Platform': 'Windows',
                'Description': 'string'
            },
            'ImportVolume': {
                'BytesConverted': 123,
                'AvailabilityZone': 'string',
                'Description': 'string',
                'Image': {
                    'Format': 'VMDK'|'RAW'|'VHD',
                    'Size': 123,
                    'ImportManifestUrl': 'string',
                    'Checksum': 'string'
                },
                'Volume': {
                    'Size': 123,
                    'Id': 'string'
                }
            },
            'State': 'active'|'cancelling'|'cancelled'|'completed',
            'StatusMessage': 'string',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • ConversionTasks (list) --

      • (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.

          • Volumes (list) --

            • (dict) --

              Describes an import volume task.

              • BytesConverted (integer) --

                The number of bytes converted so far.

              • AvailabilityZone (string) --

                The Availability Zone where the resulting instance will reside.

              • Image (dict) --

                The image.

                • Format (string) --

                  The disk image format.

                • Size (integer) --

                  The size of the disk image.

                • 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.

                • Checksum (string) --

                  The checksum computed for the disk image.

              • Volume (dict) --

                The volume.

                • Size (integer) --

                  The size of the volume.

                • Id (string) --

                  The volume identifier.

              • Status (string) --

                The status of the import of this particular disk image.

              • StatusMessage (string) --

                The status information or errors related to the disk image.

              • Description (string) --

          • InstanceId (string) --

          • Platform (string) --

            The instance operating system.

          • Description (string) --

        • ImportVolume (dict) --

          If the task is for importing a volume, this contains information about the import volume task.

          • BytesConverted (integer) --

            The number of bytes converted so far.

          • AvailabilityZone (string) --

            The Availability Zone where the resulting volume will reside.

          • Description (string) --

            The description you provided when starting the import volume task.

          • Image (dict) --

            The image.

            • Format (string) --

              The disk image format.

            • Size (integer) --

              The size of the disk image.

            • 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.

            • Checksum (string) --

              The checksum computed for the disk image.

          • Volume (dict) --

            The volume.

            • Size (integer) --

              The size of the volume.

            • Id (string) --

              The volume identifier.

        • State (string) --

          The state of the conversion task.

        • StatusMessage (string) --

          The status message related to the conversion task.

        • Tags (list) --

          • (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.

DescribeRegions (new) Link ¶

Describes one or more regions that are currently available to you.

For a list of the regions supported by Amazon EC2, see Regions and Endpoints.

Request Syntax

client.describe_regions(
    DryRun=True|False,
    RegionNames=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type RegionNames:

list

param RegionNames:

The names of one or more regions.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • endpoint - The endpoint of the region (for example, ec2.us-east-1.amazonaws.com).

  • region-name - The name of the region (for example, us-east-1).

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'Regions': [
        {
            'RegionName': 'string',
            'Endpoint': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • Regions (list) --

      Information about one or more regions.

      • (dict) --

        Describes a region.

        • RegionName (string) --

          The name of the region.

        • Endpoint (string) --

          The region service endpoint.

CreateNetworkAclEntry (new) Link ¶

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.

Request Syntax

client.create_network_acl_entry(
    DryRun=True|False,
    NetworkAclId='string',
    RuleNumber=123,
    Protocol='string',
    RuleAction='allow'|'deny',
    Egress=True|False,
    CidrBlock='string',
    IcmpTypeCode={
        'Type': 123,
        'Code': 123
    },
    PortRange={
        'From': 123,
        'To': 123
    }
)
type DryRun:

boolean

param DryRun:

type NetworkAclId:

string

param NetworkAclId:

[REQUIRED]

The ID of the network ACL.

type RuleNumber:

integer

param RuleNumber:

[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

type Protocol:

string

param Protocol:

[REQUIRED]

The protocol. A value of -1 means all protocols.

type RuleAction:

string

param RuleAction:

[REQUIRED]

Indicates whether to allow or deny the traffic that matches the rule.

type Egress:

boolean

param Egress:

[REQUIRED]

Indicates whether this is an egress rule (rule is applied to traffic leaving the subnet).

type CidrBlock:

string

param CidrBlock:

[REQUIRED]

The network range to allow or deny, in CIDR notation (for example 172.16.0.0/24).

type IcmpTypeCode:

dict

param IcmpTypeCode:

ICMP protocol: The ICMP type and code. Required if specifying ICMP for the protocol.

  • Type (integer) --

    The ICMP code. A value of -1 means all codes for the specified ICMP type.

  • Code (integer) --

    The ICMP type. A value of -1 means all types.

type PortRange:

dict

param PortRange:

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.

returns:

None

CreateVpc (new) Link ¶

Creates a VPC with the specified CIDR block.

The smallest VPC you can create uses a /28 netmask (16 IP addresses), and the largest uses a /16 netmask (65,536 IP addresses). To help you decide how big to make your VPC, see Your VPC and Subnets in the Amazon Virtual Private Cloud User Guide.

By default, each instance you launch in the VPC has the default DHCP options, which includes only a default DNS server that we provide (AmazonProvidedDNS). For more information about DHCP options, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.create_vpc(
    DryRun=True|False,
    CidrBlock='string',
    InstanceTenancy='default'|'dedicated'
)
type DryRun:

boolean

param DryRun:

type CidrBlock:

string

param CidrBlock:

[REQUIRED]

The network range for the VPC, in CIDR notation. For example, 10.0.0.0/16.

type InstanceTenancy:

string

param InstanceTenancy:

The supported tenancy options for instances launched into the VPC. A value of default means that instances can be launched with any tenancy; a value of dedicated means all instances launched into the VPC are launched as dedicated tenancy instances regardless of the tenancy assigned to the instance at launch. Dedicated tenancy instances run on single-tenant hardware.

Default: default

rtype:

dict

returns:

Response Syntax

{
    'Vpc': {
        'VpcId': 'string',
        'State': 'pending'|'available',
        'CidrBlock': 'string',
        'DhcpOptionsId': 'string',
        'Tags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'InstanceTenancy': 'default'|'dedicated',
        'IsDefault': True|False
    }
}

Response Structure

  • (dict) --

    • Vpc (dict) --

      Information about the VPC.

      • VpcId (string) --

        The ID of the VPC.

      • State (string) --

        The current state of the VPC.

      • CidrBlock (string) --

        The 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).

      • 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.

      • InstanceTenancy (string) --

        The allowed tenancy of instances launched into the VPC.

      • IsDefault (boolean) --

        Indicates whether the VPC is the default VPC.

DescribeVolumeStatus (new) Link ¶

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 on volume status, see Monitoring the Status of Your Volumes.

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.

Request Syntax

client.describe_volume_status(
    DryRun=True|False,
    VolumeIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    NextToken='string',
    MaxResults=123
)
type DryRun:

boolean

param DryRun:

type VolumeIds:

list

param VolumeIds:

One or more volume IDs.

Default: Describes all your volumes.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • action.code - The action code for the event (for example, enable-volume-io).

  • action.description - A description of the action.

  • action.event-id - The event ID associated with the action.

  • availability-zone - The Availability Zone of the instance.

  • event.description - A description of the event.

  • event.event-id - The event ID.

  • event.event-type - The event type (for io-enabled: passed | failed; for io-performance: io-performance:degraded | io-performance:severely-degraded | io-performance:stalled).

  • event.not-after - The latest end time for the event.

  • event.not-before - The earliest start time for the event.

  • volume-status.details-name - The cause for volume-status.status ( io-enabled | io-performance).

  • volume-status.details-status - The status of volume-status.details-name (for io-enabled: passed | failed; for io-performance: normal | degraded | severely-degraded | stalled).

  • volume-status.status - The status of the volume ( ok | impaired | warning | insufficient-data).

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

type NextToken:

string

param NextToken:

The NextToken value to include in a future DescribeVolumeStatus request. When the results of the 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.

type MaxResults:

integer

param MaxResults:

The maximum number of volume results returned by DescribeVolumeStatus in paginated output. When this parameter is used, the request only returns MaxResults results in a single page along with a NextToken response element. 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 larger than 1000, only 1000 results are returned. If this parameter is not used, then DescribeVolumeStatus returns all results. You cannot specify this parameter and the volume IDs parameter in the same request.

rtype:

dict

returns:

Response Syntax

{
    'VolumeStatuses': [
        {
            'VolumeId': 'string',
            'AvailabilityZone': 'string',
            'VolumeStatus': {
                'Status': 'ok'|'impaired'|'insufficient-data',
                'Details': [
                    {
                        'Name': 'io-enabled'|'io-performance',
                        'Status': 'string'
                    },
                ]
            },
            'Events': [
                {
                    'EventType': 'string',
                    'Description': 'string',
                    'NotBefore': datetime(2015, 1, 1),
                    'NotAfter': datetime(2015, 1, 1),
                    'EventId': 'string'
                },
            ],
            'Actions': [
                {
                    'Code': 'string',
                    'Description': 'string',
                    'EventType': 'string',
                    'EventId': 'string'
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • VolumeStatuses (list) --

      A list of volumes.

      • (dict) --

        Describes the volume status.

        • VolumeId (string) --

          The volume ID.

        • AvailabilityZone (string) --

          The Availability Zone of the volume.

        • VolumeStatus (dict) --

          The volume status.

          • Status (string) --

            The status of the volume.

          • 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.

        • Events (list) --

          A list of events associated with the volume.

          • (dict) --

            Describes a volume status event.

            • EventType (string) --

              The type of this event.

            • Description (string) --

              A description of the event.

            • NotBefore (datetime) --

              The earliest start time of the event.

            • NotAfter (datetime) --

              The latest end time of the event.

            • EventId (string) --

              The ID of this event.

        • 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.

            • EventType (string) --

              The event type associated with this operation.

            • EventId (string) --

              The ID of the event associated with this operation.

    • 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.

CreateDhcpOptions (new) Link ¶

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.

  • domain-name-servers - The IP addresses of up to four domain name servers, or AmazonProvidedDNS. The default DHCP option set specifies AmazonProvidedDNS. If specifying more than one domain name server, specify the IP addresses in a single parameter, separated by commas.

  • domain-name - If you're using AmazonProvidedDNS in us-east-1, specify ec2.internal. If you're using AmazonProvidedDNS in another region, specify region.compute.internal (for example, ap-northeast-1.compute.internal). Otherwise, specify a domain name (for example, MyCompany.com). Important: Some Linux operating systems accept multiple domain names separated by spaces. However, Windows and other Linux operating systems treat the value as a single domain, which results in unexpected behavior. If your DHCP options set is associated with a VPC that has instances with multiple operating systems, specify only one domain name.

  • ntp-servers - The IP addresses of up to four Network Time Protocol (NTP) servers.

  • netbios-name-servers - The IP addresses of up to four NetBIOS name servers.

  • netbios-node-type - The NetBIOS node type (1, 2, 4, or 8). We recommend that you specify 2 (broadcast and multicast are not currently supported). For more information about these node types, 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 about DHCP options, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.create_dhcp_options(
    DryRun=True|False,
    DhcpConfigurations=[
        {
            'Key': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type DhcpConfigurations:

list

param DhcpConfigurations:

[REQUIRED]

A DHCP configuration option.

  • (dict) --

    • Key (string) --

    • Values (list) --

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'DhcpOptions': {
        'DhcpOptionsId': 'string',
        'DhcpConfigurations': [
            {
                'Key': 'string',
                'Values': [
                    {
                        'Value': 'string'
                    },
                ]
            },
        ],
        'Tags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • DhcpOptions (dict) --

      A set of DHCP options.

      • DhcpOptionsId (string) --

        The ID of the 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) --

              The value to use for a resource attribute.

              • Value (string) --

                Valid values are case-sensitive and vary by action.

      • 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.

CreateVpcPeeringConnection (new) Link ¶

Requests a VPC peering connection between two VPCs: a requester VPC that you own and a peer VPC with which to create the connection. The peer VPC can belong to another AWS account. The requester VPC and peer VPC cannot have overlapping CIDR blocks.

The owner of the peer 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.

A CreateVpcPeeringConnection request between VPCs with overlapping CIDR blocks results in the VPC peering connection having a status of failed.

Request Syntax

client.create_vpc_peering_connection(
    DryRun=True|False,
    VpcId='string',
    PeerVpcId='string',
    PeerOwnerId='string'
)
type DryRun:

boolean

param DryRun:

type VpcId:

string

param VpcId:

The ID of the requester VPC.

type PeerVpcId:

string

param PeerVpcId:

The ID of the VPC with which you are creating the VPC peering connection.

type PeerOwnerId:

string

param PeerOwnerId:

The AWS account ID of the owner of the peer VPC.

Default: Your AWS account ID

rtype:

dict

returns:

Response Syntax

{
    'VpcPeeringConnection': {
        'AccepterVpcInfo': {
            'CidrBlock': 'string',
            'OwnerId': 'string',
            'VpcId': 'string'
        },
        'ExpirationTime': datetime(2015, 1, 1),
        'RequesterVpcInfo': {
            'CidrBlock': 'string',
            'OwnerId': 'string',
            'VpcId': 'string'
        },
        'Status': {
            'Code': 'string',
            'Message': 'string'
        },
        'Tags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'VpcPeeringConnectionId': 'string'
    }
}

Response Structure

  • (dict) --

    • VpcPeeringConnection (dict) --

      Information about the VPC peering connection.

      • AccepterVpcInfo (dict) --

        The information of the peer VPC.

        • CidrBlock (string) --

          The CIDR block for the VPC.

        • OwnerId (string) --

          The AWS account ID of the VPC owner.

        • VpcId (string) --

          The ID of the VPC.

      • ExpirationTime (datetime) --

        The time that an unaccepted VPC peering connection will expire.

      • RequesterVpcInfo (dict) --

        The information of the requester VPC.

        • CidrBlock (string) --

          The CIDR block for the VPC.

        • OwnerId (string) --

          The AWS account ID of the VPC owner.

        • VpcId (string) --

          The ID of the VPC.

      • 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.

DetachNetworkInterface (new) Link ¶

Detaches a network interface from an instance.

Request Syntax

client.detach_network_interface(
    DryRun=True|False,
    AttachmentId='string',
    Force=True|False
)
type DryRun:

boolean

param DryRun:

type AttachmentId:

string

param AttachmentId:

[REQUIRED]

The ID of the attachment.

type Force:

boolean

param Force:

Specifies whether to force a detachment.

returns:

None

DescribeSecurityGroups (new) Link ¶

Describes one or more 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 for Linux and Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.describe_security_groups(
    DryRun=True|False,
    GroupNames=[
        'string',
    ],
    GroupIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type DryRun:

boolean

param DryRun:

type GroupNames:

list

param GroupNames:

[EC2-Classic and default VPC only] One or more security group names. 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.

  • (string) --

type GroupIds:

list

param GroupIds:

One or more security group IDs. Required for security groups in a nondefault VPC.

Default: Describes all your security groups.

  • (string) --

type Filters:

list

param Filters:

One or more filters.

  • description - The description of the security group.

  • group-id - The ID of the security group.

  • group-name - The name of the security group.

  • ip-permission.cidr - A CIDR range that has been granted permission.

  • ip-permission.from-port - The start of port range for the TCP and UDP protocols, or an ICMP type number.

  • ip-permission.group-id - The ID of a security group that has been granted permission.

  • ip-permission.group-name - The name of a security group that has been granted permission.

  • ip-permission.protocol - The IP protocol for the permission ( tcp | udp | icmp or a protocol number).

  • ip-permission.to-port - The end of port range for the TCP and UDP protocols, or an ICMP code.

  • ip-permission.user-id - The ID of an AWS account that has been granted permission.

  • owner-id - The AWS account ID of the owner of the security group.

  • tag-key - The key of a tag assigned to the security group.

  • tag-value - The value of a tag assigned to the security group.

  • vpc-id - The ID of the VPC specified when the security group was created.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'SecurityGroups': [
        {
            'OwnerId': 'string',
            'GroupName': 'string',
            'GroupId': 'string',
            'Description': 'string',
            'IpPermissions': [
                {
                    'IpProtocol': 'string',
                    'FromPort': 123,
                    'ToPort': 123,
                    'UserIdGroupPairs': [
                        {
                            'UserId': 'string',
                            'GroupName': 'string',
                            'GroupId': 'string'
                        },
                    ],
                    'IpRanges': [
                        {
                            'CidrIp': 'string'
                        },
                    ]
                },
            ],
            'IpPermissionsEgress': [
                {
                    'IpProtocol': 'string',
                    'FromPort': 123,
                    'ToPort': 123,
                    'UserIdGroupPairs': [
                        {
                            'UserId': 'string',
                            'GroupName': 'string',
                            'GroupId': 'string'
                        },
                    ],
                    'IpRanges': [
                        {
                            'CidrIp': 'string'
                        },
                    ]
                },
            ],
            'VpcId': 'string',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • SecurityGroups (list) --

      Information about one or more security groups.

      • (dict) --

        Describes a security group

        • OwnerId (string) --

          The AWS account ID of the owner of the security group.

        • GroupName (string) --

          The name of the security group.

        • GroupId (string) --

          The ID of the security group.

        • Description (string) --

          A description of the security group.

        • IpPermissions (list) --

          One or more inbound rules associated with the security group.

          • (dict) --

            Describes a security group rule.

            • IpProtocol (string) --

              The protocol.

              When you call DescribeSecurityGroups, the protocol value returned is the number. Exception: For TCP, UDP, and ICMP, the value returned is the name (for example, tcp, udp, or icmp). For a list of protocol numbers, see Protocol Numbers. (VPC only) When you call AuthorizeSecurityGroupIngress, you can use -1 to specify all.

            • FromPort (integer) --

              The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.

            • ToPort (integer) --

              The end of port range for the TCP and UDP protocols, or an ICMP code. A value of -1 indicates all ICMP codes for the specified ICMP type.

            • UserIdGroupPairs (list) --

              One or more security group and AWS account ID pairs.

              • (dict) --

                Describes a security group and AWS account ID pair.

                • UserId (string) --

                  The ID of an AWS account. EC2-Classic only.

                • 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 GroupId.

                • GroupId (string) --

                  The ID of the security group.

            • IpRanges (list) --

              One or more IP ranges.

              • (dict) --

                Describes an IP range.

                • CidrIp (string) --

                  The CIDR range. You can either specify a CIDR range or a source security group, not both.

        • IpPermissionsEgress (list) --

          [EC2-VPC] One or more outbound rules associated with the security group.

          • (dict) --

            Describes a security group rule.

            • IpProtocol (string) --

              The protocol.

              When you call DescribeSecurityGroups, the protocol value returned is the number. Exception: For TCP, UDP, and ICMP, the value returned is the name (for example, tcp, udp, or icmp). For a list of protocol numbers, see Protocol Numbers. (VPC only) When you call AuthorizeSecurityGroupIngress, you can use -1 to specify all.

            • FromPort (integer) --

              The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.

            • ToPort (integer) --

              The end of port range for the TCP and UDP protocols, or an ICMP code. A value of -1 indicates all ICMP codes for the specified ICMP type.

            • UserIdGroupPairs (list) --

              One or more security group and AWS account ID pairs.

              • (dict) --

                Describes a security group and AWS account ID pair.

                • UserId (string) --

                  The ID of an AWS account. EC2-Classic only.

                • 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 GroupId.

                • GroupId (string) --

                  The ID of the security group.

            • IpRanges (list) --

              One or more IP ranges.

              • (dict) --

                Describes an IP range.

                • CidrIp (string) --

                  The CIDR range. You can either specify a CIDR range or a source security group, not both.

        • VpcId (string) --

          [EC2-VPC] The ID of the VPC for the security group.

        • 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.

CancelReservedInstancesListing (new) Link ¶

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 for Linux.

Request Syntax

client.cancel_reserved_instances_listing(
    ReservedInstancesListingId='string'
)
type ReservedInstancesListingId:

string

param ReservedInstancesListingId:

[REQUIRED]

The ID of the Reserved Instance listing.

rtype:

dict

returns:

Response Syntax

{
    'ReservedInstancesListings': [
        {
            'ReservedInstancesListingId': 'string',
            'ReservedInstancesId': 'string',
            'CreateDate': datetime(2015, 1, 1),
            'UpdateDate': datetime(2015, 1, 1),
            'Status': 'active'|'pending'|'cancelled'|'closed',
            'StatusMessage': 'string',
            'InstanceCounts': [
                {
                    'State': 'available'|'sold'|'cancelled'|'pending',
                    'InstanceCount': 123
                },
            ],
            'PriceSchedules': [
                {
                    'Term': 123,
                    'Price': 123.0,
                    'CurrencyCode': 'USD',
                    'Active': True|False
                },
            ],
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'ClientToken': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • ReservedInstancesListings (list) --

      The Reserved Instance listing.

      • (dict) --

        Describes a Reserved Instance listing.

        • ReservedInstancesListingId (string) --

          The ID of the Reserved Instance listing.

        • ReservedInstancesId (string) --

          The ID of the Reserved Instance.

        • CreateDate (datetime) --

          The time the listing was created.

        • UpdateDate (datetime) --

          The last modified timestamp of the 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.

        • InstanceCounts (list) --

          The number of instances in this state.

          • (dict) --

            Describes a Reserved Instance listing state.

            • State (string) --

              The states of the listed Reserved Instances.

            • InstanceCount (integer) --

              he number of listed Reserved Instances in the state specified by the state.

        • PriceSchedules (list) --

          The price of the Reserved Instance listing.

          • (dict) --

            Describes the price for a Reserved Instance.

            • 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.

            • Price (float) --

              The fixed price for the term.

            • CurrencyCode (string) --

              The currency for transacting the Reserved Instance resale. At this time, the only supported currency is USD.

            • 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.

        • 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.

        • ClientToken (string) --

          A unique, case-sensitive key supplied by the client to ensure that the request is idempotent. For more information, see Ensuring Idempotency.

EnableVgwRoutePropagation (new) Link ¶

Enables a virtual private gateway (VGW) to propagate routes to the specified route table of a VPC.

Request Syntax

client.enable_vgw_route_propagation(
    RouteTableId='string',
    GatewayId='string'
)
type RouteTableId:

string

param RouteTableId:

[REQUIRED]

The ID of the route table.

type GatewayId:

string

param GatewayId:

[REQUIRED]

The ID of the virtual private gateway.

returns:

None

AttachInternetGateway (new) Link ¶

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.

Request Syntax

client.attach_internet_gateway(
    DryRun=True|False,
    InternetGatewayId='string',
    VpcId='string'
)
type DryRun:

boolean

param DryRun:

type InternetGatewayId:

string

param InternetGatewayId:

[REQUIRED]

The ID of the Internet gateway.

type VpcId:

string

param VpcId:

[REQUIRED]

The ID of the VPC.

returns:

None