Amazon Elastic Compute Cloud

2015/12/17 - Amazon Elastic Compute Cloud - 3 new 6 updated api methods

DeleteNatGateway (new) Link ¶

Deletes the specified NAT gateway. Deleting a NAT gateway disassociates its Elastic IP address, but does not release the address from your account. Deleting a NAT gateway does not delete any NAT gateway routes in your route tables.

Request Syntax

client.delete_nat_gateway(
    NatGatewayId='string'
)
type NatGatewayId

string

param NatGatewayId

[REQUIRED]

The ID of the NAT gateway.

rtype

dict

returns

Response Syntax

{
    'NatGatewayId': 'string'
}

Response Structure

  • (dict) --

    • NatGatewayId (string) --

      The ID of the NAT gateway.

DescribeNatGateways (new) Link ¶

Describes one or more of the your NAT gateways.

Request Syntax

client.describe_nat_gateways(
    NatGatewayIds=[
        'string',
    ],
    Filter=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    MaxResults=123,
    NextToken='string'
)
type NatGatewayIds

list

param NatGatewayIds

One or more NAT gateway IDs.

  • (string) --

type Filter

list

param Filter

One or more filters.

  • nat-gateway-id - The ID of the NAT gateway.

  • state - The state of the NAT gateway ( pending | failed | available | deleting | deleted ).

  • subnet-id - The ID of the subnet in which the NAT gateway resides.

  • vpc-id - The ID of the VPC in which the NAT gateway resides.

  • (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 items to return for this request. The request returns a token that you can specify in a subsequent call to get the next set of results.

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

type NextToken

string

param NextToken

The token to retrieve the next page of results.

rtype

dict

returns

Response Syntax

{
    'NatGateways': [
        {
            'VpcId': 'string',
            'SubnetId': 'string',
            'NatGatewayId': 'string',
            'CreateTime': datetime(2015, 1, 1),
            'DeleteTime': datetime(2015, 1, 1),
            'NatGatewayAddresses': [
                {
                    'PublicIp': 'string',
                    'AllocationId': 'string',
                    'PrivateIp': 'string',
                    'NetworkInterfaceId': 'string'
                },
            ],
            'State': 'pending'|'failed'|'available'|'deleting'|'deleted',
            'FailureCode': 'string',
            'FailureMessage': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • NatGateways (list) --

      Information about the NAT gateways.

      • (dict) --

        Describes a NAT gateway.

        • VpcId (string) --

          The ID of the VPC in which the NAT gateway is located.

        • SubnetId (string) --

          The ID of the subnet in which the NAT gateway is located.

        • NatGatewayId (string) --

          The ID of the NAT gateway.

        • CreateTime (datetime) --

          The date and time the NAT gateway was created.

        • DeleteTime (datetime) --

          The date and time the NAT gateway was deleted, if applicable.

        • NatGatewayAddresses (list) --

          Information about the IP addresses and network interface associated with the NAT gateway.

          • (dict) --

            Describes the IP addresses and network interface associated with a NAT gateway.

            • PublicIp (string) --

              The Elastic IP address associated with the NAT gateway.

            • AllocationId (string) --

              The allocation ID of the Elastic IP address that's associated with the NAT gateway.

            • PrivateIp (string) --

              The private IP address associated with the Elastic IP address.

            • NetworkInterfaceId (string) --

              The ID of the network interface associated with the NAT gateway.

        • State (string) --

          The state of the NAT gateway.

        • FailureCode (string) --

          If the NAT gateway could not be created, specifies the error code for the failure. ( InsufficientFreeAddressesInSubnet | Gateway.NotAttached | InvalidAllocationID.NotFound | Resource.AlreadyAssociated | InternalError )

        • FailureMessage (string) --

          If the NAT gateway could not be created, specifies the error message for the failure, that corresponds to the error code.

          • For InsufficientFreeAddressesInSubnet: Subnet has insufficient free addresses to create this NAT gateway

          • For Gateway.NotAttached: Network vpc-xxxxxxxx has no Internet gateway attached

          • For InvalidAllocationID.NotFound: Elastic IP address eipalloc-xxxxxxxx could not be associated with this NAT gateway

          • For Resource.AlreadyAssociated: Elastic IP address eipalloc-xxxxxxxx is already associated

          • For InternalError: Network interface eni-xxxxxxxx, created and used internally by this NAT gateway is in an invalid state. Please try again.

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

CreateNatGateway (new) Link ¶

Creates a NAT gateway in the specified subnet. A NAT gateway can be used to enable instances in a private subnet to connect to the Internet. This action creates a network interface in the specified subnet with a private IP address from the IP address range of the subnet. For more information, see NAT Gateways in the Amazon Virtual Private Cloud User Guide .

Request Syntax

client.create_nat_gateway(
    SubnetId='string',
    AllocationId='string',
    ClientToken='string'
)
type SubnetId

string

param SubnetId

[REQUIRED]

The subnet in which to create the NAT gateway.

type AllocationId

string

param AllocationId

[REQUIRED]

The allocation ID of an Elastic IP address to associate with the NAT gateway. If the Elastic IP address is associated with another resource, you must first disassociate it.

type ClientToken

string

param ClientToken

Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.

Constraint: Maximum 64 ASCII characters.

rtype

dict

returns

Response Syntax

{
    'NatGateway': {
        'VpcId': 'string',
        'SubnetId': 'string',
        'NatGatewayId': 'string',
        'CreateTime': datetime(2015, 1, 1),
        'DeleteTime': datetime(2015, 1, 1),
        'NatGatewayAddresses': [
            {
                'PublicIp': 'string',
                'AllocationId': 'string',
                'PrivateIp': 'string',
                'NetworkInterfaceId': 'string'
            },
        ],
        'State': 'pending'|'failed'|'available'|'deleting'|'deleted',
        'FailureCode': 'string',
        'FailureMessage': 'string'
    },
    'ClientToken': 'string'
}

Response Structure

  • (dict) --

    • NatGateway (dict) --

      Information about the NAT gateway.

      • VpcId (string) --

        The ID of the VPC in which the NAT gateway is located.

      • SubnetId (string) --

        The ID of the subnet in which the NAT gateway is located.

      • NatGatewayId (string) --

        The ID of the NAT gateway.

      • CreateTime (datetime) --

        The date and time the NAT gateway was created.

      • DeleteTime (datetime) --

        The date and time the NAT gateway was deleted, if applicable.

      • NatGatewayAddresses (list) --

        Information about the IP addresses and network interface associated with the NAT gateway.

        • (dict) --

          Describes the IP addresses and network interface associated with a NAT gateway.

          • PublicIp (string) --

            The Elastic IP address associated with the NAT gateway.

          • AllocationId (string) --

            The allocation ID of the Elastic IP address that's associated with the NAT gateway.

          • PrivateIp (string) --

            The private IP address associated with the Elastic IP address.

          • NetworkInterfaceId (string) --

            The ID of the network interface associated with the NAT gateway.

      • State (string) --

        The state of the NAT gateway.

      • FailureCode (string) --

        If the NAT gateway could not be created, specifies the error code for the failure. ( InsufficientFreeAddressesInSubnet | Gateway.NotAttached | InvalidAllocationID.NotFound | Resource.AlreadyAssociated | InternalError )

      • FailureMessage (string) --

        If the NAT gateway could not be created, specifies the error message for the failure, that corresponds to the error code.

        • For InsufficientFreeAddressesInSubnet: Subnet has insufficient free addresses to create this NAT gateway

        • For Gateway.NotAttached: Network vpc-xxxxxxxx has no Internet gateway attached

        • For InvalidAllocationID.NotFound: Elastic IP address eipalloc-xxxxxxxx could not be associated with this NAT gateway

        • For Resource.AlreadyAssociated: Elastic IP address eipalloc-xxxxxxxx is already associated

        • For InternalError: Network interface eni-xxxxxxxx, created and used internally by this NAT gateway is in an invalid state. Please try again.

    • ClientToken (string) --

      Unique, case-sensitive identifier to ensure the idempotency of the request. Only returned if a client token was provided in the request.

CreateNetworkInterface (updated) Link ¶
Changes (response)
{'NetworkInterface': {'InterfaceType': 'interface | natGateway'}}

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 .

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 .

type DryRun

boolean

param DryRun

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

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'
                }
            },
        ],
        'InterfaceType': 'interface'|'natGateway'
    }
}

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.

      • InterfaceType (string) --

        The type of interface.

