aws ec2 release-ipam-pool-allocation
Release an allocation within an IPAM pool. AWS CLI reference
1 example 4 options Its page in the AWS CLI reference
Examples
To release an IPAM pool allocation
The following release-ipam-pool-allocation example releases an IPAM pool allocation. In this example, you're an IPAM delegated admin who tried to delete an IPAM pool but received an error that you cannot delete the pool while the pool has allocations. You are using this command to release a pool allocation.
Note the following:
You can only use this command for custom allocations. To remove an allocation for a resource without deleting the resource, set its monitored state to false using modify-ipam-resource-cidr.
To complete this request, you'll need the IPAM pool ID, which you can get with describe-ipam-pools. You'll also need the allocation ID, which you can get with get-ipam-pool-allocations.
If you do not want to remove allocations one by one, you can use the --cascade option when you delete an IPAM pool to automatically release any allocations in the pool before deleting it.
There are a number of prerequisites before running this command. For more information, see Release an allocation in the Amazon VPC IPAM User Guide.
The --region in which you run this command must be the locale of the IPAM pool where the allocation is.
To release the allocation, run the following command.
aws ec2 release-ipam-pool-allocation --ipam-pool-id ipam-pool-07bdd12d7c94e4693 --cidr 10.0.0.0/23 --ipam-pool-allocation-id ipam-pool-alloc-0e66a1f730da54791b99465b79e7d1e89 --region us-west-2Identify--ipam-pool-idThe ID of the IPAM pool which contains the allocation you want to release.--cidrThe CIDR of the allocation you want to release.--ipam-pool-allocation-idThe ID of the allocation.--regionThe region to use.Its output
{
"Success": true
}Once you release an allocation, you may want to run delete-ipam-pool.
Options
--cidrThe CIDR of the allocation you want to release.--dry-runA check for whether you have the required permissions for the action without actually making the request and provides an error response.--ipam-pool-allocation-idThe ID of the allocation.--ipam-pool-idThe ID of the IPAM pool which contains the allocation you want to release.