class aws_cdk.aws_ec2.INetworkAcl(*args, **kwds)

Bases: aws_cdk.core.IResource, typing_extensions.Protocol

A NetworkAcl.

stability :stability: experimental


add_entry(id, *, cidr, rule_number, traffic, direction=None, network_acl_entry_name=None, rule_action=None)

Add a new entry to the ACL.

  • id (str) –

  • cidr (AclCidr) – The CIDR range to allow or deny.

  • rule_number (Union[int, float]) – Rule number to assign to the entry, such as 100. ACL entries are processed in ascending order by rule number. Entries can’t use the same rule number unless one is an egress rule and the other is an ingress rule.

  • traffic (AclTraffic) – What kind of traffic this ACL rule applies to.

  • direction (Optional[TrafficDirection]) – Traffic direction, with respect to the subnet, this rule applies to. Default: TrafficDirection.INGRESS

  • network_acl_entry_name (Optional[str]) – The name of the NetworkAclEntry. It is not recommended to use an explicit group name. Default: If you don’t specify a NetworkAclName, AWS CloudFormation generates a unique physical ID and uses that ID for the group name.

  • rule_action (Optional[Action]) – Whether to allow or deny traffic that matches the rule; valid values are “allow” or “deny”. Any traffic that is not explicitly allowed is automatically denied in a custom ACL, all traffic is automatically allowed in a default ACL. Default: ALLOW

stability :stability: experimental

Return type




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.

Return type



ID for the current Network ACL.

stability :stability: experimental attribute: :attribute:: true

Return type



The construct tree node for this construct.

Return type



The stack in which this resource is defined.

Return type