GrpcRouteMatch

class aws_cdk.aws_appmesh.GrpcRouteMatch(*, metadata=None, method_name=None, service_name=None)

Bases: object

The criterion for determining a request match for this Route.

At least one match type must be selected.

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

  • method_name (Optional[str]) – The method name to match from the request. If the method name is specified, service name must be also provided. Default: - do not match on method name

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

ExampleMetadata

infused

Example:

# router: appmesh.VirtualRouter
# node: appmesh.VirtualNode


router.add_route("route-http",
    route_spec=appmesh.RouteSpec.grpc(
        weighted_targets=[appmesh.WeightedTarget(
            virtual_node=node
        )
        ],
        match=appmesh.GrpcRouteMatch(
            service_name="my-service.default.svc.cluster.local"
        ),
        timeout=appmesh.GrpcTimeout(
            idle=cdk.Duration.seconds(2),
            per_request=cdk.Duration.seconds(1)
        )
    )
)

Attributes

metadata

Create metadata based gRPC route match.

All specified metadata must match for the route to match.

Default
  • do not match on metadata

Return type

Optional[List[HeaderMatch]]

method_name

The method name to match from the request.

If the method name is specified, service name must be also provided.

Default
  • do not match on method name

Return type

Optional[str]

service_name

Create service name based gRPC route match.

Default
  • do not match on service name

Return type

Optional[str]