Class: AWSCDK::GlobalAccelerator::ListenerOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::GlobalAccelerator::ListenerOptions
- Defined in:
- global_accelerator/listener_options.rb
Overview
Construct options for Listener.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#client_affinity ⇒ AWSCDK::GlobalAccelerator::ClientAffinity?
readonly
Client affinity to direct all requests from a user to the same endpoint.
-
#listener_name ⇒ String?
readonly
Name of the listener.
-
#port_ranges ⇒ Array<AWSCDK::GlobalAccelerator::PortRange>
readonly
The list of port ranges for the connections from clients to the accelerator.
-
#protocol ⇒ AWSCDK::GlobalAccelerator::ConnectionProtocol?
readonly
The protocol for the connections from clients to the accelerator.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(port_ranges:, client_affinity: nil, listener_name: nil, protocol: nil) ⇒ ListenerOptions
constructor
A new instance of ListenerOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(port_ranges:, client_affinity: nil, listener_name: nil, protocol: nil) ⇒ ListenerOptions
Returns a new instance of ListenerOptions.
11 12 13 14 15 16 17 18 19 20 |
# File 'global_accelerator/listener_options.rb', line 11 def initialize(port_ranges:, client_affinity: nil, listener_name: nil, protocol: nil) @port_ranges = port_ranges.is_a?(Array) ? port_ranges.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::GlobalAccelerator::PortRange.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : port_ranges Jsii::Type.check_type(@port_ranges, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19nbG9iYWxhY2NlbGVyYXRvci5Qb3J0UmFuZ2UifSwia2luZCI6ImFycmF5In19")), "portRanges") @client_affinity = client_affinity Jsii::Type.check_type(@client_affinity, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZ2xvYmFsYWNjZWxlcmF0b3IuQ2xpZW50QWZmaW5pdHkifQ==")), "clientAffinity") unless @client_affinity.nil? @listener_name = listener_name Jsii::Type.check_type(@listener_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "listenerName") unless @listener_name.nil? @protocol = protocol Jsii::Type.check_type(@protocol, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZ2xvYmFsYWNjZWxlcmF0b3IuQ29ubmVjdGlvblByb3RvY29sIn0=")), "protocol") unless @protocol.nil? end |
Instance Attribute Details
#client_affinity ⇒ AWSCDK::GlobalAccelerator::ClientAffinity? (readonly)
Default: ClientAffinity.NONE
Client affinity to direct all requests from a user to the same endpoint.
If you have stateful applications, client affinity lets you direct all requests from a user to the same endpoint.
By default, each connection from each client is routed to separate endpoints. Set client affinity to SOURCE_IP to route all connections from a single client to the same endpoint.
37 38 39 |
# File 'global_accelerator/listener_options.rb', line 37 def client_affinity @client_affinity end |
#listener_name ⇒ String? (readonly)
Default: - logical ID of the resource
Name of the listener.
42 43 44 |
# File 'global_accelerator/listener_options.rb', line 42 def listener_name @listener_name end |
#port_ranges ⇒ Array<AWSCDK::GlobalAccelerator::PortRange> (readonly)
The list of port ranges for the connections from clients to the accelerator.
25 26 27 |
# File 'global_accelerator/listener_options.rb', line 25 def port_ranges @port_ranges end |
#protocol ⇒ AWSCDK::GlobalAccelerator::ConnectionProtocol? (readonly)
Default: ConnectionProtocol.TCP
The protocol for the connections from clients to the accelerator.
47 48 49 |
# File 'global_accelerator/listener_options.rb', line 47 def protocol @protocol end |
Class Method Details
.jsii_properties ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'global_accelerator/listener_options.rb', line 49 def self.jsii_properties { :port_ranges => "portRanges", :client_affinity => "clientAffinity", :listener_name => "listenerName", :protocol => "protocol", } end |
Instance Method Details
#to_jsii ⇒ Object
58 59 60 61 62 63 64 65 66 67 |
# File 'global_accelerator/listener_options.rb', line 58 def to_jsii result = {} result.merge!({ "portRanges" => @port_ranges, "clientAffinity" => @client_affinity, "listenerName" => @listener_name, "protocol" => @protocol, }) result.compact end |