NetworkAclEntryProps Struct
Properties to create NetworkAclEntry.
| Source | aws-ec2/lib/network-acl.ts |
|---|
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;
declare const networkAcl: ec2.NetworkAcl;
const networkAclEntryProps: ec2.NetworkAclEntryProps = {
cidr: aclCidr,
networkAcl: networkAcl,
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
# network_acl: ec2.NetworkAcl
network_acl_entry_props = ec2.NetworkAclEntryProps(
cidr=acl_cidr,
network_acl=network_acl,
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;
NetworkAcl networkAcl;
NetworkAclEntryProps networkAclEntryProps = NetworkAclEntryProps.builder()
.cidr(aclCidr)
.networkAcl(networkAcl)
.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;
NetworkAcl networkAcl;
var networkAclEntryProps = new NetworkAclEntryProps {
Cidr = aclCidr,
NetworkAcl = networkAcl,
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
var networkAcl NetworkAcl
networkAclEntryProps := &NetworkAclEntryProps{
Cidr: aclCidr,
NetworkAcl: networkAcl,
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
directionoptionalTrafficDirectiondirectionoptionalTrafficDirectiondirectionoptionalTrafficDirectionDirectionoptionalTrafficDirectionDirectionoptionalTrafficDirection = TrafficDirection.INGRESS #Traffic direction, with respect to the subnet, this rule applies to.
networkAclINetworkAclnetwork_aclINetworkAclnetworkAclINetworkAclNetworkAclINetworkAclNetworkAclINetworkAcl required #The network ACL this entry 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.
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.
What kind of traffic this ACL rule applies to.