Class: AWSCDK::GlobalAccelerator::PortRange

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
global_accelerator/port_range.rb

Overview

The list of port ranges for the connections from clients to the accelerator.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from_port:, to_port: nil) ⇒ PortRange

Returns a new instance of PortRange.

Parameters:

  • from_port (Numeric)

    The first port in the range of ports, inclusive.

  • to_port (Numeric, nil) (defaults to: nil)

    The last port in the range of ports, inclusive.



9
10
11
12
13
14
# File 'global_accelerator/port_range.rb', line 9

def initialize(from_port:, to_port: nil)
  @from_port = from_port
  Jsii::Type.check_type(@from_port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "fromPort")
  @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_portNumeric (readonly)

The first port in the range of ports, inclusive.

Returns:

  • (Numeric)


19
20
21
# File 'global_accelerator/port_range.rb', line 19

def from_port
  @from_port
end

#to_portNumeric? (readonly)

Note:

Default: - same as fromPort

The last port in the range of ports, inclusive.

Returns:

  • (Numeric, nil)


24
25
26
# File 'global_accelerator/port_range.rb', line 24

def to_port
  @to_port
end

Class Method Details

.jsii_propertiesObject



26
27
28
29
30
31
# File 'global_accelerator/port_range.rb', line 26

def self.jsii_properties
  {
    :from_port => "fromPort",
    :to_port => "toPort",
  }
end

Instance Method Details

#to_jsiiObject



33
34
35
36
37
38
39
40
# File 'global_accelerator/port_range.rb', line 33

def to_jsii
  result = {}
  result.merge!({
    "fromPort" => @from_port,
    "toPort" => @to_port,
  })
  result.compact
end