Class: AWSCDK::AppMesh::GrpcGatewayRouteMatch

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
app_mesh/grpc_gateway_route_match.rb

Overview

The criterion for determining a request match for this GatewayRoute.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hostname: nil, metadata: nil, port: nil, rewrite_request_hostname: nil, service_name: nil) ⇒ GrpcGatewayRouteMatch

Returns a new instance of GrpcGatewayRouteMatch.

Parameters:

  • hostname (AWSCDK::AppMesh::GatewayRouteHostnameMatch, nil) (defaults to: nil)

    Create host name based gRPC gateway route match.

  • metadata (Array<AWSCDK::AppMesh::HeaderMatch>, nil) (defaults to: nil)

    Create metadata based gRPC gateway route match.

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

    The port to match from the request.

  • rewrite_request_hostname (Boolean, nil) (defaults to: nil)

    When true, rewrites the original request received at the Virtual Gateway to the destination Virtual Service name.

  • service_name (String, nil) (defaults to: nil)

    Create service name based gRPC gateway route match.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'app_mesh/grpc_gateway_route_match.rb', line 12

def initialize(hostname: nil, metadata: nil, port: nil, rewrite_request_hostname: nil, service_name: nil)
  @hostname = hostname
  Jsii::Type.check_type(@hostname, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbWVzaC5HYXRld2F5Um91dGVIb3N0bmFtZU1hdGNoIn0=")), "hostname") unless @hostname.nil?
  @metadata = 
  Jsii::Type.check_type(@metadata, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBtZXNoLkhlYWRlck1hdGNoIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "metadata") unless @metadata.nil?
  @port = port
  Jsii::Type.check_type(@port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "port") unless @port.nil?
  @rewrite_request_hostname = rewrite_request_hostname
  Jsii::Type.check_type(@rewrite_request_hostname, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "rewriteRequestHostname") unless @rewrite_request_hostname.nil?
  @service_name = service_name
  Jsii::Type.check_type(@service_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "serviceName") unless @service_name.nil?
end

Instance Attribute Details

#hostnameAWSCDK::AppMesh::GatewayRouteHostnameMatch? (readonly)

Note:

Default: - no matching on host name

Create host name based gRPC gateway route match.



29
30
31
# File 'app_mesh/grpc_gateway_route_match.rb', line 29

def hostname
  @hostname
end

#metadataArray<AWSCDK::AppMesh::HeaderMatch>? (readonly)

Note:

Default: - no matching on metadata

Create metadata based gRPC gateway route match.

All specified metadata must match for the route to match.

Returns:



36
37
38
# File 'app_mesh/grpc_gateway_route_match.rb', line 36

def 
  @metadata
end

#portNumeric? (readonly)

Note:

Default: - do not match on port

The port to match from the request.

Returns:

  • (Numeric, nil)


41
42
43
# File 'app_mesh/grpc_gateway_route_match.rb', line 41

def port
  @port
end

#rewrite_request_hostnameBoolean? (readonly)

Note:

Default: true

When true, rewrites the original request received at the Virtual Gateway to the destination Virtual Service name.

When false, retains the original hostname from the request.

Returns:

  • (Boolean, nil)


48
49
50
# File 'app_mesh/grpc_gateway_route_match.rb', line 48

def rewrite_request_hostname
  @rewrite_request_hostname
end

#service_nameString? (readonly)

Note:

Default: - no matching on service name

Create service name based gRPC gateway route match.

Returns:

  • (String, nil)


53
54
55
# File 'app_mesh/grpc_gateway_route_match.rb', line 53

def service_name
  @service_name
end

Class Method Details

.jsii_propertiesObject



55
56
57
58
59
60
61
62
63
# File 'app_mesh/grpc_gateway_route_match.rb', line 55

def self.jsii_properties
  {
    :hostname => "hostname",
    :metadata => "metadata",
    :port => "port",
    :rewrite_request_hostname => "rewriteRequestHostname",
    :service_name => "serviceName",
  }
end

Instance Method Details

#to_jsiiObject



65
66
67
68
69
70
71
72
73
74
75
# File 'app_mesh/grpc_gateway_route_match.rb', line 65

def to_jsii
  result = {}
  result.merge!({
    "hostname" => @hostname,
    "metadata" => @metadata,
    "port" => @port,
    "rewriteRequestHostname" => @rewrite_request_hostname,
    "serviceName" => @service_name,
  })
  result.compact
end