aws-cdk-lib.aws_ec2.CfnIPAMPool

class CfnIPAMPool (construct)

LanguageType name
.NETAmazon.CDK.AWS.EC2.CfnIPAMPool
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsec2#CfnIPAMPool
Javasoftware.amazon.awscdk.services.ec2.CfnIPAMPool
Pythonaws_cdk.aws_ec2.CfnIPAMPool
TypeScript aws-cdk-lib » aws_ec2 » CfnIPAMPool

Implements IConstruct, IDependable, IInspectable

A CloudFormation AWS::EC2::IPAMPool.

In IPAM, a pool is a collection of contiguous IP addresses CIDRs. Pools enable you to organize your IP addresses according to your routing and security needs. For example, if you have separate routing and security needs for development and production applications, you can create a pool for each.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const cfnIPAMPool = new ec2.CfnIPAMPool(this, 'MyCfnIPAMPool', {
  addressFamily: 'addressFamily',
  ipamScopeId: 'ipamScopeId',

  // the properties below are optional
  allocationDefaultNetmaskLength: 123,
  allocationMaxNetmaskLength: 123,
  allocationMinNetmaskLength: 123,
  allocationResourceTags: [{
    key: 'key',
    value: 'value',
  }],
  autoImport: false,
  awsService: 'awsService',
  description: 'description',
  locale: 'locale',
  provisionedCidrs: [{
    cidr: 'cidr',
  }],
  publicIpSource: 'publicIpSource',
  publiclyAdvertisable: false,
  sourceIpamPoolId: 'sourceIpamPoolId',
  tags: [{
    key: 'key',
    value: 'value',
  }],
});

Initializer

new CfnIPAMPool(scope: Construct, id: string, props: CfnIPAMPoolProps)

Parameters

  • scope Construct — - scope in which this resource is defined.
  • id string — - scoped id of the resource.
  • props CfnIPAMPoolProps — - resource properties.

Create a new AWS::EC2::IPAMPool.

Construct Props

NameTypeDescription
addressFamilystringThe address family of the pool.
ipamScopeIdstringThe ID of the scope in which you would like to create the IPAM pool.
allocationDefaultNetmaskLength?numberThe default netmask length for allocations added to this pool.
allocationMaxNetmaskLength?numberThe maximum netmask length possible for CIDR allocations in this IPAM pool to be compliant.
allocationMinNetmaskLength?numberThe minimum netmask length required for CIDR allocations in this IPAM pool to be compliant.
allocationResourceTags?IResolvable | IResolvable | CfnTag[]Tags that are required for resources that use CIDRs from this IPAM pool.
autoImport?boolean | IResolvableIf selected, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM.
awsService?stringLimits which service in AWS that the pool can be used in.
description?stringThe description of the IPAM pool.
locale?stringThe locale of the IPAM pool.
provisionedCidrs?IResolvable | IResolvable | ProvisionedCidrProperty[]Information about the CIDRs provisioned to an IPAM pool.
publicIpSource?stringThe IP address source for pools in the public scope.
publiclyAdvertisable?boolean | IResolvableDetermines if a pool is publicly advertisable.
sourceIpamPoolId?stringThe ID of the source IPAM pool.
tags?CfnTag[]The key/value combination of a tag assigned to the resource.

addressFamily

Type: string

The address family of the pool.


ipamScopeId

Type: string

The ID of the scope in which you would like to create the IPAM pool.


allocationDefaultNetmaskLength?

Type: number (optional)

The default netmask length for allocations added to this pool.

If, for example, the CIDR assigned to this pool is 10.0.0.0/8 and you enter 16 here, new allocations will default to 10.0.0.0/16.


allocationMaxNetmaskLength?

Type: number (optional)

The maximum netmask length possible for CIDR allocations in this IPAM pool to be compliant.

The maximum netmask length must be greater than the minimum netmask length. Possible netmask lengths for IPv4 addresses are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128.


allocationMinNetmaskLength?

Type: number (optional)

The minimum netmask length required for CIDR allocations in this IPAM pool to be compliant.

The minimum netmask length must be less than the maximum netmask length. Possible netmask lengths for IPv4 addresses are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128.


allocationResourceTags?

Type: IResolvable | IResolvable | CfnTag[] (optional)

Tags that are required for resources that use CIDRs from this IPAM pool.

Resources that do not have these tags will not be allowed to allocate space from the pool. If the resources have their tags changed after they have allocated space or if the allocation tagging requirements are changed on the pool, the resource may be marked as noncompliant.


autoImport?

Type: boolean | IResolvable (optional)

If selected, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM.

