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 | awscc.ec2.ipam_allocations |
Fields
- get (all properties)
- list (identifiers only)
| 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. |
| 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 |
region | string | AWS region. |
For more information, see AWS::EC2::IPAMAllocation.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | ipam_allocations | INSERT | IpamPoolId, region |
delete_resource | ipam_allocations | DELETE | Identifier, region |
list_resources | ipam_allocations_list_only | SELECT | region |
get_resource | ipam_allocations | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual ipam_allocation.
SELECT
region,
ipam_pool_allocation_id,
ipam_pool_id,
cidr,
netmask_length,
description
FROM awscc.ec2.ipam_allocations
WHERE
region = '{{ region }}' AND
Identifier = '{{ ipam_pool_id }}|{{ ipam_pool_allocation_id }}|{{ cidr }}';
Lists all ipam_allocations in a region.
SELECT
region,
ipam_pool_id,
ipam_pool_allocation_id,
cidr
FROM awscc.ec2.ipam_allocations_list_only
WHERE
region = '{{ region }}';
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 awscc.ec2.ipam_allocations (
IpamPoolId,
region
)
SELECT
'{{ ipam_pool_id }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.ec2.ipam_allocations (
IpamPoolId,
Cidr,
NetmaskLength,
Description,
region
)
SELECT
'{{ ipam_pool_id }}',
'{{ cidr }}',
'{{ netmask_length }}',
'{{ description }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: ipam_allocation
props:
- name: ipam_pool_id
value: '{{ ipam_pool_id }}'
- name: cidr
value: '{{ cidr }}'
- name: netmask_length
value: '{{ netmask_length }}'
- name: description
value: '{{ description }}'
DELETE example
/*+ delete */
DELETE FROM awscc.ec2.ipam_allocations
WHERE
Identifier = '{{ ipam_pool_id }}|{{ ipam_pool_allocation_id }}|{{ cidr }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the ipam_allocations resource, the following permissions are required:
- Create
- Read
- Delete
- List
ec2:AllocateIpamPoolCidr,
ec2:GetIpamPoolAllocations
ec2:GetIpamPoolAllocations
ec2:ReleaseIpamPoolAllocation
ec2:GetIpamPoolAllocations