ipam_pool_cidrs
Creates, updates, deletes, gets or lists an ipam_pool_cidrs resource.
Overview
| Name | ipam_pool_cidrs |
| Type | Resource |
| Id | aws.ec2.ipam_pool_cidrs |
Fields
The following fields are returned by SELECT queries:
- get_ipam_pool_cidrs
| Name | Datatype | Description |
|---|---|---|
cidr | string | The CIDR provisioned to the IPAM pool. A CIDR is a representation of an IP address and its associated network mask (or netmask) and refers to a range of IP addresses. An IPv4 CIDR example is 10.24.34.0/23. An IPv6 CIDR example is 2001:DB8::/32. |
failure_reason | string | Details related to why an IPAM pool CIDR failed to be provisioned. |
ipam_pool_cidr_id | string | The IPAM pool CIDR ID. |
netmask_length | integer | The netmask length of the CIDR you'd like to provision to a pool. Can be used for provisioning Amazon-provided IPv6 CIDRs to top-level pools and for provisioning CIDRs to pools with source pools. Cannot be used to provision BYOIP CIDRs to top-level pools. "NetmaskLength" or "Cidr" is required. |
state | string | The state of the CIDR. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_ipam_pool_cidrs | select | IpamPoolId, region | DryRun, Filter, MaxResults, NextToken | Get the CIDRs provisioned to an IPAM pool. |
allocate_ipam_pool_cidr | update | IpamPoolId, region | DryRun, Cidr, NetmaskLength, ClientToken, Description, PreviewNextCidr, AllowedCidr, DisallowedCidr, TagSpecification | Allocate a CIDR from an IPAM pool. The Region you use should be the IPAM pool locale. The locale is the Amazon Web Services Region where this IPAM pool is available for allocations. In IPAM, an allocation is a CIDR assignment from an IPAM pool to another IPAM pool or to a resource. For more information, see Allocate CIDRs in the Amazon VPC IPAM User Guide. This action creates an allocation with strong consistency. The returned CIDR will not overlap with any other allocations from the same pool. |
deprovision_ipam_pool_cidr | exec | IpamPoolId, region | DryRun, Cidr | Deprovision a CIDR provisioned from an IPAM pool. If you deprovision a CIDR from a pool that has a source pool, the CIDR is recycled back into the source pool. For more information, see Deprovision pool CIDRs in the Amazon VPC IPAM User Guide. |
provision_ipam_pool_cidr | exec | IpamPoolId, region | DryRun, Cidr, CidrAuthorizationContext, NetmaskLength, ClientToken, VerificationMethod, IpamExternalResourceVerificationTokenId | Provision a CIDR to an IPAM pool. You can use this action to provision new CIDRs to a top-level pool or to transfer a CIDR from a top-level pool to a pool within it. For more information, see Provision CIDRs to pools in the Amazon VPC IPAM User Guide. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
IpamPoolId | string | The ID of the IPAM pool to which you want to assign a CIDR. |
region | string | AWS region (default: us-east-1) |
AllowedCidr | array | Include a particular CIDR range that can be returned by the pool. Allowed CIDRs are only allowed if using netmask length for allocation. |
Cidr | string | The CIDR you want to assign to the IPAM pool. Either "NetmaskLength" or "Cidr" is required. This value will be null if you specify "NetmaskLength" and will be filled in during the provisioning process. |
CidrAuthorizationContext | object | A signed document that proves that you are authorized to bring a specified IP address range to Amazon using BYOIP. This option only applies to IPv4 and IPv6 pools in the public scope. |
ClientToken | string | A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency. |
Description | string | A description for the allocation. |
DisallowedCidr | array | Exclude a particular CIDR range from being returned by the pool. Disallowed CIDRs are only allowed if using netmask length for allocation. |
DryRun | boolean | A check for whether you have the required permissions for the action without actually making the request and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation. |
Filter | array | One or more filters for the request. For more information about filtering, see Filtering CLI output. |
IpamExternalResourceVerificationTokenId | string | Verification token ID. This option only applies to IPv4 and IPv6 pools in the public scope. |
MaxResults | integer | The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination. |
NetmaskLength | integer | The netmask length of the CIDR you'd like to provision to a pool. Can be used for provisioning Amazon-provided IPv6 CIDRs to top-level pools and for provisioning CIDRs to pools with source pools. Cannot be used to provision BYOIP CIDRs to top-level pools. Either "NetmaskLength" or "Cidr" is required. |
NextToken | string | The token for the next page of results. |
PreviewNextCidr | boolean | A preview of the next available CIDR in a pool. |
TagSpecification | array | The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value. If you specify tags, the request is authorized against the allocation resource in addition to the pool resource. |
VerificationMethod | string | The method for verifying control of a public IP address range. Defaults to remarks-x509 if not specified. This option only applies to IPv4 and IPv6 pools in the public scope. |
SELECT examples
- get_ipam_pool_cidrs
Get the CIDRs provisioned to an IPAM pool.
SELECT
cidr,
failure_reason,
ipam_pool_cidr_id,
netmask_length,
state
FROM aws.ec2.ipam_pool_cidrs
WHERE IpamPoolId = '{{ IpamPoolId }}' -- required
AND region = '{{ region }}' -- required
AND DryRun = '{{ DryRun }}'
AND Filter = '{{ Filter }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
;
UPDATE examples
- allocate_ipam_pool_cidr
Allocate a CIDR from an IPAM pool. The Region you use should be the IPAM pool locale. The locale is the Amazon Web Services Region where this IPAM pool is available for allocations. In IPAM, an allocation is a CIDR assignment from an IPAM pool to another IPAM pool or to a resource. For more information, see Allocate CIDRs in the Amazon VPC IPAM User Guide. This action creates an allocation with strong consistency. The returned CIDR will not overlap with any other allocations from the same pool.
UPDATE aws.ec2.ipam_pool_cidrs
SET
-- No updatable properties
WHERE
IpamPoolId = '{{ IpamPoolId }}' --required
AND region = '{{ region }}' --required
AND DryRun = {{ DryRun}}
AND Cidr = '{{ Cidr}}'
AND NetmaskLength = '{{ NetmaskLength}}'
AND ClientToken = '{{ ClientToken}}'
AND Description = '{{ Description}}'
AND PreviewNextCidr = {{ PreviewNextCidr}}
AND AllowedCidr = '{{ AllowedCidr}}'
AND DisallowedCidr = '{{ DisallowedCidr}}'
AND TagSpecification = '{{ TagSpecification}}'
RETURNING
cidr,
description,
ipam_pool_allocation_id,
resource_id,
resource_owner,
resource_region,
resource_type,
tags;
Lifecycle Methods
- deprovision_ipam_pool_cidr
- provision_ipam_pool_cidr
Deprovision a CIDR provisioned from an IPAM pool. If you deprovision a CIDR from a pool that has a source pool, the CIDR is recycled back into the source pool. For more information, see Deprovision pool CIDRs in the Amazon VPC IPAM User Guide.
EXEC aws.ec2.ipam_pool_cidrs.deprovision_ipam_pool_cidr
@IpamPoolId='{{ IpamPoolId }}' --required,
@region='{{ region }}' --required,
@DryRun={{ DryRun }},
@Cidr='{{ Cidr }}'
;
Provision a CIDR to an IPAM pool. You can use this action to provision new CIDRs to a top-level pool or to transfer a CIDR from a top-level pool to a pool within it. For more information, see Provision CIDRs to pools in the Amazon VPC IPAM User Guide.
EXEC aws.ec2.ipam_pool_cidrs.provision_ipam_pool_cidr
@IpamPoolId='{{ IpamPoolId }}' --required,
@region='{{ region }}' --required,
@DryRun={{ DryRun }},
@Cidr='{{ Cidr }}',
@CidrAuthorizationContext='{{ CidrAuthorizationContext }}',
@NetmaskLength='{{ NetmaskLength }}',
@ClientToken='{{ ClientToken }}',
@VerificationMethod='{{ VerificationMethod }}',
@IpamExternalResourceVerificationTokenId='{{ IpamExternalResourceVerificationTokenId }}'
;