# GrpcRouteSpecOptions

Properties specific for a GRPC Based Routes.

Extends: GrpcRouteSpecOptions
Extends: RouteSpecOptionsBase

- Source: [`aws-appmesh/lib/route-spec.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-appmesh/lib/route-spec.ts#L270)

## Example

```ts
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

- `match`: [GrpcRouteMatch](/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.GrpcRouteMatch.html) (required) — The criterion for determining a request match for this Route.

- `priority`: number — The priority for the route.

  **Default:** no particular priority

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

- `retryPolicy`: [GrpcRetryPolicy](/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.GrpcRetryPolicy.html) — The retry policy.

  **Default:** no retry policy

- `timeout`: [GrpcTimeout](/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.GrpcTimeout.html) = None — An object that represents a grpc timeout.

- `weightedTargets`: [WeightedTarget](/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.WeightedTarget.html)[] (required) — List of targets that traffic is routed to when a request matches the route.
