ipam_pools
Creates, updates, deletes or gets an ipam_pool resource or lists ipam_pools in a region
Overview
| Name | ipam_pools |
| Type | Resource |
| Description | Resource Schema of AWS::EC2::IPAMPool Type |
| Id | awscc.ec2.ipam_pools |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
ipam_pool_id | string | Id of the IPAM Pool. |
address_family | string | The address family of the address space in this pool. Either IPv4 or IPv6. |
allocation_min_netmask_length | integer | The minimum allowed netmask length for allocations made from this pool. |
allocation_default_netmask_length | integer | The default netmask length for allocations made from this pool. This value is used when the netmask length of an allocation isn't specified. |
allocation_max_netmask_length | integer | The maximum allowed netmask length for allocations made from this pool. |
allocation_resource_tags | array | When specified, an allocation will not be allowed unless a resource has a matching set of tags. |
arn | string | The Amazon Resource Name (ARN) of the IPAM Pool. |
auto_import | boolean | Determines what to do if IPAM discovers resources that haven't been assigned an allocation. If set to true, an allocation will be made automatically. |
aws_service | string | Limits which service in Amazon Web Services that the pool can be used in. |
description | string | |
ipam_scope_id | string | The Id of the scope this pool is a part of. |
ipam_scope_arn | string | The Amazon Resource Name (ARN) of the scope this pool is a part of. |
ipam_scope_type | string | Determines whether this scope contains publicly routable space or space for a private network |
ipam_arn | string | The Amazon Resource Name (ARN) of the IPAM this pool is a part of. |
locale | string | The region of this pool. If not set, this will default to "None" which will disable non-custom allocations. If the locale has been specified for the source pool, this value must match. |
pool_depth | integer | The depth of this pool in the source pool hierarchy. |
provisioned_cidrs | array | A list of cidrs representing the address space available for allocation in this pool. |
public_ip_source | string | The IP address source for pools in the public scope. Only used for provisioning IP address CIDRs to pools in the public scope. Default is byoip. |
publicly_advertisable | boolean | Determines whether or not address space from this pool is publicly advertised. Must be set if and only if the pool is IPv6. |
source_ipam_pool_id | string | The Id of this pool's source. If set, all space provisioned in this pool must be free space provisioned in the parent pool. |
source_resource | object | The resource associated with this pool's space. Depending on the ResourceType, setting a SourceResource changes which space can be provisioned in this pool and which types of resources can receive allocations |
state | string | The state of this pool. This can be one of the following values: "create-in-progress", "create-complete", "modify-in-progress", "modify-complete", "delete-in-progress", or "delete-complete" |
state_message | string | An explanation of how the pool arrived at it current state. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
ipam_pool_id | string | Id of the IPAM Pool. |
region | string | AWS region. |
For more information, see AWS::EC2::IPAMPool.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | ipam_pools | INSERT | IpamScopeId, AddressFamily, region |
delete_resource | ipam_pools | DELETE | Identifier, region |
update_resource | ipam_pools | UPDATE | Identifier, PatchDocument, region |
list_resources | ipam_pools_list_only | SELECT | region |
get_resource | ipam_pools | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual ipam_pool.
SELECT
region,
ipam_pool_id,
address_family,
allocation_min_netmask_length,
allocation_default_netmask_length,
allocation_max_netmask_length,
allocation_resource_tags,
arn,
auto_import,
aws_service,
description,
ipam_scope_id,
ipam_scope_arn,
ipam_scope_type,
ipam_arn,
locale,
pool_depth,
provisioned_cidrs,
public_ip_source,
publicly_advertisable,
source_ipam_pool_id,
source_resource,
state,
state_message,
tags
FROM awscc.ec2.ipam_pools
WHERE
region = '{{ region }}' AND
Identifier = '{{ ipam_pool_id }}';
Lists all ipam_pools in a region.
SELECT
region,
ipam_pool_id
FROM awscc.ec2.ipam_pools_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new ipam_pool resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.ec2.ipam_pools (
AddressFamily,
IpamScopeId,
region
)
SELECT
'{{ address_family }}',
'{{ ipam_scope_id }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.ec2.ipam_pools (
AddressFamily,
AllocationMinNetmaskLength,
AllocationDefaultNetmaskLength,
AllocationMaxNetmaskLength,
AllocationResourceTags,
AutoImport,
AwsService,
Description,
IpamScopeId,
Locale,
ProvisionedCidrs,
PublicIpSource,
PubliclyAdvertisable,
SourceIpamPoolId,
SourceResource,
Tags,
region
)
SELECT
'{{ address_family }}',
'{{ allocation_min_netmask_length }}',
'{{ allocation_default_netmask_length }}',
'{{ allocation_max_netmask_length }}',
'{{ allocation_resource_tags }}',
'{{ auto_import }}',
'{{ aws_service }}',
'{{ description }}',
'{{ ipam_scope_id }}',
'{{ locale }}',
'{{ provisioned_cidrs }}',
'{{ public_ip_source }}',
'{{ publicly_advertisable }}',
'{{ source_ipam_pool_id }}',
'{{ source_resource }}',
'{{ tags }}',
'{{ 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_pool
props:
- name: address_family
value: '{{ address_family }}'
- name: allocation_min_netmask_length
value: '{{ allocation_min_netmask_length }}'
- name: allocation_default_netmask_length
value: '{{ allocation_default_netmask_length }}'
- name: allocation_max_netmask_length
value: '{{ allocation_max_netmask_length }}'
- name: allocation_resource_tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: auto_import
value: '{{ auto_import }}'
- name: aws_service
value: '{{ aws_service }}'
- name: description
value: '{{ description }}'
- name: ipam_scope_id
value: '{{ ipam_scope_id }}'
- name: locale
value: '{{ locale }}'
- name: provisioned_cidrs
value:
- cidr: '{{ cidr }}'
- name: public_ip_source
value: '{{ public_ip_source }}'
- name: publicly_advertisable
value: '{{ publicly_advertisable }}'
- name: source_ipam_pool_id
value: '{{ source_ipam_pool_id }}'
- name: source_resource
value:
resource_id: '{{ resource_id }}'
resource_type: '{{ resource_type }}'
resource_region: '{{ resource_region }}'
resource_owner: '{{ resource_owner }}'
- name: tags
value:
- null
UPDATE example
Use the following StackQL query and manifest file to update a ipam_pool resource, using stack-deploy.
/*+ update */
UPDATE awscc.ec2.ipam_pools
SET PatchDocument = string('{{ {
"AllocationMinNetmaskLength": allocation_min_netmask_length,
"AllocationDefaultNetmaskLength": allocation_default_netmask_length,
"AllocationMaxNetmaskLength": allocation_max_netmask_length,
"AllocationResourceTags": allocation_resource_tags,
"AutoImport": auto_import,
"Description": description,
"ProvisionedCidrs": provisioned_cidrs,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ ipam_pool_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.ec2.ipam_pools
WHERE
Identifier = '{{ ipam_pool_id }}' 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_pools resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
ec2:CreateIpamPool,
ec2:DescribeIpamPools,
ec2:ProvisionIpamPoolCidr,
ec2:GetIpamPoolCidrs,
ec2:CreateTags
ec2:DescribeIpamPools,
ec2:GetIpamPoolCidrs
ec2:ModifyIpamPool,
ec2:DescribeIpamPools,
ec2:GetIpamPoolCidrs,
ec2:ProvisionIpamPoolCidr,
ec2:DeprovisionIpamPoolCidr,
ec2:CreateTags,
ec2:DeleteTags
ec2:DeleteIpamPool,
ec2:DescribeIpamPools,
ec2:GetIpamPoolCidrs,
ec2:DeprovisionIpamPoolCidr,
ec2:DeleteTags
ec2:DescribeIpamPools