Class: AWSCDK::AppMesh::GrpcGatewayRouteSpecOptions

Inherits:
CommonGatewayRouteSpecOptions
  • Object
show all
Defined in:
app_mesh/grpc_gateway_route_spec_options.rb

Overview

Properties specific for a gRPC GatewayRoute.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(priority: nil, match:, route_target:) ⇒ GrpcGatewayRouteSpecOptions

Returns a new instance of GrpcGatewayRouteSpecOptions.

Parameters:



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

def initialize(priority: nil, match:, route_target:)
  @priority = priority
  Jsii::Type.check_type(@priority, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "priority") unless @priority.nil?
  @match = match.is_a?(Hash) ? ::AWSCDK::AppMesh::GrpcGatewayRouteMatch.new(**match.transform_keys(&:to_sym)) : match
  Jsii::Type.check_type(@match, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbWVzaC5HcnBjR2F0ZXdheVJvdXRlTWF0Y2gifQ==")), "match")
  @route_target = route_target
  Jsii::Type.check_type(@route_target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbWVzaC5JVmlydHVhbFNlcnZpY2UifQ==")), "routeTarget")
end

Instance Attribute Details

#matchAWSCDK::AppMesh::GrpcGatewayRouteMatch (readonly)

The criterion for determining a request match for this GatewayRoute.



31
32
33
# File 'app_mesh/grpc_gateway_route_spec_options.rb', line 31

def match
  @match
end

#priorityNumeric? (readonly)

Note:

Default: - no particular priority

The priority for the gateway route.

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

Returns:

  • (Numeric, nil)


27
28
29
# File 'app_mesh/grpc_gateway_route_spec_options.rb', line 27

def priority
  @priority
end

#route_targetAWSCDK::AppMesh::IVirtualService (readonly)

The VirtualService this GatewayRoute directs traffic to.



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

def route_target
  @route_target
end

Class Method Details

.jsii_propertiesObject



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

def self.jsii_properties
  {
    :priority => "priority",
    :match => "match",
    :route_target => "routeTarget",
  }
end

Instance Method Details

#to_jsiiObject



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

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "priority" => @priority,
    "match" => @match,
    "routeTarget" => @route_target,
  })
  result.compact
end