aws-cdk-lib.aws_ec2.AclTrafficConfig

interface AclTrafficConfig

LanguageType name
.NETAmazon.CDK.AWS.EC2.AclTrafficConfig
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsec2#AclTrafficConfig
Javasoftware.amazon.awscdk.services.ec2.AclTrafficConfig
Pythonaws_cdk.aws_ec2.AclTrafficConfig
TypeScript (source)aws-cdk-lib » aws_ec2 » AclTrafficConfig

Obtainable from AclTraffic.toTrafficConfig()

Acl Configuration for traffic.

Example

// 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 aclTrafficConfig: ec2.AclTrafficConfig = {
  protocol: 123,

  // the properties below are optional
  icmp: {
    code: 123,
    type: 123,
  },
  portRange: {
    from: 123,
    to: 123,
  },
};

Properties

NameTypeDescription
protocolnumberThe protocol number.
icmp?AclIcmpThe Internet Control Message Protocol (ICMP) code and type.
portRange?AclPortRangeThe range of port numbers for the UDP/TCP protocol.

protocol

Type: number

The protocol number.

A value of "-1" means all protocols.

If you specify "-1" or a protocol number other than "6" (TCP), "17" (UDP), or "1" (ICMP), traffic on all ports is allowed, regardless of any ports or ICMP types or codes that you specify.

If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR block, traffic for all ICMP types and codes allowed, regardless of any that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv6 CIDR block, you must specify an ICMP type and code.


icmp?

Type: AclIcmp (optional, default: Required if specifying 1 (ICMP) for the protocol parameter.)

The Internet Control Message Protocol (ICMP) code and type.


portRange?

Type: AclPortRange (optional, default: Required if specifying 6 (TCP) or 17 (UDP) for the protocol parameter)

The range of port numbers for the UDP/TCP protocol.