GrpcGatewayRouteMatch

class aws_cdk.aws_appmesh.GrpcGatewayRouteMatch(*, hostname=None, metadata=None, port=None, rewrite_request_hostname=None, service_name=None)

Bases: object

The criterion for determining a request match for this GatewayRoute.

Parameters:
  • hostname (Optional[GatewayRouteHostnameMatch]) – Create host name based gRPC gateway route match. Default: - no matching on host name

  • metadata (Optional[Sequence[HeaderMatch]]) – Create metadata based gRPC gateway route match. All specified metadata must match for the route to match. Default: - no matching on metadata

  • port (Union[int, float, None]) – The port to match from the request. Default: - do not match on port

  • rewrite_request_hostname (Optional[bool]) – 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. Default: true

  • service_name (Optional[str]) – Create service name based gRPC gateway route match. Default: - no matching on service name

ExampleMetadata:

infused

Example:

# gateway: appmesh.VirtualGateway
# virtual_service: appmesh.VirtualService


gateway.add_gateway_route("gateway-route-grpc",
    route_spec=appmesh.GatewayRouteSpec.grpc(
        route_target=virtual_service,
        match=appmesh.GrpcGatewayRouteMatch(
            hostname=appmesh.GatewayRouteHostnameMatch.ends_with(".example.com")
        )
    )
)

Attributes

hostname

Create host name based gRPC gateway route match.

Default:
  • no matching on host name

metadata

Create metadata based gRPC gateway route match.

All specified metadata must match for the route to match.

Default:
  • no matching on metadata

port

The port to match from the request.

Default:
  • do not match on port

rewrite_request_hostname

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.

Default:

true

service_name

Create service name based gRPC gateway route match.

Default:
  • no matching on service name