Skip to main content

ipam_policies

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

Overview

Nameipam_policies
TypeResource
Idaws.ec2.ipam_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
ipam_idstringThe ID of the IPAM this policy belongs to.
ipam_policy_arnstringThe Amazon Resource Name (ARN) of the IPAM policy.
ipam_policy_idstringThe ID of the IPAM policy.
ipam_policy_regionstringThe Region of the IPAM policy.
owner_idstringThe account ID that owns the IPAM policy.
statestringThe state of the IPAM policy.
state_messagestringA message about the state of the IPAM policy.
tagsstringThe tags assigned to the IPAM policy.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_ipam_policiesselectregionDryRun, Filter, MaxResults, NextToken, IpamPolicyIdDescribes one or more IPAM policies. An IPAM policy is a set of rules that define how public IPv4 addresses from IPAM pools are allocated to Amazon Web Services resources. Each rule maps an Amazon Web Services service to IPAM pools that the service will use to get IP addresses. A single policy can have multiple rules and be applied to multiple Amazon Web Services Regions. If the IPAM pool run out of addresses then the services fallback to Amazon-provided IP addresses. A policy can be applied to an individual Amazon Web Services account or an entity within Amazon Web Services Organizations.
create_ipam_policyinsertIpamId, regionDryRun, TagSpecification, ClientTokenCreates an IPAM policy. An IPAM policy is a set of rules that define how public IPv4 addresses from IPAM pools are allocated to Amazon Web Services resources. Each rule maps an Amazon Web Services service to IPAM pools that the service will use to get IP addresses. A single policy can have multiple rules and be applied to multiple Amazon Web Services Regions. If the IPAM pool run out of addresses then the services fallback to Amazon-provided IP addresses. A policy can be applied to an individual Amazon Web Services account or an entity within Amazon Web Services Organizations. For more information, see Define public IPv4 allocation strategy with IPAM policies in the Amazon VPC IPAM User Guide.
delete_ipam_policydeleteIpamPolicyId, regionDryRunDeletes an IPAM policy. An IPAM policy is a set of rules that define how public IPv4 addresses from IPAM pools are allocated to Amazon Web Services resources. Each rule maps an Amazon Web Services service to IPAM pools that the service will use to get IP addresses. A single policy can have multiple rules and be applied to multiple Amazon Web Services Regions. If the IPAM pool run out of addresses then the services fallback to Amazon-provided IP addresses. A policy can be applied to an individual Amazon Web Services account or an entity within Amazon Web Services Organizations.

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
IpamIdstringThe ID of the IPAM for which you're creating the policy.
IpamPolicyIdstringThe ID of the IPAM policy to delete.
regionstringAWS region (default: us-east-1)
ClientTokenstringA unique, case-sensitive identifier to ensure the idempotency of the request.
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 IPAM policy description.
IpamPolicyIdarrayThe IDs of the IPAM policies to describe.
MaxResultsintegerThe maximum number of results to return in a single call.
NextTokenstringThe token for the next page of results.
TagSpecificationarrayThe tags to assign to the IPAM policy.

SELECT examples

Describes one or more IPAM policies. An IPAM policy is a set of rules that define how public IPv4 addresses from IPAM pools are allocated to Amazon Web Services resources. Each rule maps an Amazon Web Services service to IPAM pools that the service will use to get IP addresses. A single policy can have multiple rules and be applied to multiple Amazon Web Services Regions. If the IPAM pool run out of addresses then the services fallback to Amazon-provided IP addresses. A policy can be applied to an individual Amazon Web Services account or an entity within Amazon Web Services Organizations.

SELECT
ipam_id,
ipam_policy_arn,
ipam_policy_id,
ipam_policy_region,
owner_id,
state,
state_message,
tags
FROM aws.ec2.ipam_policies
WHERE region = '{{ region }}' -- required
AND DryRun = '{{ DryRun }}'
AND Filter = '{{ Filter }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
AND IpamPolicyId = '{{ IpamPolicyId }}'
;

INSERT examples

Creates an IPAM policy. An IPAM policy is a set of rules that define how public IPv4 addresses from IPAM pools are allocated to Amazon Web Services resources. Each rule maps an Amazon Web Services service to IPAM pools that the service will use to get IP addresses. A single policy can have multiple rules and be applied to multiple Amazon Web Services Regions. If the IPAM pool run out of addresses then the services fallback to Amazon-provided IP addresses. A policy can be applied to an individual Amazon Web Services account or an entity within Amazon Web Services Organizations. For more information, see Define public IPv4 allocation strategy with IPAM policies in the Amazon VPC IPAM User Guide.

INSERT INTO aws.ec2.ipam_policies (
IpamId,
region,
DryRun,
TagSpecification,
ClientToken
)
SELECT
'{{ IpamId }}',
'{{ region }}',
'{{ DryRun }}',
'{{ TagSpecification }}',
'{{ ClientToken }}'
RETURNING
ipam_id,
ipam_policy_arn,
ipam_policy_id,
ipam_policy_region,
owner_id,
state,
state_message,
tags
;

DELETE examples

Deletes an IPAM policy. An IPAM policy is a set of rules that define how public IPv4 addresses from IPAM pools are allocated to Amazon Web Services resources. Each rule maps an Amazon Web Services service to IPAM pools that the service will use to get IP addresses. A single policy can have multiple rules and be applied to multiple Amazon Web Services Regions. If the IPAM pool run out of addresses then the services fallback to Amazon-provided IP addresses. A policy can be applied to an individual Amazon Web Services account or an entity within Amazon Web Services Organizations.

DELETE FROM aws.ec2.ipam_policies
WHERE IpamPolicyId = '{{ IpamPolicyId }}' --required
AND region = '{{ region }}' --required
AND DryRun = '{{ DryRun }}'
;