ipam_allocations
Creates, updates, deletes or gets an ipam_allocation
resource or lists ipam_allocations
in a region
Overview
Name | ipam_allocations |
Type | Resource |
Description | Resource Schema of AWS::EC2::IPAMAllocation Type |
Id | aws.ec2.ipam_allocations |
Fields
Name | Datatype | Description |
---|---|---|
ipam_pool_allocation_id | string | Id of the allocation. |
ipam_pool_id | string | Id of the IPAM Pool. |
cidr | string | Represents a single IPv4 or IPv6 CIDR |
netmask_length | integer | The 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. |
description | string | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | IpamPoolId, region |
delete_resource | DELETE | data__Identifier, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.ec2.ipam_allocations (
IpamPoolId,
region
)
SELECT
'{{ IpamPoolId }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ec2.ipam_allocations (
IpamPoolId,
Cidr,
NetmaskLength,
Description,
region
)
SELECT
'{{ IpamPoolId }}',
'{{ Cidr }}',
'{{ NetmaskLength }}',
'{{ Description }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: ipam_allocation
props:
- name: IpamPoolId
value: '{{ IpamPoolId }}'
- name: Cidr
value: '{{ Cidr }}'
- name: NetmaskLength
value: '{{ NetmaskLength }}'
- name: Description
value: '{{ Description }}'
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