aws-cdk-lib.aws_appmesh.GrpcRouteMatch

interface GrpcRouteMatch

LanguageType name
.NETAmazon.CDK.AWS.AppMesh.GrpcRouteMatch
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsappmesh#GrpcRouteMatch
Javasoftware.amazon.awscdk.services.appmesh.GrpcRouteMatch
Pythonaws_cdk.aws_appmesh.GrpcRouteMatch
TypeScript (source)aws-cdk-lib » aws_appmesh » GrpcRouteMatch

The criterion for determining a request match for this Route.

At least one match type must be selected.

Example

declare const router: appmesh.VirtualRouter;
declare const node: appmesh.VirtualNode;

router.addRoute('route-grpc-retry', {
  routeSpec: appmesh.RouteSpec.grpc({
    weightedTargets: [{ virtualNode: node }],
    match: {
      // When method name is specified, service name must be also specified.
      methodName: 'methodname',
      serviceName: 'servicename',
      metadata: [
        // All specified metadata must match for the route to match.
        appmesh.HeaderMatch.valueStartsWith('Content-Type', 'application/'),
        appmesh.HeaderMatch.valueDoesNotStartWith('Content-Type', 'text/'),
      ],
    },
  }),
});

Properties

NameTypeDescription
metadata?HeaderMatch[]Create metadata based gRPC route match.
methodName?stringThe method name to match from the request.
port?numberThe port to match from the request.
serviceName?stringCreate service name based gRPC route match.

metadata?

Type: HeaderMatch[] (optional, default: do not match on metadata)

Create metadata based gRPC route match.

All specified metadata must match for the route to match.


methodName?

Type: string (optional, default: do not match on method name)

The method name to match from the request.

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


port?

Type: number (optional, default: do not match on port)

The port to match from the request.


serviceName?

Type: string (optional, default: do not match on service name)

Create service name based gRPC route match.