PortProps

class aws_cdk.aws_ec2.PortProps(*, protocol, string_representation, from_port=None, to_port=None)

Bases: object

Properties to create a port range.

Parameters:
  • protocol (Protocol) – The protocol for the range.

  • string_representation (str) – String representation for this object.

  • from_port (Union[int, float, None]) – The starting port for the range. Default: - Not included in the rule

  • to_port (Union[int, float, None]) – The ending port for the range. Default: - Not included in the rule

ExampleMetadata:

fixture=_generated

Example:

# 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

port_props = ec2.PortProps(
    protocol=ec2.Protocol.ALL,
    string_representation="stringRepresentation",

    # the properties below are optional
    from_port=123,
    to_port=123
)

Attributes

from_port

The starting port for the range.

Default:
  • Not included in the rule

protocol

The protocol for the range.

string_representation

String representation for this object.

to_port

The ending port for the range.

Default:
  • Not included in the rule