AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

NetworkAcl

Define a new custom network ACL. By default, will deny all inbound and outbound traffic unless entries are added explicitly allowing it.

Import

import { NetworkAcl } from 'aws-cdk-lib/aws-ec2';

Or use the module namespace:

import * as ec2 from 'aws-cdk-lib/aws-ec2';
// ec2.NetworkAcl

Properties

Configuration passed to the constructor as NetworkAclProps.

vpcRequired
IVpc

The VPC in which to create the NetworkACL.

networkAclNameOptional
string

The name of the NetworkAcl. Since the NetworkAcl resource doesn't support providing a physical name, the value provided here will be recorded in the `Name` tag.

Default: CDK generated name

subnetSelectionOptional
SubnetSelection

Subnets in the given VPC to associate the ACL with. More subnets can always be added later by calling `associateWithSubnets()`.

Default: - No subnets associated

Get the Amazon EC2 Cheat Sheet

Everything you need to know about Amazon EC2 on one page. HD quality, print-friendly.

Download Free Infographic