# GrpcRetryEvent

gRPC events.

- 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#L310)

## 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: { serviceName: 'servicename' },
    retryPolicy: {
      tcpRetryEvents: [appmesh.TcpRetryEvent.CONNECTION_ERROR],
      httpRetryEvents: [appmesh.HttpRetryEvent.GATEWAY_ERROR],
      // Retry if gRPC responds that the request was cancelled, a resource
      // was exhausted, or if the service is unavailable
      grpcRetryEvents: [
        appmesh.GrpcRetryEvent.CANCELLED,
        appmesh.GrpcRetryEvent.RESOURCE_EXHAUSTED,
        appmesh.GrpcRetryEvent.UNAVAILABLE,
      ],
      retryAttempts: 5,
      retryTimeout: Duration.seconds(1),
    },
  }),
});
```

## Members

| Member | Description |
| --- | --- |
| `CANCELLED` | Request was cancelled. |
| `DEADLINE_EXCEEDED` | The deadline was exceeded. |
| `INTERNAL_ERROR` | Internal error. |
| `RESOURCE_EXHAUSTED` | A resource was exhausted. |
| `UNAVAILABLE` | The service is unavailable. |

## Referenced by

- [`GrpcRetryPolicy`](/v2/docs/aws-cdk-lib.aws_appmesh.GrpcRetryPolicy).grpcRetryEvents
