ConnectionRule

class aws_cdk.aws_ec2.ConnectionRule(*, from_port, description=None, protocol=None, to_port=None)

Bases: object

__init__(*, from_port, description=None, protocol=None, to_port=None)
Parameters
  • from_port (Union[int, float]) – Start of port range for the TCP and UDP protocols, or an ICMP type number. If you specify icmp for the IpProtocol property, you can specify -1 as a wildcard (i.e., any ICMP type number).

  • description (Optional[str]) – Description of this connection. It is applied to both the ingress rule and the egress rule. Default: No description

  • protocol (Optional[str]) – The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers). Use -1 to specify all protocols. If you specify -1, or a protocol number other than tcp, udp, icmp, or 58 (ICMPv6), traffic on all ports is allowed, regardless of any ports you specify. For tcp, udp, and icmp, you must specify a port range. For protocol 58 (ICMPv6), you can optionally specify a port range; if you don’t, traffic for all types and codes is allowed. Default: tcp

  • to_port (Union[int, float, None]) – End of port range for the TCP and UDP protocols, or an ICMP code. If you specify icmp for the IpProtocol property, you can specify -1 as a wildcard (i.e., any ICMP code). Default: If toPort is not specified, it will be the same as fromPort.

Return type

None

Attributes

description

Description of this connection.

It is applied to both the ingress rule and the egress rule.

default :default: No description

Return type

Optional[str]

from_port

Start of port range for the TCP and UDP protocols, or an ICMP type number.

If you specify icmp for the IpProtocol property, you can specify -1 as a wildcard (i.e., any ICMP type number).

Return type

Union[int, float]

protocol

The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers).

Use -1 to specify all protocols. If you specify -1, or a protocol number other than tcp, udp, icmp, or 58 (ICMPv6), traffic on all ports is allowed, regardless of any ports you specify. For tcp, udp, and icmp, you must specify a port range. For protocol 58 (ICMPv6), you can optionally specify a port range; if you don’t, traffic for all types and codes is allowed.

default :default: tcp

Return type

Optional[str]

to_port

End of port range for the TCP and UDP protocols, or an ICMP code.

If you specify icmp for the IpProtocol property, you can specify -1 as a wildcard (i.e., any ICMP code).

default :default: If toPort is not specified, it will be the same as fromPort.

Return type

Union[int, float, None]