Skip to content
v2.274.0

GrpcRetryPolicy Struct ​

gRPC retry policy.

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),
    },
  }),
});

Properties ​

grpcRetryEventsGrpcRetryEvent[]grpc_retry_eventstyping.List[GrpcRetryEvent]grpcRetryEventsList<GrpcRetryEvent>GrpcRetryEventsGrpcRetryEvent[]GrpcRetryEvents*[]GrpcRetryEvent#
gRPC events on which to retry.

Default: no retries for gRPC events

You must specify at least one value for at least one types of retry events.

httpRetryEventsHttpRetryEvent[]http_retry_eventstyping.List[HttpRetryEvent]httpRetryEventsList<HttpRetryEvent>HttpRetryEventsHttpRetryEvent[]HttpRetryEvents*[]HttpRetryEvent#
Specify HTTP events on which to retry.

Default: no retries for http events

You must specify at least one value for at least one types of retry events.

retryAttemptsnumberretry_attemptsint | floatretryAttemptsNumberRetryAttemptsdoubleRetryAttempts*float64required#
The maximum number of retry attempts.
retryTimeoutDurationretry_timeoutDurationretryTimeoutDurationRetryTimeoutDurationRetryTimeoutDurationrequired#
The timeout for each retry attempt.
tcpRetryEventsTcpRetryEvent[]tcp_retry_eventstyping.List[TcpRetryEvent]tcpRetryEventsList<TcpRetryEvent>TcpRetryEventsTcpRetryEvent[]TcpRetryEvents*[]TcpRetryEvent#
TCP events on which to retry.

Default: no retries for tcp events

The event occurs before any processing of a request has started and is encountered when the upstream is temporarily or permanently unavailable. You must specify at least one value for at least one types of retry events.