class CfnIPAMPool (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.CfnIPAMPool |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#CfnIPAMPool |
Java | software.amazon.awscdk.services.ec2.CfnIPAMPool |
Python | aws_cdk.aws_ec2.CfnIPAMPool |
TypeScript | aws-cdk-lib » aws_ec2 » CfnIPAMPool |
Implements
IConstruct
, IDependable
, IInspectable
, ITaggable
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.
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-ipampool.html
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',
sourceResource: {
resourceId: 'resourceId',
resourceOwner: 'resourceOwner',
resourceRegion: 'resourceRegion',
resourceType: 'resourceType',
},
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
— Construct identifier for this resource (unique in its scope). - props
Cfn
— Resource properties.IPAMPool Props
Construct Props
Name | Type | Description |
---|---|---|
address | string | The address family of the pool. |
ipam | string | The ID of the scope in which you would like to create the IPAM pool. |
allocation | number | The default netmask length for allocations added to this pool. |
allocation | number | The maximum netmask length possible for CIDR allocations in this IPAM pool to be compliant. |
allocation | number | The minimum netmask length required for CIDR allocations in this IPAM pool to be compliant. |
allocation | IResolvable | IResolvable | Cfn [] | Tags that are required for resources that use CIDRs from this IPAM pool. |
auto | boolean | IResolvable | If selected, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM. |
aws | string | Limits which service in AWS that the pool can be used in. |
description? | string | The description of the IPAM pool. |
locale? | string | The locale of the IPAM pool. |
provisioned | IResolvable | IResolvable | Provisioned [] | Information about the CIDRs provisioned to an IPAM pool. |
public | string | The IP address source for pools in the public scope. |
publicly | boolean | IResolvable | Determines if a pool is publicly advertisable. |
source | string | The ID of the source IPAM pool. |
source | IResolvable | Source | The resource used to provision CIDRs to a resource planning pool. |
tags? | Cfn [] | 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
|
Cfn
[]
(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.
The locale for the pool should be one of the following:
- An AWS Region where you want this IPAM pool to be available for allocations.
- The network border group for an AWS Local Zone where you want this IPAM pool to be available for allocations ( supported Local Zones ). This option is only available for IPAM IPv4 pools in the public scope.
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
|
Provisioned
[]
(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.
sourceResource?
Type:
IResolvable
|
Source
(optional)
The resource used to provision CIDRs to a resource planning pool.
tags?
Type:
Cfn
[]
(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
Name | Type | Description |
---|---|---|
address | string | The address family of the pool. |
attr | string | The ARN of the IPAM pool. |
attr | string | The ARN of the IPAM. |
attr | string | The ID of the IPAM pool. |
attr | string | The ARN of the scope of the IPAM pool. |
attr | string | The scope of the IPAM. |
attr | number | The depth of pools in your IPAM pool. |
attr | string | The state of the IPAM pool. |
attr | string | A message related to the failed creation of an IPAM pool. |
cfn | ICfn | Options for this resource, such as condition, update policy etc. |
cfn | { [string]: any } | |
cfn | string | AWS resource type. |
creation | string[] | |
ipam | string | The ID of the scope in which you would like to create the IPAM pool. |
logical | string | The logical ID for this CloudFormation stack element. |
node | Node | The tree node. |
ref | string | Return a string that will be resolved to a CloudFormation { Ref } for this element. |
stack | Stack | The stack in which this element is defined. |
tags | Tag | Tag Manager which manages the tags for this resource. |
allocation | number | The default netmask length for allocations added to this pool. |
allocation | number | The maximum netmask length possible for CIDR allocations in this IPAM pool to be compliant. |
allocation | number | The minimum netmask length required for CIDR allocations in this IPAM pool to be compliant. |
allocation | IResolvable | IResolvable | Cfn [] | Tags that are required for resources that use CIDRs from this IPAM pool. |
auto | boolean | IResolvable | If selected, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM. |
aws | string | Limits which service in AWS that the pool can be used in. |
description? | string | The description of the IPAM pool. |
locale? | string | The locale of the IPAM pool. |
provisioned | IResolvable | IResolvable | Provisioned [] | Information about the CIDRs provisioned to an IPAM pool. |
public | string | The IP address source for pools in the public scope. |
publicly | boolean | IResolvable | Determines if a pool is publicly advertisable. |
source | string | The ID of the source IPAM pool. |
source | IResolvable | Source | The resource used to provision CIDRs to a resource planning pool. |
tags | Cfn [] | The key/value combination of a tag assigned to the resource. |
static CFN_RESOURCE_TYPE_NAME | string | The 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:
ICfn
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:
Tag
Tag Manager which manages the tags for this resource.
allocationDefaultNetmaskLength?
Type:
number
(optional)
The default netmask length for allocations added to this pool.
allocationMaxNetmaskLength?
Type:
number
(optional)
The maximum netmask length possible for CIDR allocations in this IPAM pool to be compliant.
allocationMinNetmaskLength?
Type:
number
(optional)
The minimum netmask length required for CIDR allocations in this IPAM pool to be compliant.
allocationResourceTags?
Type:
IResolvable
|
IResolvable
|
Cfn
[]
(optional)
Tags that are required for resources that use CIDRs from this IPAM pool.
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.
awsService?
Type:
string
(optional)
Limits which service in AWS that the pool can be used in.
description?
Type:
string
(optional)
The description of the IPAM pool.
locale?
Type:
string
(optional)
The locale of the IPAM pool.
provisionedCidrs?
Type:
IResolvable
|
IResolvable
|
Provisioned
[]
(optional)
Information about the CIDRs provisioned to an IPAM pool.
publicIpSource?
Type:
string
(optional)
The IP address source for pools in the public scope.
publiclyAdvertisable?
Type:
boolean |
IResolvable
(optional)
Determines if a pool is publicly advertisable.
sourceIpamPoolId?
Type:
string
(optional)
The ID of the source IPAM pool.
sourceResource?
Type:
IResolvable
|
Source
(optional)
The resource used to provision CIDRs to a resource planning pool.
tagsRaw?
Type:
Cfn
[]
(optional)
The key/value combination of a tag assigned to the resource.
static CFN_RESOURCE_TYPE_NAME
Type:
string
The CloudFormation resource type name for this resource class.
Methods
Name | Description |
---|---|
add | Syntactic sugar for addOverride(path, undefined) . |
add | Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
add | Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
add | Add a value to the CloudFormation Resource Metadata. |
add | Adds an override to the synthesized CloudFormation resource. |
add | Adds an override that deletes the value of a property from the resource definition. |
add | Adds an override to a resource property. |
apply | Sets the deletion policy of the resource based on the removal policy specified. |
get | Returns a token for an runtime attribute of this resource. |
get | Retrieve a value value from the CloudFormation Resource Metadata. |
inspect(inspector) | Examines the CloudFormation resource and discloses attributes. |
obtain | Retrieves an array of resources this resource depends on. |
obtain | Get a shallow copy of dependencies between this resource and other resources in the same stack. |
override | Overrides the auto-generated logical ID with a specific ID. |
remove | Indicates that this resource no longer depends on another resource. |
replace | Replaces one dependency with another. |
to | Returns a string representation of this construct. |
protected render |
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
Cfn
Resource
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
Cfn
Resource
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.
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
Removal
Policy - options
Removal
Policy Options
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:
getAtt(attributeName, typeHint?)
public getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Reference
Parameters
- attributeName
string
— The name of the attribute. - typeHint
Resolution
Type Hint
Returns
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.
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
Tree
— tree inspector to collect and process attributes.Inspector
Examines the CloudFormation resource and discloses attributes.
obtainDependencies()
public obtainDependencies(): Stack | CfnResource[]
Returns
Stack
|
Cfn
Resource []
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
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
Cfn
Resource
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
Cfn
— The dependency to replace.Resource - newTarget
Cfn
— The new dependency to add.Resource
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 }