Skip to content
v2.278.0

CommonNetworkAclEntryOptions Struct ​

Basic NetworkACL entry props.

Example ​

ts
// 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 aclCidr: ec2.AclCidr;
declare const aclTraffic: ec2.AclTraffic;
const commonNetworkAclEntryOptions: ec2.CommonNetworkAclEntryOptions = {
  cidr: aclCidr,
  ruleNumber: 123,
  traffic: aclTraffic,

  // the properties below are optional
  direction: ec2.TrafficDirection.EGRESS,
  networkAclEntryName: 'networkAclEntryName',
  ruleAction: ec2.Action.ALLOW,
};
python
# 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

# acl_cidr: ec2.AclCidr
# acl_traffic: ec2.AclTraffic

common_network_acl_entry_options = ec2.CommonNetworkAclEntryOptions(
    cidr=acl_cidr,
    rule_number=123,
    traffic=acl_traffic,

    # the properties below are optional
    direction=ec2.TrafficDirection.EGRESS,
    network_acl_entry_name="networkAclEntryName",
    rule_action=ec2.Action.ALLOW
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;

AclCidr aclCidr;
AclTraffic aclTraffic;

CommonNetworkAclEntryOptions commonNetworkAclEntryOptions = CommonNetworkAclEntryOptions.builder()
        .cidr(aclCidr)
        .ruleNumber(123)
        .traffic(aclTraffic)

        // the properties below are optional
        .direction(TrafficDirection.EGRESS)
        .networkAclEntryName("networkAclEntryName")
        .ruleAction(Action.ALLOW)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;

AclCidr aclCidr;
AclTraffic aclTraffic;

var commonNetworkAclEntryOptions = new CommonNetworkAclEntryOptions {
    Cidr = aclCidr,
    RuleNumber = 123,
    Traffic = aclTraffic,

    // the properties below are optional
    Direction = TrafficDirection.EGRESS,
    NetworkAclEntryName = "networkAclEntryName",
    RuleAction = Action.ALLOW
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var aclCidr AclCidr
var aclTraffic AclTraffic

commonNetworkAclEntryOptions := &CommonNetworkAclEntryOptions{
	Cidr: aclCidr,
	RuleNumber: jsii.Number(123),
	Traffic: aclTraffic,

	// the properties below are optional
	Direction: awscdk.Aws_ec2.TrafficDirection_EGRESS,
	NetworkAclEntryName: jsii.String("networkAclEntryName"),
	RuleAction: awscdk.*Aws_ec2.Action_ALLOW,
}

Properties ​

cidrAclCidrcidrAclCidrcidrAclCidrCidrAclCidrCidrAclCidr required #
The CIDR range to allow or deny.
directionoptionalTrafficDirectiondirectionoptionalTrafficDirectiondirectionoptionalTrafficDirectionDirectionoptionalTrafficDirectionDirectionoptionalTrafficDirection = TrafficDirection.INGRESS #
Traffic direction, with respect to the subnet, this rule applies to.
networkAclEntryNameoptionalstringnetwork_acl_entry_nameoptionalstrnetworkAclEntryNameoptionalStringNetworkAclEntryNameoptionalstringNetworkAclEntryNameoptional*string #
The name of the NetworkAclEntry.

Default: If you don't specify a NetworkAclName, AWS CloudFormation generates a unique physical ID and uses that ID for the group name.

It is not recommended to use an explicit group name.

ruleActionoptionalActionrule_actionoptionalActionruleActionoptionalActionRuleActionoptionalActionRuleActionoptionalAction = ALLOW #
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.

ruleNumbernumberrule_numberint | floatruleNumberNumberRuleNumberdoubleRuleNumber*float64 required #
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.

trafficAclTraffictrafficAclTraffictrafficAclTrafficTrafficAclTrafficTrafficAclTraffic required #
What kind of traffic this ACL rule applies to.