class PrefixList (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.PrefixList |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#PrefixList |
Java | software.amazon.awscdk.services.ec2.PrefixList |
Python | aws_cdk.aws_ec2.PrefixList |
TypeScript (source) | aws-cdk-lib » aws_ec2 » PrefixList |
Implements
IConstruct
, IDependable
, IResource
, IPrefix
A managed prefix list.
Example
new ec2.PrefixList(this, 'EmptyPrefixList', {
maxEntries: 100,
});
Initializer
new PrefixList(scope: Construct, id: string, props?: PrefixListProps)
Parameters
- scope
Construct
- id
string
- props
Prefix
List Props
Construct Props
Name | Type | Description |
---|---|---|
address | Address | The address family of the prefix list. |
entries? | Entry [] | The list of entries for the prefix list. |
max | number | The maximum number of entries for the prefix list. |
prefix | string | The name of the prefix list. |
addressFamily?
Type:
Address
(optional, default: AddressFamily.IP_V4)
The address family of the prefix list.
entries?
Type:
Entry
[]
(optional, default: [])
The list of entries for the prefix list.
maxEntries?
Type:
number
(optional, default: Automatically-calculated)
The maximum number of entries for the prefix list.
prefixListName?
Type:
string
(optional, default: None)
The name of the prefix list.
Properties
Name | Type | Description |
---|---|---|
address | string | The address family of the prefix list. |
env | Resource | The environment this resource belongs to. |
node | Node | The tree node. |
owner | string | The owner ID of the prefix list. |
prefix | string | The ARN of the prefix list. |
prefix | string | The ID of the prefix list. |
prefix | string | The name of the prefix list. |
stack | Stack | The stack in which this resource is defined. |
version | number | The version of the prefix list. |
addressFamily
Type:
string
The address family of the prefix list.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
node
Type:
Node
The tree node.
ownerId
Type:
string
The owner ID of the prefix list.
prefixListArn
Type:
string
The ARN of the prefix list.
prefixListId
Type:
string
The ID of the prefix list.
prefixListName
Type:
string
The name of the prefix list.
stack
Type:
Stack
The stack in which this resource is defined.
version
Type:
number
The version of the prefix list.
Methods
Name | Description |
---|---|
apply | Apply the given removal policy to this resource. |
to | Returns a string representation of this construct. |
static from | Look up prefix list by id. |
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
Apply the given removal policy to this resource.
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
).
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
PrefixListId(scope, id, prefixListId)
static frompublic static fromPrefixListId(scope: Construct, id: string, prefixListId: string): IPrefixList
Parameters
- scope
Construct
- id
string
- prefixListId
string
Returns
Look up prefix list by id.