Getting Information About Your NAT Gateways

You can get information about one or more of your NAT gateways, like its External IP (EIP) or the Virtual Private Cloud (VPC) and subnet where it is located.

If you exceed the number of identical requests allowed for a configured time period, the RequestLimitExceeded error message is returned.

This procedure uses AWS CLI only. Information about these resources is also available from Cockpit. For more information, see VPC User Interface (for Cockpit v1) or the NAT Services dashboard (for Cockpit v2-beta).

To get information about one or more NAT gateways, use the describe-nat-gateways command following this syntax:

Request sample
$ aws ec2 describe-nat-gateways \
    --profile YOUR_PROFILE \
    --nat-gateway-ids [NOT_SPECIFIED] \
    --filters "Name=state,Values=available" \
    --endpoint https://fcu.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • (optional) nat-gateway-ids: One or more IDs of NAT gateways.

(optional) filters: One or more filters, in the "Name=X,Values=Y" format.

You can specify several values for a same filter using the "Name=X,Values=Y, Z" format.

The following filters are available:

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

  • state: The state of the NAT gateway (pending | available | deleting | deleted). For more information, see About NAT Gateways.

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

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

      • tag-key: The key of a tag associated with the resource.

      • tag-value: The value of a tag associated with the resource.

      • tag:XXXX: The value of a tag associated with the resource, where XXXX is the key of the tag.

        To filter a tag whose key is XXXX and value is YYYY, you can therefore use either of the following two formats:

        • --filters Name=tag-key,Values=XXXX Name=tag-value,Values=YYYY

        • --filters Name=tag:XXXX,Values=YYYY

      • endpoint: The endpoint corresponding to the Region you want to send the request to.

The describe-nat-gateways command returns the following elements:

  • NatGateways: Information about one or more NAT gateways. This element contains the following information:

  • CreateTime: The date and time of creation of the NAT gateway.

    • NatGatewayAddresses: Information about the EIP associated with the NAT gateway. This element contains the following information:

      • AllocationId: The allocation ID of the EIP.

      • PublicIp: The EIP associated with the NAT gateway.

  • NatGatewayId: The ID of the NAT gateway.

  • State: The state of the NAT gateway. For more information, see About NAT Gateways.

  • SubnetId: The ID of the subnet in which the NAT gateway is.

  • VpcId: The ID of the VPC in which the NAT gateway is.

  • Tags: The tags associated with the resources.

    • Key: The key of the tags.

    • Value: The value of the tags.

Result sample
 {
  "NatGateways": [
    {
        "CreateTime": "2016-11-08T10:58:42.654Z",
        "NatGatewayAddresses": [
            {
                "AllocationId": "eipalloc-87654321",
                "PublicIp": "198.11.222.333"
            }
        ],
        "NatGatewayId": "nat-5678efgh",
        "State": "available",
        "SubnetId": "subnet-4321dcba",
        "VpcId": "vpc-1234abcd",
        "Tags": []
    }
  ]
}

Related Pages

Corresponding API Method

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.