PortProps

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

Bases: object

Properties to create a port range.

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

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

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

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

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.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

Return type

Union[int, float, None]

protocol

The protocol for the range.

Return type

Protocol

string_representation

String representation for this object.

Return type

str

to_port

The ending port for the range.

Default
  • Not included in the rule

Return type

Union[int, float, None]