Class: AWSCDK::AppMesh::TCPRouteSpecOptions

Inherits:
RouteSpecOptionsBase
  • Object
show all
Defined in:
app_mesh/tcp_route_spec_options.rb

Overview

Properties specific for a TCP Based Routes.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(priority: nil, weighted_targets:, timeout: nil) ⇒ TCPRouteSpecOptions

Returns a new instance of TCPRouteSpecOptions.

Parameters:

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

    The priority for the route.

  • weighted_targets (Array<AWSCDK::AppMesh::WeightedTarget>)

    List of targets that traffic is routed to when a request matches the route.

  • timeout (AWSCDK::AppMesh::TCPTimeout, nil) (defaults to: nil)

    An object that represents a tcp timeout.



10
11
12
13
14
15
16
17
# File 'app_mesh/tcp_route_spec_options.rb', line 10

def initialize(priority: nil, weighted_targets:, timeout: nil)
  @priority = priority
  Jsii::Type.check_type(@priority, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "priority") unless @priority.nil?
  @weighted_targets = weighted_targets.is_a?(Array) ? weighted_targets.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::AppMesh::WeightedTarget.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : weighted_targets
  Jsii::Type.check_type(@weighted_targets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBtZXNoLldlaWdodGVkVGFyZ2V0In0sImtpbmQiOiJhcnJheSJ9fQ==")), "weightedTargets")
  @timeout = timeout.is_a?(Hash) ? ::AWSCDK::AppMesh::TCPTimeout.new(**timeout.transform_keys(&:to_sym)) : timeout
  Jsii::Type.check_type(@timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbWVzaC5UY3BUaW1lb3V0In0=")), "timeout") unless @timeout.nil?
end

Instance Attribute Details

#priorityNumeric? (readonly)

Note:

Default: - no particular priority

The priority for the route.

When a Virtual Router has multiple routes, route match is performed in the order of specified value, where 0 is the highest priority, and first matched route is selected.

Returns:

  • (Numeric, nil)


26
27
28
# File 'app_mesh/tcp_route_spec_options.rb', line 26

def priority
  @priority
end

#timeoutAWSCDK::AppMesh::TCPTimeout? (readonly)

Note:

Default: - None

An object that represents a tcp timeout.

Returns:



35
36
37
# File 'app_mesh/tcp_route_spec_options.rb', line 35

def timeout
  @timeout
end

#weighted_targetsArray<AWSCDK::AppMesh::WeightedTarget> (readonly)

List of targets that traffic is routed to when a request matches the route.



30
31
32
# File 'app_mesh/tcp_route_spec_options.rb', line 30

def weighted_targets
  @weighted_targets
end

Class Method Details

.jsii_propertiesObject



37
38
39
40
41
42
43
# File 'app_mesh/tcp_route_spec_options.rb', line 37

def self.jsii_properties
  {
    :priority => "priority",
    :weighted_targets => "weightedTargets",
    :timeout => "timeout",
  }
end

Instance Method Details

#to_jsiiObject



45
46
47
48
49
50
51
52
53
54
# File 'app_mesh/tcp_route_spec_options.rb', line 45

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "priority" => @priority,
    "weightedTargets" => @weighted_targets,
    "timeout" => @timeout,
  })
  result.compact
end