aws-cdk-lib.aws_ec2.SubnetNetworkAclAssociation

class SubnetNetworkAclAssociation (construct)

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

Implements IConstruct, IDependable, IResource, ISubnetNetworkAclAssociation

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';

declare const networkAcl: ec2.NetworkAcl;
declare const subnet: ec2.Subnet;
const subnetNetworkAclAssociation = new ec2.SubnetNetworkAclAssociation(this, 'MySubnetNetworkAclAssociation', {
  networkAcl: networkAcl,
  subnet: subnet,

  // the properties below are optional
  subnetNetworkAclAssociationName: 'subnetNetworkAclAssociationName',
});

Initializer

new SubnetNetworkAclAssociation(scope: Construct, id: string, props: SubnetNetworkAclAssociationProps)

Parameters

  • scope Construct
  • id string
  • props SubnetNetworkAclAssociationProps

Construct Props

NameTypeDescription
networkAclINetworkAclThe Network ACL this association is defined for.
subnetISubnetID of the Subnet.
subnetNetworkAclAssociationName?stringThe name of the SubnetNetworkAclAssociation.

networkAcl

Type: INetworkAcl

The Network ACL this association is defined for.


subnet

Type: ISubnet

ID of the Subnet.


subnetNetworkAclAssociationName?

Type: string (optional, default: If you don't specify a SubnetNetworkAclAssociationName, AWS CloudFormation generates a unique physical ID and uses that ID for the group name.)

The name of the SubnetNetworkAclAssociation.

It is not recommended to use an explicit name.

Properties

NameTypeDescription
envResourceEnvironmentThe environment this resource belongs to.
networkAclINetworkAclID for the current Network ACL.
nodeNodeThe tree node.
stackStackThe stack in which this resource is defined.
subnetISubnetID of the Subnet.
subnetNetworkAclAssociationAssociationIdstringID for the current SubnetNetworkAclAssociation.

env

Type: ResourceEnvironment

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.


networkAcl

Type: INetworkAcl

ID for the current Network ACL.


node

Type: Node

The tree node.


stack

Type: Stack

The stack in which this resource is defined.


subnet

Type: ISubnet

ID of the Subnet.


subnetNetworkAclAssociationAssociationId

Type: string

ID for the current SubnetNetworkAclAssociation.

Methods

NameDescription
applyRemovalPolicy(policy)Apply the given removal policy to this resource.
toString()Returns a string representation of this construct.
static fromSubnetNetworkAclAssociationAssociationId(scope, id, subnetNetworkAclAssociationAssociationId)

applyRemovalPolicy(policy)

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

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).


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.


static fromSubnetNetworkAclAssociationAssociationId(scope, id, subnetNetworkAclAssociationAssociationId)

public static fromSubnetNetworkAclAssociationAssociationId(scope: Construct, id: string, subnetNetworkAclAssociationAssociationId: string): ISubnetNetworkAclAssociation

Parameters

  • scope Construct
  • id string
  • subnetNetworkAclAssociationAssociationId string

Returns

  • ISubnetNetworkAclAssociation