# PortProps

Properties to create a port range.

Extends: PortProps
Used as props by: Port

- Source: [`aws-ec2/lib/port.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-ec2/lib/port.ts#L161)

## 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

- `fromPort`: number — The starting port for the range.

  **Default:** Not included in the rule

- `protocol`: [Protocol](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Protocol.html) (required) — The protocol for the range.

- `stringRepresentation`: string (required) — String representation for this object.

- `toPort`: number — The ending port for the range.

  **Default:** Not included in the rule
