Use an elastic IP

Hold a public IPv4 address independently of any machine, attach it to an instance, move it, and release it.

Last updated 18 November 2026View as Markdown

Replace the ids with your own. On your organization's own hosts an elastic IP works differently; see Instances on your own hosts.

Important

An elastic IP is metered every hour it is allocated, attached or not, until you release it, as an hourly share of its monthly price. Where elastic IPs are not charged yet, the console shows the cost as "metered, not charged yet"; you are told before charging starts.

Prerequisites

  • In the console, also ec2:DescribeInstances to open the instance's page (without it the page is not found).
  • Permission for ec2:AllocateAddress, ec2:AssociateAddress, ec2:DisassociateAddress and ec2:ReleaseAddress, as the step needs.
  • In the console, also ec2:DescribeAddresses to open Elastic IPs (without it the page says "Access denied").
  • Room in the elastic IP quota.
  • To attach the address in the console: an instance that is running or stopped, in the address's region.

Allocate an address

  1. Open Compute, then Elastic IPs, and choose Create Elastic IP.
  2. In Allocate Elastic IP, for Region, choose the region.
  3. Choose Allocate.

Attach it to an instance

  1. Open the instance, then choose Networking.
  2. Under Elastic IP, choose Associate.
  3. In Associate Elastic IP, for Elastic IP, choose the address (or allocate one there), then choose Associate.

Or, on Elastic IPs, choose Associate with instance in the address's row menu.

An address that is already associated is refused with 400 "IP is already associated. Disassociate it first"; an instance whose machine does not exist yet with 409 "Instance has no backing server yet". An address with no tags takes the instance's tags when it is associated; tags it already has are never overwritten.

Instances launched since 17 November 2026 bind the address themselves within 20 seconds. On an older instance the address does not answer until you run the commands the address's details show under On the machine (Ubuntu or Debian with netplan), once, as root. The details say Active on the machine once the machine has bound it.

Move or detach it

On Elastic IPs, choose Disassociate in the address's row menu, then choose Disassociate in the dialog; or, on the instance's Networking tab, under Elastic IP, choose Disassociate (it takes effect at once, without a dialog). Then associate it with the other instance.

The address stays allocated and metered. Disassociating an address that is not attached is refused with 400 "IP is not associated with any instance". Terminating the instance disassociates it as well.

Release it

  1. On Elastic IPs, choose the address to open its side panel.
  2. Under Release this address, choose Release address.
  3. Enter the address and choose Release.

Releasing an attached address is refused with 400 "Disassociate the IP from its instance before releasing". A released address returns to the pool and cannot be reclaimed.

Did this page help you?