Class: AWSCDK::Lightsail::CfnInstance::PortProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Lightsail::CfnInstance::PortProperty
- Defined in:
- lightsail/cfn_instance.rb
Overview
Port is a property of the Networking property. It describes information about ports for an instance.
Instance Attribute Summary collapse
-
#access_direction ⇒ String?
readonly
The access direction (
inboundoroutbound). -
#access_from ⇒ String?
readonly
The location from which access is allowed.
-
#access_type ⇒ String?
readonly
The type of access (
PublicorPrivate). -
#cidr_list_aliases ⇒ Array<String>?
readonly
An alias that defines access for a preconfigured range of IP addresses.
-
#cidrs ⇒ Array<String>?
readonly
The IPv4 address, or range of IPv4 addresses (in CIDR notation) that are allowed to connect to an instance through the ports, and the protocol.
-
#common_name ⇒ String?
readonly
The common name of the port information.
-
#from_port ⇒ Numeric?
readonly
The first port in a range of open ports on an instance.
-
#ipv6_cidrs ⇒ Array<String>?
readonly
The IPv6 address, or range of IPv6 addresses (in CIDR notation) that are allowed to connect to an instance through the ports, and the protocol.
-
#protocol ⇒ String?
readonly
The IP protocol name.
-
#to_port ⇒ Numeric?
readonly
The last port in a range of open ports on an instance.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(access_direction: nil, access_from: nil, access_type: nil, cidr_list_aliases: nil, cidrs: nil, common_name: nil, from_port: nil, ipv6_cidrs: nil, protocol: nil, to_port: nil) ⇒ PortProperty
constructor
A new instance of PortProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(access_direction: nil, access_from: nil, access_type: nil, cidr_list_aliases: nil, cidrs: nil, common_name: nil, from_port: nil, ipv6_cidrs: nil, protocol: nil, to_port: nil) ⇒ PortProperty
Returns a new instance of PortProperty.
1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 |
# File 'lightsail/cfn_instance.rb', line 1164 def initialize(access_direction: nil, access_from: nil, access_type: nil, cidr_list_aliases: nil, cidrs: nil, common_name: nil, from_port: nil, ipv6_cidrs: nil, protocol: nil, to_port: nil) @access_direction = access_direction Jsii::Type.check_type(@access_direction, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "accessDirection") unless @access_direction.nil? @access_from = access_from Jsii::Type.check_type(@access_from, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "accessFrom") unless @access_from.nil? @access_type = access_type Jsii::Type.check_type(@access_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "accessType") unless @access_type.nil? @cidr_list_aliases = cidr_list_aliases Jsii::Type.check_type(@cidr_list_aliases, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "cidrListAliases") unless @cidr_list_aliases.nil? @cidrs = cidrs Jsii::Type.check_type(@cidrs, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "cidrs") unless @cidrs.nil? @common_name = common_name Jsii::Type.check_type(@common_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "commonName") unless @common_name.nil? @from_port = from_port Jsii::Type.check_type(@from_port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "fromPort") unless @from_port.nil? @ipv6_cidrs = ipv6_cidrs Jsii::Type.check_type(@ipv6_cidrs, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "ipv6Cidrs") unless @ipv6_cidrs.nil? @protocol = protocol Jsii::Type.check_type(@protocol, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "protocol") unless @protocol.nil? @to_port = to_port Jsii::Type.check_type(@to_port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "toPort") unless @to_port.nil? end |
Instance Attribute Details
#access_direction ⇒ String? (readonly)
The access direction ( inbound or outbound ).
Lightsail currently supports only
inboundaccess direction.
1193 1194 1195 |
# File 'lightsail/cfn_instance.rb', line 1193 def access_direction @access_direction end |
#access_from ⇒ String? (readonly)
The location from which access is allowed.
For example, Anywhere (0.0.0.0/0) , or Custom if a specific IP address or range of IP addresses is allowed.
1200 1201 1202 |
# File 'lightsail/cfn_instance.rb', line 1200 def access_from @access_from end |
#access_type ⇒ String? (readonly)
The type of access ( Public or Private ).
1205 1206 1207 |
# File 'lightsail/cfn_instance.rb', line 1205 def access_type @access_type end |
#cidr_list_aliases ⇒ Array<String>? (readonly)
An alias that defines access for a preconfigured range of IP addresses.
The only alias currently supported is lightsail-connect , which allows IP addresses of the browser-based RDP/SSH client in the Lightsail console to connect to your instance.
1212 1213 1214 |
# File 'lightsail/cfn_instance.rb', line 1212 def cidr_list_aliases @cidr_list_aliases end |
#cidrs ⇒ Array<String>? (readonly)
The IPv4 address, or range of IPv4 addresses (in CIDR notation) that are allowed to connect to an instance through the ports, and the protocol.
The
ipv6_cidrsparameter lists the IPv6 addresses that are allowed to connect to an instance.
Examples:
- To allow the IP address
192.0.2.44, specify192.0.2.44or192.0.2.44/32. - To allow the IP addresses
192.0.2.0to192.0.2.255, specify192.0.2.0/24.
1224 1225 1226 |
# File 'lightsail/cfn_instance.rb', line 1224 def cidrs @cidrs end |
#common_name ⇒ String? (readonly)
The common name of the port information.
1229 1230 1231 |
# File 'lightsail/cfn_instance.rb', line 1229 def common_name @common_name end |
#from_port ⇒ Numeric? (readonly)
The first port in a range of open ports on an instance.
Allowed ports:
- TCP and UDP -
0to65535 - ICMP - The ICMP type for IPv4 addresses. For example, specify
8as thefrom_port(ICMP type), and-1as theto_port(ICMP code), to enable ICMP Ping. - ICMPv6 - The ICMP type for IPv6 addresses. For example, specify
128as thefrom_port(ICMPv6 type), and0asto_port(ICMPv6 code).
1240 1241 1242 |
# File 'lightsail/cfn_instance.rb', line 1240 def from_port @from_port end |
#ipv6_cidrs ⇒ Array<String>? (readonly)
The IPv6 address, or range of IPv6 addresses (in CIDR notation) that are allowed to connect to an instance through the ports, and the protocol.
Only devices with an IPv6 address can connect to an instance through IPv6; otherwise, IPv4 should be used.
The
cidrsparameter lists the IPv4 addresses that are allowed to connect to an instance.
1249 1250 1251 |
# File 'lightsail/cfn_instance.rb', line 1249 def ipv6_cidrs @ipv6_cidrs end |
#protocol ⇒ String? (readonly)
The IP protocol name.
The name can be one of the following:
tcp- Transmission Control Protocol (TCP) provides reliable, ordered, and error-checked delivery of streamed data between applications running on hosts communicating by an IP network. If you have an application that doesn't require reliable data stream service, use UDP instead.all- All transport layer protocol types.udp- With User Datagram Protocol (UDP), computer applications can send messages (or datagrams) to other hosts on an Internet Protocol (IP) network. Prior communications are not required to set up transmission channels or data paths. Applications that don't require reliable data stream service can use UDP, which provides a connectionless datagram service that emphasizes reduced latency over reliability. If you do require reliable data stream service, use TCP instead.icmp- Internet Control Message Protocol (ICMP) is used to send error messages and operational information indicating success or failure when communicating with an instance. For example, an error is indicated when an instance could not be reached. When you specifyicmpas theprotocol, you must specify the ICMP type using thefrom_portparameter, and ICMP code using theto_portparameter.
1261 1262 1263 |
# File 'lightsail/cfn_instance.rb', line 1261 def protocol @protocol end |
#to_port ⇒ Numeric? (readonly)
The last port in a range of open ports on an instance.
Allowed ports:
- TCP and UDP -
0to65535 - ICMP - The ICMP code for IPv4 addresses. For example, specify
8as thefrom_port(ICMP type), and-1as theto_port(ICMP code), to enable ICMP Ping. - ICMPv6 - The ICMP code for IPv6 addresses. For example, specify
128as thefrom_port(ICMPv6 type), and0asto_port(ICMPv6 code).
1272 1273 1274 |
# File 'lightsail/cfn_instance.rb', line 1272 def to_port @to_port end |
Class Method Details
.jsii_properties ⇒ Object
1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 |
# File 'lightsail/cfn_instance.rb', line 1274 def self.jsii_properties { :access_direction => "accessDirection", :access_from => "accessFrom", :access_type => "accessType", :cidr_list_aliases => "cidrListAliases", :cidrs => "cidrs", :common_name => "commonName", :from_port => "fromPort", :ipv6_cidrs => "ipv6Cidrs", :protocol => "protocol", :to_port => "toPort", } end |
Instance Method Details
#to_jsii ⇒ Object
1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 |
# File 'lightsail/cfn_instance.rb', line 1289 def to_jsii result = {} result.merge!({ "accessDirection" => @access_direction, "accessFrom" => @access_from, "accessType" => @access_type, "cidrListAliases" => @cidr_list_aliases, "cidrs" => @cidrs, "commonName" => @common_name, "fromPort" => @from_port, "ipv6Cidrs" => @ipv6_cidrs, "protocol" => @protocol, "toPort" => @to_port, }) result.compact end |