Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . ec2 ]

allocate-address

Description

Allocates an Elastic IP address to your AWS account. After you allocate the Elastic IP address you can associate it with an instance or network interface. After you release an Elastic IP address, it is released to the IP address pool and can be allocated to a different AWS account.

[EC2-VPC] If you release an Elastic IP address, you might be able to recover it. You cannot recover an Elastic IP address that you released after it is allocated to another AWS account. You cannot recover an Elastic IP address for EC2-Classic. To attempt to recover an Elastic IP address that you released, specify it in this operation.

An Elastic IP address is for use either in the EC2-Classic platform or in a VPC. By default, you can allocate 5 Elastic IP addresses for EC2-Classic per region and 5 Elastic IP addresses for EC2-VPC per region.

For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide .

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  allocate-address
[--domain <value>]
[--address <value>]
[--dry-run | --no-dry-run]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--domain (string)

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.

Possible values:

  • vpc
  • standard

--address (string)

[EC2-VPC] The Elastic IP address to recover.

--dry-run | --no-dry-run (boolean)

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 .

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.

Examples

To allocate an Elastic IP address for EC2-Classic

This example allocates an Elastic IP address to use with an instance in EC2-Classic.

Command:

aws ec2 allocate-address

Output:

{
    "PublicIp": "198.51.100.0",
    "Domain": "standard"
}

To allocate an Elastic IP address for EC2-VPC

This example allocates an Elastic IP address to use with an instance in a VPC.

Command:

aws ec2 allocate-address --domain vpc

Output:

{
    "PublicIp": "203.0.113.0",
    "Domain": "vpc",
    "AllocationId": "eipalloc-64d5890a"
}

Output

PublicIp -> (string)

The Elastic IP address.

AllocationId -> (string)

[EC2-VPC] The ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.

Domain -> (string)

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