aws-cdk-lib.aws_ec2.PortProps

interface PortProps

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

Properties to create a port range.

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

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

Properties

NameTypeDescription
protocolProtocolThe protocol for the range.
stringRepresentationstringString representation for this object.
fromPort?numberThe starting port for the range.
toPort?numberThe ending port for the range.

protocol

Type: Protocol

The protocol for the range.


stringRepresentation

Type: string

String representation for this object.


fromPort?

Type: number (optional, default: Not included in the rule)

The starting port for the range.


toPort?

Type: number (optional, default: Not included in the rule)

The ending port for the range.