aws-cdk-lib.aws_ec2.NetworkAclProps

interface NetworkAclProps

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

Properties to create NetworkAcl.

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 subnet: ec2.Subnet;
declare const subnetFilter: ec2.SubnetFilter;
declare const vpc: ec2.Vpc;
const networkAclProps: ec2.NetworkAclProps = {
  vpc: vpc,

  // the properties below are optional
  networkAclName: 'networkAclName',
  subnetSelection: {
    availabilityZones: ['availabilityZones'],
    onePerAz: false,
    subnetFilters: [subnetFilter],
    subnetGroupName: 'subnetGroupName',
    subnets: [subnet],
    subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
  },
};

Properties

NameTypeDescription
vpcIVpcThe VPC in which to create the NetworkACL.
networkAclName?stringThe name of the NetworkAcl.
subnetSelection?SubnetSelectionSubnets in the given VPC to associate the ACL with.

vpc

Type: IVpc

The VPC in which to create the NetworkACL.


networkAclName?

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

The name of the NetworkAcl.

It is not recommended to use an explicit name.


subnetSelection?

Type: SubnetSelection (optional, default: No subnets associated)

Subnets in the given VPC to associate the ACL with.

More subnets can always be added later by calling associateWithSubnets().