CreateRoute (updated) Link ¶
Changes (request)
{'NatGatewayId': 'string'}

Creates a route in a route table within a VPC.

You must specify one of the following targets: Internet gateway or virtual private gateway, NAT instance, NAT gateway, VPC peering connection, 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',
    NatGatewayId='string'
)
type DryRun

boolean

param DryRun

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

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.

type NatGatewayId

string

param NatGatewayId

The ID of a NAT gateway.

rtype

dict

returns

Response Syntax

{
    'Return': True|False
}

Response Structure

  • (dict) --

    • Return (boolean) --

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

CreateRouteTable (updated) Link ¶
Changes (response)
{'RouteTable': {'Routes': {'NatGatewayId': 'string'}}}

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

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

type VpcId

string

param VpcId

[REQUIRED]

The ID of the VPC.

rtype

dict

returns

Response Syntax

{
    'RouteTable': {
        'RouteTableId': 'string',
        'VpcId': 'string',
        'Routes': [
            {
                'DestinationCidrBlock': 'string',
                'DestinationPrefixListId': 'string',
                'GatewayId': 'string',
                'InstanceId': 'string',
                'InstanceOwnerId': 'string',
                'NetworkInterfaceId': 'string',
                'VpcPeeringConnectionId': 'string',
                'NatGatewayId': '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.

          • DestinationPrefixListId (string) --

            The prefix of the AWS service.

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

          • NatGatewayId (string) --

            The ID of a NAT gateway.

          • 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. A subnet ID is not returned for an implicit association.

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

DescribeNetworkInterfaces (updated) Link ¶
Changes (response)
{'NetworkInterfaces': {'InterfaceType': 'interface | natGateway'}}

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

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

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

  • attachment.device-index - The device index to which the network interface is attached.

  • 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.nat-gateway-id - The ID of the NAT gateway to which the network interface is attached.

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

  • 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'
                    }
                },
            ],
            'InterfaceType': 'interface'|'natGateway'
        },
    ]
}

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.

        • InterfaceType (string) --

          The type of interface.