The CIDRs that will be allocated for these resources must not already be allocated to other resources in order for the import to succeed. IPAM will import a CIDR regardless of its compliance with the pool's allocation rules, so a resource might be imported and subsequently marked as noncompliant. If IPAM discovers multiple CIDRs that overlap, IPAM will import the largest CIDR only. If IPAM discovers multiple CIDRs with matching CIDRs, IPAM will randomly import one of them only.

A locale must be set on the pool for this feature to work.


awsService?

Type: string (optional)

Limits which service in AWS that the pool can be used in.

"ec2", for example, allows users to use space for Elastic IP addresses and VPCs.


description?

Type: string (optional)

The description of the IPAM pool.


locale?

Type: string (optional)

The locale of the IPAM pool.

In IPAM, the locale is the AWS Region where you want to make an IPAM pool available for allocations. Only resources in the same Region as the locale of the pool can get IP address allocations from the pool. You can only allocate a CIDR for a VPC, for example, from an IPAM pool that shares a locale with the VPC’s Region. Note that once you choose a Locale for a pool, you cannot modify it. If you choose an AWS Region for locale that has not been configured as an operating Region for the IPAM, you'll get an error.


provisionedCidrs?

Type: IResolvable | IResolvable | ProvisionedCidrProperty[] (optional)

Information about the CIDRs provisioned to an IPAM pool.


publicIpSource?

Type: string (optional)

The IP address source for pools in the public scope.

Only used for provisioning IP address CIDRs to pools in the public scope. Default is BYOIP . For more information, see Create IPv6 pools in the Amazon VPC IPAM User Guide . By default, you can add only one Amazon-provided IPv6 CIDR block to a top-level IPv6 pool. For information on increasing the default limit, see Quotas for your IPAM in the Amazon VPC IPAM User Guide .


publiclyAdvertisable?

Type: boolean | IResolvable (optional)

Determines if a pool is publicly advertisable.

This option is not available for pools with AddressFamily set to ipv4 .


sourceIpamPoolId?

Type: string (optional)

The ID of the source IPAM pool.

You can use this option to create an IPAM pool within an existing source pool.


tags?

Type: CfnTag[] (optional)

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.

Properties

NameTypeDescription
addressFamilystringThe address family of the pool.
attrArnstringThe ARN of the IPAM pool.
attrIpamArnstringThe ARN of the IPAM.
attrIpamPoolIdstringThe ID of the IPAM pool.
attrIpamScopeArnstringThe ARN of the scope of the IPAM pool.
attrIpamScopeTypestringThe scope of the IPAM.
attrPoolDepthnumberThe depth of pools in your IPAM pool.
attrStatestringThe state of the IPAM pool.
attrStateMessagestringA message related to the failed creation of an IPAM pool.
cfnOptionsICfnResourceOptionsOptions for this resource, such as condition, update policy etc.
cfnProperties{ [string]: any }
cfnResourceTypestringAWS resource type.
creationStackstring[]
ipamScopeIdstringThe ID of the scope in which you would like to create the IPAM pool.
logicalIdstringThe logical ID for this CloudFormation stack element.
nodeNodeThe tree node.
refstringReturn a string that will be resolved to a CloudFormation { Ref } for this element.
stackStackThe stack in which this element is defined.
tagsTagManagerThe key/value combination of a tag assigned to the resource.
allocationDefaultNetmaskLength?numberThe default netmask length for allocations added to this pool.
allocationMaxNetmaskLength?numberThe maximum netmask length possible for CIDR allocations in this IPAM pool to be compliant.
allocationMinNetmaskLength?numberThe minimum netmask length required for CIDR allocations in this IPAM pool to be compliant.
allocationResourceTags?IResolvable | IResolvable | CfnTag[]Tags that are required for resources that use CIDRs from this IPAM pool.
autoImport?boolean | IResolvableIf selected, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM.
awsService?stringLimits which service in AWS that the pool can be used in.
description?stringThe description of the IPAM pool.
locale?stringThe locale of the IPAM pool.
provisionedCidrs?IResolvable | IResolvable | ProvisionedCidrProperty[]Information about the CIDRs provisioned to an IPAM pool.
publicIpSource?stringThe IP address source for pools in the public scope.
publiclyAdvertisable?boolean | IResolvableDetermines if a pool is publicly advertisable.
sourceIpamPoolId?stringThe ID of the source IPAM pool.
static CFN_RESOURCE_TYPE_NAMEstringThe CloudFormation resource type name for this resource class.

addressFamily

Type: string

The address family of the pool.


attrArn

Type: string

The ARN of the IPAM pool.


attrIpamArn

Type: string

