Skip to content
v2.278.0

CfnNetworkAclEntryProps Struct ​

Properties for defining a CfnNetworkAclEntry.

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';
const cfnNetworkAclEntryProps: ec2.CfnNetworkAclEntryProps = {
  networkAclId: 'networkAclId',
  protocol: 123,
  ruleAction: 'ruleAction',
  ruleNumber: 123,

  // the properties below are optional
  cidrBlock: 'cidrBlock',
  egress: false,
  icmp: {
    code: 123,
    type: 123,
  },
  ipv6CidrBlock: 'ipv6CidrBlock',
  portRange: {
    from: 123,
    to: 123,
  },
};
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

cfn_network_acl_entry_props = ec2.CfnNetworkAclEntryProps(
    network_acl_id="networkAclId",
    protocol=123,
    rule_action="ruleAction",
    rule_number=123,

    # the properties below are optional
    cidr_block="cidrBlock",
    egress=False,
    icmp=ec2.CfnNetworkAclEntry.IcmpProperty(
        code=123,
        type=123
    ),
    ipv6_cidr_block="ipv6CidrBlock",
    port_range=ec2.CfnNetworkAclEntry.PortRangeProperty(
        from=123,
        to=123
    )
)
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.*;

CfnNetworkAclEntryProps cfnNetworkAclEntryProps = CfnNetworkAclEntryProps.builder()
        .networkAclId("networkAclId")
        .protocol(123)
        .ruleAction("ruleAction")
        .ruleNumber(123)

        // the properties below are optional
        .cidrBlock("cidrBlock")
        .egress(false)
        .icmp(IcmpProperty.builder()
                .code(123)
                .type(123)
                .build())
        .ipv6CidrBlock("ipv6CidrBlock")
        .portRange(PortRangeProperty.builder()
                .from(123)
                .to(123)
                .build())
        .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;

var cfnNetworkAclEntryProps = new CfnNetworkAclEntryProps {
    NetworkAclId = "networkAclId",
    Protocol = 123,
    RuleAction = "ruleAction",
    RuleNumber = 123,

    // the properties below are optional
    CidrBlock = "cidrBlock",
    Egress = false,
    Icmp = new IcmpProperty {
        Code = 123,
        Type = 123
    },
    Ipv6CidrBlock = "ipv6CidrBlock",
    PortRange = new PortRangeProperty {
        From = 123,
        To = 123
    }
};
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"

cfnNetworkAclEntryProps := &CfnNetworkAclEntryProps{
	NetworkAclId: jsii.String("networkAclId"),
	Protocol: jsii.Number(123),
	RuleAction: jsii.String("ruleAction"),
	RuleNumber: jsii.Number(123),

	// the properties below are optional
	CidrBlock: jsii.String("cidrBlock"),
	Egress: jsii.Boolean(false),
	Icmp: &IcmpProperty{
		Code: jsii.Number(123),
		Type: jsii.Number(123),
	},
	Ipv6CidrBlock: jsii.String("ipv6CidrBlock"),
	PortRange: &PortRangeProperty{
		From: jsii.Number(123),
		To: jsii.Number(123),
	},
}

Properties ​

cidrBlockoptionalstringcidr_blockoptionalstrcidrBlockoptionalStringCidrBlockoptionalstringCidrBlockoptional*string #
The IPv4 CIDR range to allow or deny, in CIDR notation (for example, 172.16.0.0/24). You must specify an IPv4 CIDR block or an IPv6 CIDR block.
egressoptionalboolean | IResolvableegressoptionaltyping.Union[bool, IResolvable]egressoptionalBooleanEgressoptionalboolEgressoptionalinterface{} #
Whether this rule applies to egress traffic from the subnet ( `true` ) or ingress traffic to the subnet ( `false` ).

By default, AWS CloudFormation specifies false .

icmpoptionalIResolvable | CfnNetworkAclEntry.IcmpPropertyicmpoptionaltyping.Union[IResolvable, IcmpProperty]icmpoptionalIResolvableIcmpoptionalIResolvableIcmpoptionalinterface{} #
The Internet Control Message Protocol (ICMP) code and type.

Required if specifying 1 (ICMP) for the protocol parameter.

ipv6CidrBlockoptionalstringipv6_cidr_blockoptionalstripv6CidrBlockoptionalStringIpv6CidrBlockoptionalstringIpv6CidrBlockoptional*string #
The IPv6 network range to allow or deny, in CIDR notation.

You must specify an IPv4 CIDR block or an IPv6 CIDR block.

networkAclIdstringnetwork_acl_idstrnetworkAclIdStringNetworkAclIdstringNetworkAclId*string required #
The ID of the ACL for the entry.
portRangeoptionalIResolvable | CfnNetworkAclEntry.PortRangePropertyport_rangeoptionaltyping.Union[IResolvable, PortRangeProperty]portRangeoptionalIResolvablePortRangeoptionalIResolvablePortRangeoptionalinterface{} #
The range of port numbers for the UDP/TCP protocol.

Required if specifying 6 (TCP) or 17 (UDP) for the protocol parameter.

protocolnumberprotocolint | floatprotocolNumberProtocoldoubleProtocol*float64 required #
The IP protocol that the rule applies to.

You must specify -1 or a protocol number. You can specify -1 for all protocols.

If you specify -1, all ports are opened and the PortRange property is ignored.

ruleActionstringrule_actionstrruleActionStringRuleActionstringRuleAction*string required #
Whether to allow or deny traffic that matches the rule;

valid values are "allow" or "deny".

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.