Skip to content
v2.274.0

PortProps Struct ​

Properties to create a port range.

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 portProps: ec2.PortProps = {
  protocol: ec2.Protocol.ALL,
  stringRepresentation: 'stringRepresentation',

  // the properties below are optional
  fromPort: 123,
  toPort: 123,
};

Properties ​

fromPortoptionalnumberfrom_portoptionalint | floatfromPortoptionalNumberFromPortoptionaldoubleFromPortoptional*float64#
The starting port for the range.

Default: Not included in the rule

protocolProtocolprotocolProtocolprotocolProtocolProtocolProtocolProtocolProtocolrequired#
The protocol for the range.
stringRepresentationstringstring_representationstrstringRepresentationStringStringRepresentationstringStringRepresentation*stringrequired#
String representation for this object.
toPortoptionalnumberto_portoptionalint | floattoPortoptionalNumberToPortoptionaldoubleToPortoptional*float64#
The ending port for the range.

Default: Not included in the rule