How Do You Take a BYOIP Range Back Out of AWS?
Key takeaways
- Disassociating an Elastic IP detaches it from a workload, yet the address stays allocated until you explicitly release it back to the BYOIP pool.
- AWS EC2 requires zero allocated Elastic IPs and a withdrawn BGP advertisement before DeprovisionByoipCidr will accept removal of the whole imported range.
- After withdrawal, the range remains provisioned and can be re-advertised, though re-advertisement alone cannot restore released addresses or migrated workloads.
- Once deprovisioned, bringing the prefix back to EC2 later requires completing the provisioning process again.
On this page
Your workloads have already moved off AWS, yet Amazon EC2 rejects the deprovision request because one Elastic IP is still allocated. Removing a Bring Your Own IP (BYOIP) /24 from AWS follows a strict prerequisite chain: every Elastic IP allocation must be released, the BGP advertisement must be withdrawn, and only then can the imported range be deprovisioned.
Walking through the standard Amazon EC2 public IPv4 BYOIP workflow with an example range (203.0.113.0/24, reserved for documentation under RFC 5737) shows why a detached address still blocks removal and where your last easy rollback point sits.
Inventory dependencies and verify the replacement first
Before releasing any Elastic IP from your EC2 BYOIP pool, confirm that nothing still depends on the AWS path:
- Inventory workloads and associations: Check EC2 instances, NAT gateways, Network Load Balancers, and elastic network interfaces in the region holding addresses from the pool.
- Inventory external dependencies: Check DNS records (including TTLs), partner IP allowlists, reverse-DNS PTR records, and mail or webhook integrations that expect the old addresses.
- Verify the replacement service from outside AWS: Before releasing the final allocation or withdrawing the route, combine routing observer views with external HTTPS checks on the replacement destination, as described in Your Cloud Says “Advertised.” Can Users Reach Your IP?.
Disassociating an Elastic IP is not the same as releasing it
This distinction causes the most common surprise during AWS BYOIP offboarding:
- Disassociate: Detaches the Elastic IP (for example,
203.0.113.10) from an instance, NAT gateway, or network interface. Traffic stops reaching that workload, yet the address remains allocated to your AWS account from the BYOIP pool. - Release: Returns the Elastic IP allocation back to the BYOIP address pool (
ReleaseAddress). Until every allocated address from the/24is released, the pool’s allocation count is non-zero and AWS blocks deprovisioning.
AWS’s documented EC2 removal sequence
Following the Amazon EC2 BYOIP onboarding and removal guide and the DeprovisionByoipCidr API reference, remove a public IPv4 BYOIP range in three ordered steps:
AWS deprovisions the whole imported prefix, not a partial sub-range.
What still blocks release, withdrawal, and deprovisioning
Track three separate states on 203.0.113.0/24 (documentation example): Allocation count, Advertisement, and Provisioning. Trying to skip directly to DeprovisionByoipCidr fails with a specific prerequisite until both earlier states clear:
| Stage or test | Allocation count | Advertisement | Provisioning | Outcome |
|---|---|---|---|---|
| Starting state (1 detached EIP) | 1 allocated (203.0.113.10, detached) | Advertised | Provisioned | Deprovision blocked: release the remaining Elastic IP allocation and withdraw the route first |
| Early deprovision with 1 EIP left | 1 allocated | Advertised | Provisioned | Rejected: active Elastic IP allocations must be released before deprovisioning |
| After releasing the Elastic IP | 0 allocated | Advertised | Provisioned | Ready to withdraw the BGP advertisement; deprovisioning is still blocked while advertised |
| Early deprovision while advertised | 0 allocated | Advertised | Provisioned | Rejected: stop advertising the CIDR (WithdrawByoipCidr) before deprovisioning |
| After withdrawing the route | 0 allocated | Withdrawn | Provisioned | Decision point: range is still provisioned and ready for DeprovisionByoipCidr |
| After deprovisioning | 0 allocated | Withdrawn | Deprovisioned | Range has left AWS EC2; using it in EC2 again requires provisioning again |
Walk through the EC2 state transitions below and test early deprovisioning at each stage to see the exact prerequisite AWS checks:
EC2 BYOIP Removal Prerequisites · Example 203.0.113.0/24
Work through the steps in order, or trigger Deprovision early to inspect each AWS prerequisite check.
- Allocation count
- 1 allocated (203.0.113.10, detached)
- Advertisement
- Advertised
- Provisioning
- Provisioned
Starting state: 1 detached Elastic IP is still allocated
Example Elastic IP 203.0.113.10 is detached from its old EC2 workload, yet it is still allocated to your account. Release it, withdraw the route, and then deprovision 203.0.113.0/24.
The decision point after withdrawal
Pause right after withdrawing the route and before calling DeprovisionByoipCidr. At this point, the /24 is still provisioned in your AWS account and can be advertised again quickly if an unexpected dependency surfaces.
Keep the scope of that rollback clear: re-advertising the range restores BGP announcement from AWS, yet re-advertisement alone cannot restore released Elastic IP allocations or migrated workloads. You would still have to re-allocate addresses and re-attach workloads if you rolled back. Once you run DeprovisionByoipCidr, the range leaves EC2 completely, and bringing it back to EC2 later requires going through the provisioning workflow again. Wait until the range is fully withdrawn and no longer needed in AWS before removing AWS’s origin ASN from your RPKI Route Origin Authorization (ROA).
FAQ
Related resources
Ready to see where BYOIP is supported?
Continue the series
Can Two AWS Accounts Use Addresses From the Same BYOIP Block?
One networking team manages the prefix. Two application accounts need different public IPs. Follow the regional pool and the permissions each account needs.
5 min read · Updated 4 December 2026
Read articleWho Can Sign a Letter of Authorization for a BYOIP Prefix?
Your team leases a /24 and the new network asks for an LOA. Find out whose authority the letter must carry and what the provider checks.
6 min read · Updated 4 December 2026
Read article