Skip to main content

ipam_allocations

Creates, updates, deletes or gets an ipam_allocation resource or lists ipam_allocations in a region

Overview

Nameipam_allocations
TypeResource
DescriptionResource Schema of AWS::EC2::IPAMAllocation Type
Idaws.ec2.ipam_allocations

Fields

NameDatatypeDescription
ipam_pool_allocation_idstringId of the allocation.
ipam_pool_idstringId of the IPAM Pool.
cidrstringRepresents a single IPv4 or IPv6 CIDR
netmask_lengthintegerThe desired netmask length of the allocation. If set, IPAM will choose a block of free space with this size and return the CIDR representing it.
descriptionstring
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTIpamPoolId, region
delete_resourceDELETEdata__Identifier, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all ipam_allocations in a region.

SELECT
region,
ipam_pool_allocation_id,
ipam_pool_id,
cidr,
netmask_length,
description
FROM aws.ec2.ipam_allocations
WHERE region = 'us-east-1';

Gets all properties from an individual ipam_allocation.

SELECT
region,
ipam_pool_allocation_id,
ipam_pool_id,
cidr,
netmask_length,
description
FROM aws.ec2.ipam_allocations
WHERE region = 'us-east-1' AND data__Identifier = '<IpamPoolId>|<IpamPoolAllocationId>|<Cidr>';

INSERT example

Use the following StackQL query and manifest file to create a new ipam_allocation resource, using stack-deploy.

/*+ create */
INSERT INTO aws.ec2.ipam_allocations (
IpamPoolId,
region
)
SELECT
'{{ IpamPoolId }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.ec2.ipam_allocations
WHERE data__Identifier = '<IpamPoolId|IpamPoolAllocationId|Cidr>'
AND region = 'us-east-1';

Permissions

To operate on the ipam_allocations resource, the following permissions are required:

Create

ec2:AllocateIpamPoolCidr,
ec2:GetIpamPoolAllocations

Read

ec2:GetIpamPoolAllocations

Delete

ec2:ReleaseIpamPoolAllocation

List

ec2:GetIpamPoolAllocations