Amazon Elastic Compute Cloud
API 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...

ReleaseAddress

Description

Releases an Elastic IP address allocated to your account.

Important

After releasing an Elastic IP address, it is released to the IP address pool and might be unavailable to you. Be sure to update your DNS records and any servers or devices that communicate with the address. If you attempt to release an Elastic IP address that you already released, you'll get an AuthFailure error if the address is already allocated to another AWS account.

An Elastic IP address is for use either in the EC2-Classic platform or in a VPC. For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide.

[EC2-Classic, default VPC] Releasing an Elastic IP address automatically disassociates it from any instance that it's associated with. To disassociate an Elastic IP address without releasing it, use the ec2-diassociate-address command.

[nondefault VPC] You must use the ec2-diassociate-address command to disassociate the Elastic IP address before you try to release it. Otherwise, Amazon EC2 returns an error (InvalidIPAddress.InUse).

Request Parameters

PublicIp

[EC2-Classic] The Elastic IP address.

Type: String

Default: None

Required: Conditional

Condition: Required for EC2-Classic

AllocationId

[EC2-VPC] The allocation ID that AWS provided when you allocated the address for use with a VPC.

Type: String

Default: None

Required: Conditional

Condition: Required for EC2-VPC

Response Elements

The following elements are returned in a ReleaseAddressResponse element.

requestId

The ID of the request.

Type: xsd:string

return

Returns true if the request succeeds. Otherwise, returns an error.

Type: xsd:boolean

Examples

Example Request

This example releases an Elastic IP address (67.202.55.255).

https://ec2.amazonaws.com/?Action=ReleaseAddress
&PublicIp=192.0.2.1
&AUTHPARAMS

Example Request

This example releases an Elastic IP address with allocation ID eipalloc-5723d13e.

https://ec2.amazonaws.com/?Action=ReleaseAddress
&AllocationId=eipalloc-5723d13e
&AUTHPARAMS

Example Response

<ReleaseAddressResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/">
  <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> 
  <return>true</return>
</ReleaseAddressResponse>