ipam_resource_cidrs
Creates, updates, deletes, gets or lists an ipam_resource_cidrs resource.
Overview
| Name | ipam_resource_cidrs |
| Type | Resource |
| Id | aws.ec2.ipam_resource_cidrs |
Fields
The following fields are returned by SELECT queries:
- get_ipam_resource_cidrs
| Name | Datatype | Description |
|---|---|---|
availability_zone_id | string | The Availability Zone ID. |
compliance_status | string | The compliance status of the IPAM resource. For more information on compliance statuses, see Monitor CIDR usage by resource in the Amazon VPC IPAM User Guide. |
ip_usage | number | The percentage of IP address space in use. To convert the decimal to a percentage, multiply the decimal by 100. Note the following: For resources that are VPCs, this is the percentage of IP address space in the VPC that's taken up by subnet CIDRs. For resources that are subnets, if the subnet has an IPv4 CIDR provisioned to it, this is the percentage of IPv4 address space in the subnet that's in use. If the subnet has an IPv6 CIDR provisioned to it, the percentage of IPv6 address space in use is not represented. The percentage of IPv6 address space in use cannot currently be calculated. For resources that are public IPv4 pools, this is the percentage of IP address space in the pool that's been allocated to Elastic IP addresses (EIPs). |
ipam_id | string | The IPAM ID for an IPAM resource. |
ipam_pool_id | string | The pool ID for an IPAM resource. |
ipam_scope_id | string | The scope ID for an IPAM resource. |
management_state | string | The management state of the resource. For more information about management states, see Monitor CIDR usage by resource in the Amazon VPC IPAM User Guide. |
overlap_status | string | The overlap status of an IPAM resource. The overlap status tells you if the CIDR for a resource overlaps with another CIDR in the scope. For more information on overlap statuses, see Monitor CIDR usage by resource in the Amazon VPC IPAM User Guide. |
resource_cidr | string | The CIDR for an IPAM resource. |
resource_id | string | The ID of an IPAM resource. |
resource_name | string | The name of an IPAM resource. |
resource_owner_id | string | The Amazon Web Services account number of the owner of an IPAM resource. |
resource_region | string | The Amazon Web Services Region for an IPAM resource. |
resource_tags | string | The tags for an IPAM resource. |
resource_type | string | The type of IPAM resource. |
vpc_id | string | The ID of a VPC. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_ipam_resource_cidrs | select | IpamScopeId, region | DryRun, Filter, MaxResults, NextToken, IpamPoolId, ResourceId, ResourceType, ResourceTag, ResourceOwner | Returns resource CIDRs managed by IPAM in a given scope. If an IPAM is associated with more than one resource discovery, the resource CIDRs across all of the resource discoveries is returned. A resource discovery is an IPAM component that enables IPAM to manage and monitor resources that belong to the owning account. |
modify_ipam_resource_cidr | update | ResourceId, ResourceCidr, ResourceRegion, CurrentIpamScopeId, Monitored, region | DryRun, DestinationIpamScopeId | Modify a resource CIDR. You can use this action to transfer resource CIDRs between scopes and ignore resource CIDRs that you do not want to manage. If set to false, the resource will not be tracked for overlap, it cannot be auto-imported into a pool, and it will be removed from any pool it has an allocation in. For more information, see Move resource CIDRs between scopes and Change the monitoring state of resource CIDRs 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 |
|---|---|---|
CurrentIpamScopeId | string | The ID of the current scope that the resource CIDR is in. |
IpamScopeId | string | The ID of the scope that the resource is in. |
Monitored | boolean | Determines if the resource is monitored by IPAM. If a resource is monitored, the resource is discovered by IPAM and you can view details about the resource’s CIDR. |
ResourceCidr | string | The CIDR of the resource you want to modify. |
ResourceId | string | The ID of the resource you want to modify. |
ResourceRegion | string | The Amazon Web Services Region of the resource you want to modify. |
region | string | AWS region (default: us-east-1) |
DestinationIpamScopeId | string | The ID of the scope you want to transfer the resource CIDR to. |
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. |
IpamPoolId | string | The ID of the IPAM pool that the resource is in. |
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. |
NextToken | string | The token for the next page of results. |
ResourceId | string | The ID of the resource. |
ResourceOwner | string | The ID of the Amazon Web Services account that owns the resource. |
ResourceTag | object | The resource tag. |
ResourceType | string | The resource type. |
SELECT examples
- get_ipam_resource_cidrs
Returns resource CIDRs managed by IPAM in a given scope. If an IPAM is associated with more than one resource discovery, the resource CIDRs across all of the resource discoveries is returned. A resource discovery is an IPAM component that enables IPAM to manage and monitor resources that belong to the owning account.
SELECT
availability_zone_id,
compliance_status,
ip_usage,
ipam_id,
ipam_pool_id,
ipam_scope_id,
management_state,
overlap_status,
resource_cidr,
resource_id,
resource_name,
resource_owner_id,
resource_region,
resource_tags,
resource_type,
vpc_id
FROM aws.ec2.ipam_resource_cidrs
WHERE IpamScopeId = '{{ IpamScopeId }}' -- required
AND region = '{{ region }}' -- required
AND DryRun = '{{ DryRun }}'
AND Filter = '{{ Filter }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
AND IpamPoolId = '{{ IpamPoolId }}'
AND ResourceId = '{{ ResourceId }}'
AND ResourceType = '{{ ResourceType }}'
AND ResourceTag = '{{ ResourceTag }}'
AND ResourceOwner = '{{ ResourceOwner }}'
;
UPDATE examples
- modify_ipam_resource_cidr
Modify a resource CIDR. You can use this action to transfer resource CIDRs between scopes and ignore resource CIDRs that you do not want to manage. If set to false, the resource will not be tracked for overlap, it cannot be auto-imported into a pool, and it will be removed from any pool it has an allocation in. For more information, see Move resource CIDRs between scopes and Change the monitoring state of resource CIDRs in the Amazon VPC IPAM User Guide.
UPDATE aws.ec2.ipam_resource_cidrs
SET
-- No updatable properties
WHERE
ResourceId = '{{ ResourceId }}' --required
AND ResourceCidr = '{{ ResourceCidr }}' --required
AND ResourceRegion = '{{ ResourceRegion }}' --required
AND CurrentIpamScopeId = '{{ CurrentIpamScopeId }}' --required
AND Monitored = '{{ Monitored }}' --required
AND region = '{{ region }}' --required
AND DryRun = {{ DryRun}}
AND DestinationIpamScopeId = '{{ DestinationIpamScopeId}}'
RETURNING
availability_zone_id,
compliance_status,
ip_usage,
ipam_id,
ipam_pool_id,
ipam_scope_id,
management_state,
overlap_status,
resource_cidr,
resource_id,
resource_name,
resource_owner_id,
resource_region,
resource_tags,
resource_type,
vpc_id;