NetworkAclProps

class aws_cdk.aws_ec2.NetworkAclProps(*, vpc, network_acl_name=None, subnet_selection=None)

Bases: object

Properties to create NetworkAcl.

Parameters:
  • vpc (IVpc) – The VPC in which to create the NetworkACL.

  • network_acl_name (Optional[str]) – 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

  • subnet_selection (Union[SubnetSelection, Dict[str, Any], None]) – Subnets in the given VPC to associate the ACL with. More subnets can always be added later by calling associateWithSubnets(). Default: - No subnets associated

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

# subnet: ec2.Subnet
# subnet_filter: ec2.SubnetFilter
# vpc: ec2.Vpc

network_acl_props = ec2.NetworkAclProps(
    vpc=vpc,

    # the properties below are optional
    network_acl_name="networkAclName",
    subnet_selection=ec2.SubnetSelection(
        availability_zones=["availabilityZones"],
        one_per_az=False,
        subnet_filters=[subnet_filter],
        subnet_group_name="subnetGroupName",
        subnets=[subnet],
        subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
    )
)

Attributes

network_acl_name

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

subnet_selection

Subnets in the given VPC to associate the ACL with.

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

Default:
  • No subnets associated

vpc

The VPC in which to create the NetworkACL.