Amazon Elastic Compute Cloud
API Reference (API Version 2011-12-15)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

AllocateAddress

Description

This action applies to both EC2 Elastic IP addresses and VPC Elastic IP addresses.

For EC2 addresses: This action acquires an Elastic IP address for use with your Amazon Web Services (AWS) account. For more information about EC2 Elastic IP addresses, go to Instance Addressing in the Amazon Elastic Compute Cloud User Guide.

For VPC addresses: This action acquires an Elastic IP address for use with your VPC. For information about VPC addresses and how they differ from EC2 addresses, go to the Elastic IP Addresses in the Amazon Virtual Private Cloud User Guide.

Request Parameters

NameDescriptionRequired

Domain

Set to vpc to allocate the address to your VPC.

Type: String

Default: Address is standard (allocated to EC2)

Valid Values: vpc

Condition: Required when allocating an address to a VPC

Conditional

Response Elements

The elements in the following table are wrapped in an AllocateAddressResponse structure.

NameDescription

requestId

The ID of the request.

Type: xsd:string

publicIp

Elastic IP address.

Type: xsd:string

domain

Whether this Elastic IP address is for instances in EC2 (i.e., standard) or instances in a VPC.

Type: xsd:string

Valid Values: standard | vpc

allocationId

ID that AWS assigns to represent the allocation of the address for use with Amazon VPC. Returned only for VPC elastic IP addresses.

Type: xsd:string

Examples

Example Request

This example returns an Elastic IP address for use with the account.

https://ec2.amazonaws.com/?Action=AllocateAddress
&AUTHPARAMS

Example Response

<AllocateAddressResponse xmlns="http://ec2.amazonaws.com/doc/2011-12-15/">
   <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> 
   <publicIp>192.0.2.1</publicIp>
</AllocateAddressResponse>

Example Request

This example returns a VPC Elastic IP address for use with Amazon VPC.

https://ec2.amazonaws.com/?Action=AllocateAddress
Domain=vpc
&AUTHPARAMS

Example Response

<AllocateAddressResponse xmlns="http://ec2.amazonaws.com/doc/2011-12-15/">
   <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> 
   <publicIp>198.51.100.1</publicIp>
   <domain>vpc</domain>
   <allocationId>eipalloc-5723d13e</allocationId>
</AllocateAddressResponse>