Amazon Elastic Compute Cloud
CLI Reference (API Version 2013-02-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

ec2-describe-addresses

Description

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.

The short version of this command is ec2daddr.

Syntax

ec2-describe-addresses [public_ip ... | allocation_id ...] [[--filter "name=value"] ...]

Options

NameDescription

public_ip

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

Type: String

Default: Describes all your Elastic IP addresses.

Required: No

Example: 198.51.100.1

allocation_id

[EC2-VPC] One or more allocation IDs.

Type: String

Default: Describes all your Elastic IP addresses.

Required: No

Example: eipalloc-9558a4fc

-F, --filter name=value

A filter for limiting the results. See the Supported Filters section for a list of supported filters. Use quotation marks if the value string has a space ("name=value example"). On a Windows system, use quotation marks even without a space in the value string ("name=value").

Type: String

Default: Describes all your Elastic IP addresses, or only those you specified.

Required: No

Example: --filter "instance-id=i-1a2b3c4d"

Supported Filters

You can specify filters so that the response includes information for only certain Elastic IP addresses. For example, you can use a filter to specify that you're interested in addresses that have a specific tag. You can specify multiple values for a filter. The response includes information for an address only if it matches at least one of the filter values that you specified.

You can specify multiple filters; for example, specify addresses of a specific value that have a specific tag. The response includes information for an address only if it matches all the filters that you specified. If there's no match, no special message is returned, the response is simply empty.

You can use wildcards in a filter value. An asterisk (*) matches zero or more characters, and a question mark (?) matches exactly one character. You can escape special characters using a backslash (\) before the character. For example, a value of \*amazon\?\\ searches for the literal string *amazon?\.

The following are the available filters.

domain

Indicates whether the address is for use in a VPC.

Type: String

Valid values: standard | vpc

instance-id

The instance the address is associated with (if any).

Type: String

public-ip

The Elastic IP address.

Type: String

allocation-id

The allocation ID for the address (VPC only).

Type: String

association-id

The association ID for the address (VPC only).

Type: String

network-interface-id

The network interface (if any) that the address is associated with (VPC only).

Type: String

network-interface-owner-id

The owner IID.

Type: String

private-ip-address

The private IP address associated with the Elastic IP address (VPC only).

Type: String

Common Options

OptionDescription

--region REGION

Overrides the region specified by the EC2_URL environment variable and the URL specified by the -U option.

Default: The value of the EC2_URL environment variable, or us-east-1 if EC2_URL isn't set.

Example: --region eu-west-1

-U, --url URL

The uniform resource locator (URL) of the Amazon EC2 web service entry point.

Default: The value of the EC2_URL environment variable, or https://ec2.amazonaws.com if EC2_URL isn't set.

Example: -U https://ec2.amazonaws.com

-K, --private-key EC2-PRIVATE-KEY

The private key that identifies you to Amazon EC2. For more information, see Tell the Tools Who You Are.

Default: The value of the EC2_PRIVATE_KEY environment variable. If EC2_PRIVATE_KEY isn't set, you must specify this option.

Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem

-C, --cert EC2-CERT

The X.509 certificate that identifies you to Amazon EC2.

Default: The value of the EC2_CERT environment variable. If EC2_CERT isn't set, you must specify this option.

Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem

-O, --aws-access-key AWS_ACCESS_KEY

The access key ID associated with your AWS account. For more information, see Tell the Tools Who You Are.

Default: The value of the AWS_ACCESS_KEY environment variable. If AWS_ACCESS_KEY isn't set, you must specify this option.

Example: -O AKIAIOSFODNN7EXAMPLE

Note

For more information, see the following section, Deprecated Options.

-W, --aws-secret-key AWS_SECRET_KEY

The secret access key associated with your AWS account.

Default: The value of the AWS_SECRET_KEY environment variable. If AWS_SECRET_KEY isn't set, you must specify this option.

Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

Note

For more information, see the following section, Deprecated Options.

-T, --security-token TOKEN AWS_DELEGATION_TOKEN

The AWS delegation token.

Default: The value of the environment variable (if set).

--connection-timeout TIMEOUT

The connection timeout, in seconds.

Example: --connection-timeout 30

--request-timeout TIMEOUT

The request timeout, in seconds.

Example: --request-timeout 45

-v, --verbose

Displays verbose output, including the API request and response on the command line. This is useful if you are building tools to talk directly to our Query API.

-H, --headers

Includes column headers in the command output.

--show-empty-fields

Shows empty columns as (nil).

--hide-tags

Omits tags for tagged resources.

--debug

Displays internal debugging information. This can assist us when helping you troubleshooting problems.

-?, --help, -h

Displays usage information for the command.

-

Reads arguments from standard input. This is useful when piping the output from one command to the input of another.

Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances -

Deprecated Options

For a limited time, you can still use the private key and X.509 certificate instead of your access key ID and secret access key. However, we recommend that you start using your access key ID (-O, --aws-access-key) and secret access key (-W, --aws-secret-key) now, as the private key (-K, --private-key) and X.509 certificate (-C, --cert) won't be supported after the transition period elapses. For more information, see Tell the Tools Who You Are.

OptionDescription

-K, --private-key EC2-PRIVATE-KEY

The private key to use when constructing requests to Amazon EC2.

Default: The value of the EC2_PRIVATE_KEY environment variable.

Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem

-C, --cert EC2-CERT

The X.509 certificate to use when constructing requests to Amazon EC2.

Default: The value of the EC2_CERT environment variable.

Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem

Output

This command returns a table that contains the following information:

  • The ADDRESS identifier

  • The Elastic IP address

  • The ID of the instance to which the IP address is associated, if any

  • The domain of the Elastic IP address (standard or vpc)

  • [EC2-VPC] The allocation ID

  • [EC2-VPC] The association ID

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

Amazon EC2 command line tools display errors on stderr.

Examples

Example Request

This example describes the Elastic IP address 192.0.2.1, which is assigned to instance i-f15ebb98 in EC2-Classic.

PROMPT> ec2-describe-addresses 192.0.2.1
ADDRESS  192.0.2.1   i-f15ebb98  standard

Example Request

This example describes the Elastic IP address with allocation ID eipalloc-282d9641, which is assigned to instance i-7a00642 in EC2-VPC.

PROMPT> ec2-describe-addresses eipalloc-9258a4fb
Type    Address                Instance        Domain  AllocationId            AssociationId           NetworkInterfaceID 
PrivateIP ADDRESS 203.0.113.0   i-7a00642e      vpc     eipalloc-282d9641       eipassoc-252d964c       eni-d83388b1    10.0.0.14 4

Example Request

This example describes all your Elastic IP addresses (for both EC2-Classic and your VPCs).

PROMPT> ec2-describe-addresses 
ADDRESS 203.0.113.12   i-f15ebb98  standard
ADDRESS 203.0.113.22   i-9e9da4e9      vpc     eipalloc-9258a4fb   eipassoc-0659a56f
ADDRESS 203.0.113.32     vpc     eipalloc-9558a4fc

Example Request

This example describes your Elastic IP addresses for EC2-VPC.

PROMPT> ec2-describe-addresses --filter "allocation-id=*" -H
ec2-describe-addresses -H
Type        Address               Instance     Domain  AllocationId          AssociationId        NetworkInterfaceID 
PrivateIP   ADDRESS 203.0.113.10                vpc     eipalloc-1b5fe072     eipassoc-eb5fe082       eni-0689366f    10.0.1.35
            ADDRESS 203.0.113.20    i-c844219c  vpc     eipalloc-b463dcdd       eipassoc-d218a3bb     eni-ea67dc83    10.0.0.174
            ADDRESS 203.0.113.140   i-ba6a0d    vpc     eipalloc-1266dd7b       eipassoc-39e15b50     eni-73e05a1a    10.0.0.85
            ADDRESS 203.0.113.140   i-7a00642   vpc     eipalloc-f38a359a       eipassoc-1f239876       eni-d83388b1  10.0.0.12
            ADDRESS 203.0.113.177   i-7a00642e  vpc     eipalloc-282d9641       eipassoc-252d964c       eni-d83388b1   10.0.0.14

Example Request

This example describes Elastic IP addresses associated with a particular private IP address in EC2-VPC.

PROMPT> ec2-describe-addresses --filter "private-ip-address=10.0.0.94"
ADDRESS 203.0.113.155   vpc     eipalloc-fdfc4394       eipassoc-52fa453b       eni-66fc430f    10.0.0.94