The ARN of the IPAM.


attrIpamPoolId

Type: string

The ID of the IPAM pool.


attrIpamScopeArn

Type: string

The ARN of the scope of the IPAM pool.


attrIpamScopeType

Type: string

The scope of the IPAM.


attrPoolDepth

Type: number

The depth of pools in your IPAM pool.

The pool depth quota is 10.


attrState

Type: string

The state of the IPAM pool.


attrStateMessage

Type: string

A message related to the failed creation of an IPAM pool.


cfnOptions

Type: ICfnResourceOptions

Options for this resource, such as condition, update policy etc.


cfnProperties

Type: { [string]: any }


cfnResourceType

Type: string

AWS resource type.


creationStack

Type: string[]


ipamScopeId

Type: string

The ID of the scope in which you would like to create the IPAM pool.


logicalId

Type: string

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).


node

Type: Node

The tree node.


ref

Type: string

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).


stack

Type: Stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).


tags

Type: TagManager

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.


allocationDefaultNetmaskLength?

Type: number (optional)

The default netmask length for allocations added to this pool.

If, for example, the CIDR assigned to this pool is 10.0.0.0/8 and you enter 16 here, new allocations will default to 10.0.0.0/16.


allocationMaxNetmaskLength?

Type: number (optional)

The maximum netmask length possible for CIDR allocations in this IPAM pool to be compliant.

The maximum netmask length must be greater than the minimum netmask length. Possible netmask lengths for IPv4 addresses are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128.


allocationMinNetmaskLength?

Type: number (optional)

The minimum netmask length required for CIDR allocations in this IPAM pool to be compliant.

The minimum netmask length must be less than the maximum netmask length. Possible netmask lengths for IPv4 addresses are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128.


allocationResourceTags?

Type: IResolvable | IResolvable | CfnTag[] (optional)

Tags that are required for resources that use CIDRs from this IPAM pool.

Resources that do not have these tags will not be allowed to allocate space from the pool. If the resources have their tags changed after they have allocated space or if the allocation tagging requirements are changed on the pool, the resource may be marked as noncompliant.


autoImport?

Type: boolean | IResolvable (optional)

If selected, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM.

The CIDRs that will be allocated for these resources must not already be allocated to other resources in order for the import to succeed. IPAM will import a CIDR regardless of its compliance with the pool's allocation rules, so a resource might be imported and subsequently marked as noncompliant. If IPAM discovers multiple CIDRs that overlap, IPAM will import the largest CIDR only. If IPAM discovers multiple CIDRs with matching CIDRs, IPAM will randomly import one of them only.

A locale must be set on the pool for this feature to work.


awsService?

Type: string (optional)

Limits which service in AWS that the pool can be used in.

"ec2", for example, allows users to use space for Elastic IP addresses and VPCs.


description?

Type: string (optional)

The description of the IPAM pool.


locale?

Type: string (optional)

The locale of the IPAM pool.

In IPAM, the locale is the AWS Region where you want to make an IPAM pool available for allocations. Only resources in the same Region as the locale of the pool can get IP address allocations from the pool. You can only allocate a CIDR for a VPC, for example, from an IPAM pool that shares a locale with the VPC’s Region. Note that once you choose a Locale for a pool, you cannot modify it. If you choose an AWS Region for locale that has not been configured as an operating Region for the IPAM, you'll get an error.


provisionedCidrs?

Type: IResolvable | IResolvable | ProvisionedCidrProperty[] (optional)

Information about the CIDRs provisioned to an IPAM pool.


publicIpSource?

Type: string (optional)

The IP address source for pools in the public scope.

Only used for provisioning IP address CIDRs to pools in the public scope. Default is BYOIP . For more information, see Create IPv6 pools in the Amazon VPC IPAM User Guide . By default, you can add only one Amazon-provided IPv6 CIDR block to a top-level IPv6 pool. For information on increasing the default limit, see Quotas for your IPAM in the Amazon VPC IPAM User Guide .


publiclyAdvertisable?

Type: boolean | IResolvable (optional)

Determines if a pool is publicly advertisable.

This option is not available for pools with AddressFamily set to ipv4 .


sourceIpamPoolId?

Type: string (optional)

The ID of the source IPAM pool.

You can use this option to create an IPAM pool within an existing source pool.


static CFN_RESOURCE_TYPE_NAME

Type: string

The CloudFormation resource type name for this resource class.

Methods