DescribeRouteTables (updated) Link ¶
Changes (response)
{'RouteTables': {'Routes': {'NatGatewayId': 'string'}}}

Describes one or more of your route tables.

Each subnet in your VPC must be associated with a route table. If a subnet is not explicitly associated with any route table, it is implicitly associated with the main route table. This command does not return the subnet ID for implicit associations.

For more information 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

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

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 ( true | false ).

  • route-table-id - The ID of the route table.

  • route.destination-cidr-block - The CIDR range specified in a route in the table.

  • route.destination-prefix-list-id - The ID (prefix) of the AWS service 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.nat-gateway-id - The ID of a NAT gateway.

  • 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',
                    'DestinationPrefixListId': 'string',
                    'GatewayId': 'string',
                    'InstanceId': 'string',
                    'InstanceOwnerId': 'string',
                    'NetworkInterfaceId': 'string',
                    'VpcPeeringConnectionId': 'string',
                    'NatGatewayId': '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.

            • DestinationPrefixListId (string) --

              The prefix of the AWS service.

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

            • NatGatewayId (string) --

              The ID of a NAT gateway.

            • 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. A subnet ID is not returned for an implicit association.

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

ReplaceRoute (updated) Link ¶
Changes (request)
{'NatGatewayId': 'string'}

Replaces an existing route within a route table in a VPC. You must provide only one of the following: Internet gateway or virtual private gateway, NAT instance, NAT gateway, VPC peering connection, 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',
    NatGatewayId='string'
)
type DryRun

boolean

param DryRun

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

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.

type NatGatewayId

string

param NatGatewayId

The ID of a NAT gateway.

returns

None