Skip to main content

ipam_pool_cidrs

Creates, updates, deletes, gets or lists an ipam_pool_cidrs resource.

Overview

Nameipam_pool_cidrs
TypeResource
Idaws.ec2.ipam_pool_cidrs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
cidrstringThe 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_reasonstringDetails related to why an IPAM pool CIDR failed to be provisioned.
ipam_pool_cidr_idstringThe IPAM pool CIDR ID.
netmask_lengthintegerThe 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.
statestringThe state of the CIDR.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_ipam_pool_cidrsselectIpamPoolId, regionDryRun, Filter, MaxResults, NextTokenGet the CIDRs provisioned to an IPAM pool.
allocate_ipam_pool_cidrupdateIpamPoolId, regionDryRun, Cidr, NetmaskLength, ClientToken, Description, PreviewNextCidr, AllowedCidr, DisallowedCidr, TagSpecificationAllocate 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_cidrexecIpamPoolId, regionDryRun, CidrDeprovision 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_cidrexecIpamPoolId, regionDryRun, Cidr, CidrAuthorizationContext, NetmaskLength, ClientToken, VerificationMethod, IpamExternalResourceVerificationTokenIdProvision 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.

NameDatatypeDescription
IpamPoolIdstringThe ID of the IPAM pool to which you want to assign a CIDR.
regionstringAWS region (default: us-east-1)
AllowedCidrarrayInclude a particular CIDR range that can be returned by the pool. Allowed CIDRs are only allowed if using netmask length for allocation.
CidrstringThe 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.
CidrAuthorizationContextobjectA 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.
ClientTokenstringA unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency.
DescriptionstringA description for the allocation.
DisallowedCidrarrayExclude a particular CIDR range from being returned by the pool. Disallowed CIDRs are only allowed if using netmask length for allocation.
DryRunbooleanA 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.
FilterarrayOne or more filters for the request. For more information about filtering, see Filtering CLI output.
IpamExternalResourceVerificationTokenIdstringVerification token ID. This option only applies to IPv4 and IPv6 pools in the public scope.
MaxResultsintegerThe 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.
NetmaskLengthintegerThe 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.
NextTokenstringThe token for the next page of results.
PreviewNextCidrbooleanA preview of the next available CIDR in a pool.
TagSpecificationarrayThe 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.
VerificationMethodstringThe 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 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 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 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 }}'
;