Skip to content

EC2  >  Operations  >  create_ipam_policy

create_ipam_policy

Operation

create_ipam_policy async

create_ipam_policy(input: CreateIpamPolicyInput, plugins: list[Plugin] | None = None) -> CreateIpamPolicyOutput

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.

Parameters:

Name Type Description Default
input CreateIpamPolicyInput

An instance of CreateIpamPolicyInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
CreateIpamPolicyOutput

An instance of CreateIpamPolicyOutput.

Input

CreateIpamPolicyInput dataclass

Bases: _SerdeShape

Dataclass for CreateIpamPolicyInput structure.

Attributes

client_token class-attribute instance-attribute
client_token: str | None = ...

A unique, case-sensitive identifier to ensure the idempotency of the request.

This field is autopopulated if not provided.

dry_run class-attribute instance-attribute
dry_run: bool | None = ...

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.

ipam_id class-attribute instance-attribute
ipam_id: str | None = ...

The ID of the IPAM for which you're creating the policy.

tag_specifications class-attribute instance-attribute
tag_specifications: list[TagSpecification] | None = ...

The tags to assign to the IPAM policy.

Output

CreateIpamPolicyOutput dataclass

Bases: _SerdeShape

Dataclass for CreateIpamPolicyOutput structure.

Attributes

ipam_policy class-attribute instance-attribute
ipam_policy: IpamPolicy | None = ...

Information about the created 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.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.