Class: AWSCDK::EC2::Port
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::EC2::Port
- Defined in:
- ec2/port.rb
Overview
Interface for classes that provide the connection-specification parts of a security group rule.
Class Method Summary collapse
-
.ah ⇒ AWSCDK::EC2::Port
A single AH port.
-
.all_icmp ⇒ AWSCDK::EC2::Port
All ICMP traffic.
-
.all_icmp_v6 ⇒ AWSCDK::EC2::Port
All ICMPv6 traffic.
-
.all_tcp ⇒ AWSCDK::EC2::Port
Any TCP traffic.
-
.all_traffic ⇒ AWSCDK::EC2::Port
All traffic.
-
.all_udp ⇒ AWSCDK::EC2::Port
Any UDP traffic.
-
.DNS_TCP ⇒ AWSCDK::EC2::Port
Well-known DNS port (TCP 53).
-
.DNS_UDP ⇒ AWSCDK::EC2::Port
Well-known DNS port (UDP 53).
-
.esp ⇒ AWSCDK::EC2::Port
A single ESP port.
-
.HTTP ⇒ AWSCDK::EC2::Port
Well-known HTTP port (TCP 80).
-
.HTTPS ⇒ AWSCDK::EC2::Port
Well-known HTTPS port (TCP 443).
-
.icmp_ping ⇒ AWSCDK::EC2::Port
ICMP ping (echo) traffic.
-
.icmp_type(type) ⇒ AWSCDK::EC2::Port
All codes for a single ICMP type.
-
.icmp_type_and_code(type, code) ⇒ AWSCDK::EC2::Port
A specific combination of ICMP type and code.
-
.IMAP ⇒ AWSCDK::EC2::Port
Well-known IMAP port (TCP 143).
-
.IMAPS ⇒ AWSCDK::EC2::Port
Well-known IMAPS port (TCP 993).
- .jsii_overridable_methods ⇒ Object
-
.LDAP ⇒ AWSCDK::EC2::Port
Well-known LDAP port (TCP 389).
-
.MSSQL ⇒ AWSCDK::EC2::Port
Well-known Microsoft SQL Server port (TCP 1433).
-
.MYSQL_AURORA ⇒ AWSCDK::EC2::Port
Well-known MySQL and Aurora port (TCP 3306).
-
.NFS ⇒ AWSCDK::EC2::Port
Well-known NFS port (TCP 2049).
-
.POP3 ⇒ AWSCDK::EC2::Port
Well-known POP3 port (TCP 110).
-
.POP3_S ⇒ AWSCDK::EC2::Port
Well-known POP3S port (TCP 995).
-
.POSTGRES ⇒ AWSCDK::EC2::Port
Well-known PostgreSQL port (TCP 5432).
-
.RDP ⇒ AWSCDK::EC2::Port
Well-known Microsoft Remote Desktop Protocol port (TCP 3389).
-
.SMB ⇒ AWSCDK::EC2::Port
Well-known SMB port (TCP 445).
-
.SMTP ⇒ AWSCDK::EC2::Port
Well-known SMTP port (TCP 25).
-
.SSH ⇒ AWSCDK::EC2::Port
Well-known SSH port (TCP 22).
-
.tcp(port) ⇒ AWSCDK::EC2::Port
A single TCP port.
-
.tcp_range(start_port, end_port) ⇒ AWSCDK::EC2::Port
A TCP port range.
-
.udp(port) ⇒ AWSCDK::EC2::Port
A single UDP port.
-
.udp_range(start_port, end_port) ⇒ AWSCDK::EC2::Port
A UDP port range.
Instance Method Summary collapse
-
#can_inline_rule ⇒ Boolean
Whether the rule containing this port range can be inlined into a securitygroup or not.
-
#initialize(props) ⇒ Port
constructor
A new instance of Port.
-
#to_rule_json ⇒ Object
Produce the ingress/egress rule JSON for the given connection.
- #to_string ⇒ String
Constructor Details
#initialize(props) ⇒ Port
Returns a new instance of Port.
9 10 11 12 13 |
# File 'ec2/port.rb', line 9 def initialize(props) props = props.is_a?(Hash) ? ::AWSCDK::EC2::PortProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlBvcnRQcm9wcyJ9")), "props") Jsii::Object.instance_method(:initialize).bind(self).call(props) end |
Class Method Details
.ah ⇒ AWSCDK::EC2::Port
A single AH port.
26 27 28 |
# File 'ec2/port.rb', line 26 def self.ah() Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.Port", "ah", []) end |
.all_icmp ⇒ AWSCDK::EC2::Port
All ICMP traffic.
33 34 35 |
# File 'ec2/port.rb', line 33 def self.all_icmp() Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.Port", "allIcmp", []) end |
.all_icmp_v6 ⇒ AWSCDK::EC2::Port
All ICMPv6 traffic.
40 41 42 |
# File 'ec2/port.rb', line 40 def self.all_icmp_v6() Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.Port", "allIcmpV6", []) end |
.all_tcp ⇒ AWSCDK::EC2::Port
Any TCP traffic.
47 48 49 |
# File 'ec2/port.rb', line 47 def self.all_tcp() Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.Port", "allTcp", []) end |
.all_traffic ⇒ AWSCDK::EC2::Port
All traffic.
54 55 56 |
# File 'ec2/port.rb', line 54 def self.all_traffic() Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.Port", "allTraffic", []) end |
.all_udp ⇒ AWSCDK::EC2::Port
Any UDP traffic.
61 62 63 |
# File 'ec2/port.rb', line 61 def self.all_udp() Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.Port", "allUdp", []) end |
.DNS_TCP ⇒ AWSCDK::EC2::Port
Well-known DNS port (TCP 53).
143 144 145 |
# File 'ec2/port.rb', line 143 def self.DNS_TCP() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ec2.Port", "DNS_TCP") end |
.DNS_UDP ⇒ AWSCDK::EC2::Port
Well-known DNS port (UDP 53).
150 151 152 |
# File 'ec2/port.rb', line 150 def self.DNS_UDP() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ec2.Port", "DNS_UDP") end |
.esp ⇒ AWSCDK::EC2::Port
A single ESP port.
68 69 70 |
# File 'ec2/port.rb', line 68 def self.esp() Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.Port", "esp", []) end |
.HTTP ⇒ AWSCDK::EC2::Port
Well-known HTTP port (TCP 80).
157 158 159 |
# File 'ec2/port.rb', line 157 def self.HTTP() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ec2.Port", "HTTP") end |
.HTTPS ⇒ AWSCDK::EC2::Port
Well-known HTTPS port (TCP 443).
164 165 166 |
# File 'ec2/port.rb', line 164 def self.HTTPS() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ec2.Port", "HTTPS") end |
.icmp_ping ⇒ AWSCDK::EC2::Port
ICMP ping (echo) traffic.
75 76 77 |
# File 'ec2/port.rb', line 75 def self.icmp_ping() Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.Port", "icmpPing", []) end |
.icmp_type(type) ⇒ AWSCDK::EC2::Port
All codes for a single ICMP type.
83 84 85 86 |
# File 'ec2/port.rb', line 83 def self.icmp_type(type) Jsii::Type.check_type(type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "type") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.Port", "icmpType", [type]) end |
.icmp_type_and_code(type, code) ⇒ AWSCDK::EC2::Port
A specific combination of ICMP type and code.
94 95 96 97 98 |
# File 'ec2/port.rb', line 94 def self.icmp_type_and_code(type, code) Jsii::Type.check_type(type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "type") Jsii::Type.check_type(code, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "code") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.Port", "icmpTypeAndCode", [type, code]) end |
.IMAP ⇒ AWSCDK::EC2::Port
Well-known IMAP port (TCP 143).
171 172 173 |
# File 'ec2/port.rb', line 171 def self.IMAP() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ec2.Port", "IMAP") end |
.IMAPS ⇒ AWSCDK::EC2::Port
Well-known IMAPS port (TCP 993).
178 179 180 |
# File 'ec2/port.rb', line 178 def self.IMAPS() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ec2.Port", "IMAPS") end |
.jsii_overridable_methods ⇒ Object
15 16 17 18 19 20 21 |
# File 'ec2/port.rb', line 15 def self.jsii_overridable_methods { :can_inline_rule => { kind: :property, name: "canInlineRule", is_optional: false }, :to_rule_json => { kind: :method, name: "toRuleJson", is_optional: false }, :to_string => { kind: :method, name: "toString", is_optional: false }, } end |
.LDAP ⇒ AWSCDK::EC2::Port
Well-known LDAP port (TCP 389).
185 186 187 |
# File 'ec2/port.rb', line 185 def self.LDAP() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ec2.Port", "LDAP") end |
.MSSQL ⇒ AWSCDK::EC2::Port
Well-known Microsoft SQL Server port (TCP 1433).
192 193 194 |
# File 'ec2/port.rb', line 192 def self.MSSQL() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ec2.Port", "MSSQL") end |
.MYSQL_AURORA ⇒ AWSCDK::EC2::Port
Well-known MySQL and Aurora port (TCP 3306).
199 200 201 |
# File 'ec2/port.rb', line 199 def self.MYSQL_AURORA() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ec2.Port", "MYSQL_AURORA") end |
.NFS ⇒ AWSCDK::EC2::Port
Well-known NFS port (TCP 2049).
206 207 208 |
# File 'ec2/port.rb', line 206 def self.NFS() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ec2.Port", "NFS") end |
.POP3 ⇒ AWSCDK::EC2::Port
Well-known POP3 port (TCP 110).
213 214 215 |
# File 'ec2/port.rb', line 213 def self.POP3() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ec2.Port", "POP3") end |
.POP3_S ⇒ AWSCDK::EC2::Port
Well-known POP3S port (TCP 995).
220 221 222 |
# File 'ec2/port.rb', line 220 def self.POP3_S() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ec2.Port", "POP3S") end |
.POSTGRES ⇒ AWSCDK::EC2::Port
Well-known PostgreSQL port (TCP 5432).
227 228 229 |
# File 'ec2/port.rb', line 227 def self.POSTGRES() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ec2.Port", "POSTGRES") end |
.RDP ⇒ AWSCDK::EC2::Port
Well-known Microsoft Remote Desktop Protocol port (TCP 3389).
234 235 236 |
# File 'ec2/port.rb', line 234 def self.RDP() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ec2.Port", "RDP") end |
.SMB ⇒ AWSCDK::EC2::Port
Well-known SMB port (TCP 445).
241 242 243 |
# File 'ec2/port.rb', line 241 def self.SMB() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ec2.Port", "SMB") end |
.SMTP ⇒ AWSCDK::EC2::Port
Well-known SMTP port (TCP 25).
248 249 250 |
# File 'ec2/port.rb', line 248 def self.SMTP() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ec2.Port", "SMTP") end |
.SSH ⇒ AWSCDK::EC2::Port
Well-known SSH port (TCP 22).
255 256 257 |
# File 'ec2/port.rb', line 255 def self.SSH() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ec2.Port", "SSH") end |
.tcp(port) ⇒ AWSCDK::EC2::Port
A single TCP port.
104 105 106 107 |
# File 'ec2/port.rb', line 104 def self.tcp(port) Jsii::Type.check_type(port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "port") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.Port", "tcp", [port]) end |
.tcp_range(start_port, end_port) ⇒ AWSCDK::EC2::Port
A TCP port range.
114 115 116 117 118 |
# File 'ec2/port.rb', line 114 def self.tcp_range(start_port, end_port) Jsii::Type.check_type(start_port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "startPort") Jsii::Type.check_type(end_port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "endPort") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.Port", "tcpRange", [start_port, end_port]) end |
.udp(port) ⇒ AWSCDK::EC2::Port
A single UDP port.
124 125 126 127 |
# File 'ec2/port.rb', line 124 def self.udp(port) Jsii::Type.check_type(port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "port") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.Port", "udp", [port]) end |
.udp_range(start_port, end_port) ⇒ AWSCDK::EC2::Port
A UDP port range.
134 135 136 137 138 |
# File 'ec2/port.rb', line 134 def self.udp_range(start_port, end_port) Jsii::Type.check_type(start_port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "startPort") Jsii::Type.check_type(end_port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "endPort") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.Port", "udpRange", [start_port, end_port]) end |
Instance Method Details
#can_inline_rule ⇒ Boolean
Whether the rule containing this port range can be inlined into a securitygroup or not.
262 263 264 |
# File 'ec2/port.rb', line 262 def can_inline_rule() jsii_get_property("canInlineRule") end |
#to_rule_json ⇒ Object
Produce the ingress/egress rule JSON for the given connection.
269 270 271 |
# File 'ec2/port.rb', line 269 def to_rule_json() jsii_call_method("toRuleJson", []) end |
#to_string ⇒ String
274 275 276 |
# File 'ec2/port.rb', line 274 def to_string() jsii_call_method("toString", []) end |