Class: AWSCDK::EC2::PortProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EC2::PortProps
- Defined in:
- ec2/port_props.rb
Overview
Properties to create a port range.
Instance Attribute Summary collapse
-
#from_port ⇒ Numeric?
readonly
The starting port for the range.
-
#protocol ⇒ AWSCDK::EC2::Protocol
readonly
The protocol for the range.
-
#string_representation ⇒ String
readonly
String representation for this object.
-
#to_port ⇒ Numeric?
readonly
The ending port for the range.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(protocol:, string_representation:, from_port: nil, to_port: nil) ⇒ PortProps
constructor
A new instance of PortProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(protocol:, string_representation:, from_port: nil, to_port: nil) ⇒ PortProps
Returns a new instance of PortProps.
11 12 13 14 15 16 17 18 19 20 |
# File 'ec2/port_props.rb', line 11 def initialize(protocol:, string_representation:, from_port: nil, to_port: nil) @protocol = protocol Jsii::Type.check_type(@protocol, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlByb3RvY29sIn0=")), "protocol") @string_representation = string_representation Jsii::Type.check_type(@string_representation, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "stringRepresentation") @from_port = from_port Jsii::Type.check_type(@from_port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "fromPort") unless @from_port.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
#from_port ⇒ Numeric? (readonly)
Note:
Default: - Not included in the rule
The starting port for the range.
34 35 36 |
# File 'ec2/port_props.rb', line 34 def from_port @from_port end |
#protocol ⇒ AWSCDK::EC2::Protocol (readonly)
The protocol for the range.
25 26 27 |
# File 'ec2/port_props.rb', line 25 def protocol @protocol end |
#string_representation ⇒ String (readonly)
String representation for this object.
29 30 31 |
# File 'ec2/port_props.rb', line 29 def string_representation @string_representation end |
#to_port ⇒ Numeric? (readonly)
Note:
Default: - Not included in the rule
The ending port for the range.
39 40 41 |
# File 'ec2/port_props.rb', line 39 def to_port @to_port end |
Class Method Details
.jsii_properties ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'ec2/port_props.rb', line 41 def self.jsii_properties { :protocol => "protocol", :string_representation => "stringRepresentation", :from_port => "fromPort", :to_port => "toPort", } end |
Instance Method Details
#to_jsii ⇒ Object
50 51 52 53 54 55 56 57 58 59 |
# File 'ec2/port_props.rb', line 50 def to_jsii result = {} result.merge!({ "protocol" => @protocol, "stringRepresentation" => @string_representation, "fromPort" => @from_port, "toPort" => @to_port, }) result.compact end |