NameDescription
addDeletionOverride(path)Syntactic sugar for addOverride(path, undefined).
addDependency(target)Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
addDependsOn(target)⚠️Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
addMetadata(key, value)Add a value to the CloudFormation Resource Metadata.
addOverride(path, value)Adds an override to the synthesized CloudFormation resource.
addPropertyDeletionOverride(propertyPath)Adds an override that deletes the value of a property from the resource definition.
addPropertyOverride(propertyPath, value)Adds an override to a resource property.
applyRemovalPolicy(policy?, options?)Sets the deletion policy of the resource based on the removal policy specified.
getAtt(attributeName, typeHint?)Returns a token for an runtime attribute of this resource.
getMetadata(key)Retrieve a value value from the CloudFormation Resource Metadata.
inspect(inspector)Examines the CloudFormation resource and discloses attributes.
obtainDependencies()Retrieves an array of resources this resource depends on.
obtainResourceDependencies()Get a shallow copy of dependencies between this resource and other resources in the same stack.
overrideLogicalId(newLogicalId)Overrides the auto-generated logical ID with a specific ID.
removeDependency(target)Indicates that this resource no longer depends on another resource.
replaceDependency(target, newTarget)Replaces one dependency with another.
toString()Returns a string representation of this construct.
protected renderProperties(props)

addDeletionOverride(path)

public addDeletionOverride(path: string): void

Parameters

  • path string — The path of the value to delete.

Syntactic sugar for addOverride(path, undefined).


addDependency(target)

public addDependency(target: CfnResource): void

Parameters

  • target CfnResource

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.


addDependsOn(target)⚠️

public addDependsOn(target: CfnResource): void

⚠️ Deprecated: use addDependency

Parameters

  • target CfnResource

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.


addMetadata(key, value)

public addMetadata(key: string, value: any): void

Parameters

  • key string
  • value any

Add a value to the CloudFormation Resource Metadata.

See also: [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.)


addOverride(path, value)

public addOverride(path: string, value: any): void

Parameters

  • path string — - The path of the property, you can use dot notation to override values in complex types.
  • value any — - The value.

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with "Properties." (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example,

cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');

would add the overrides

"Properties": {
  "GlobalSecondaryIndexes": [
    {
      "Projection": {
        "NonKeyAttributes": [ "myattribute" ]
        ...
      }
      ...
    },
    {
      "ProjectionType": "INCLUDE"
      ...
    },
  ]
  ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.


addPropertyDeletionOverride(propertyPath)

public addPropertyDeletionOverride(propertyPath: string): void

Parameters

  • propertyPath string — The path to the property.

Adds an override that deletes the value of a property from the resource definition.


addPropertyOverride(propertyPath, value)

public addPropertyOverride(propertyPath: string, value: any): void

Parameters

  • propertyPath string — The path of the property.
  • value any — The value.

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).


applyRemovalPolicy(policy?, options?)

public applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void

Parameters

  • policy RemovalPolicy
  • options RemovalPolicyOptions

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:

See also: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options


getAtt(attributeName, typeHint?)

public getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Reference

Parameters

  • attributeName string — The name of the attribute.
  • typeHint ResolutionTypeHint

Returns

  • Reference

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.


getMetadata(key)

public getMetadata(key: string): any

Parameters

  • key string

Returns

  • any

Retrieve a value value from the CloudFormation Resource Metadata.

See also: [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.)


inspect(inspector)

public inspect(inspector: TreeInspector): void

Parameters

  • inspector TreeInspector — - tree inspector to collect and process attributes.

Examines the CloudFormation resource and discloses attributes.


obtainDependencies()

public obtainDependencies(): Stack &#124; CfnResource[]

Returns

  • Stack | CfnResource[]

Retrieves an array of resources this resource depends on.

This assembles dependencies on resources across stacks (including nested stacks) automatically.


obtainResourceDependencies()

public obtainResourceDependencies(): CfnResource[]

Returns

  • CfnResource[]

Get a shallow copy of dependencies between this resource and other resources in the same stack.


overrideLogicalId(newLogicalId)

public overrideLogicalId(newLogicalId: string): void

Parameters

  • newLogicalId string — The new logical ID to use for this stack element.

Overrides the auto-generated logical ID with a specific ID.


removeDependency(target)

public removeDependency(target: CfnResource): void

Parameters

  • target CfnResource

Indicates that this resource no longer depends on another resource.

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.


replaceDependency(target, newTarget)

public replaceDependency(target: CfnResource, newTarget: CfnResource): void

Parameters

  • target CfnResource — The dependency to replace.
  • newTarget CfnResource — The new dependency to add.

Replaces one dependency with another.


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.


protected renderProperties(props)

protected renderProperties(props: { [string]: any }): { [string]: any }

Parameters

  • props { [string]: any }

Returns

  • { [string]: any }