Skip to content

How do I troubleshoot the "The allocation ID is not valid, cannot release allocation for resource type VPC" error?

2 minute read
0

I use Amazon Virtual Private Cloud (Amazon VPC). When I tried to deallocate a Classless Inter-Domain Routing (CIDR) block, I received the "The allocation ID is not valid, cannot release allocation for resource type VPC" error.

Resolution

To deallocate an Amazon VPC CIDR from the Amazon VPC IP Address Manager (IPAM) pool, delete the VPC, or set the VPC's monitoring status to Ignored.

Note: You can't call release-ipam-pool-allocation against an Amazon VPC CIDR block.

Delete the VPC

Use the Amazon VPC console to delete the VPC.

Ignore the VPC

Complete the following steps:

  1. Open the Amazon VPC IPAM console.
  2. In the navigation pane, choose Resources.
  3. From the dropdown list, select a private scope.
  4. In the content pane, select the VPC to view its details.
  5. For Associated CIDRs, select one of the CIDR blocks that's allocated to the VPC.
  6. Choose Actions.
  7. Choose Mark as ignored.
    Note: You can use this action only to release manual allocations. To remove an allocation for a resource but not delete the resource, use the ModifyIpamResourceCidr API call to set the resource's monitored state to false.

Release an allocation in a public scope

Important: You can't remove allocations in a public scope. However, you can release allocations in a public scope.

To release an allocation in a public scope, delete the resource CIDR block, or delete the VPC. You can't ignore public resource CIDR blocks.

Prerequisite: Configure your AWS account permissions for a single account or for multiple accounts.

Delete a resource IPv4 CIDR block. Or, delete a resource IPv6 CIDR block.

Note: It might take some time for Amazon VPC IPAM to release your allocation.

4 Comments

There seems to be no option to remove an allocation from a public scope. For example, if someone brought their BYOIP, IPv6 for instance. You can't remove it from the allocation pool once it's tagged with a VPC and disassociated later. Even if you try to remove it from cli it gives the following error.

An error occurred (InvalidParameterValue) when calling the ReleaseIpamPoolAllocation operation: The allocation ID ipam-pool-alloc-xyz is not valid. Cannot release allocation for resource type VPC.

replied 2 years ago

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

AWS
MODERATOR
replied 2 years ago

Is there a solution for public scopes?

I have an IPAM pool on public scope with 2 VPC allocations.

Nothing on the AWS Console gives you a way to find and remove those allocations.

And when you manually carefully look at your VPC (and subnet, routing tables, etc.) there is no mention of those CIDRs.

replied 4 months ago

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

AWS
MODERATOR
replied 4 months ago