aws-cdk-lib.aws_appmesh.HttpRetryEvent

enum HttpRetryEvent

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

HTTP events on which to retry.

Example

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

router.addRoute('route-http2-retry', {
  routeSpec: appmesh.RouteSpec.http2({
    weightedTargets: [{ virtualNode: node }],
    retryPolicy: {
      // Retry if the connection failed
      tcpRetryEvents: [appmesh.TcpRetryEvent.CONNECTION_ERROR],
      // Retry if HTTP responds with a gateway error (502, 503, 504)
      httpRetryEvents: [appmesh.HttpRetryEvent.GATEWAY_ERROR],
      // Retry five times
      retryAttempts: 5,
      // Use a 1 second timeout per retry
      retryTimeout: Duration.seconds(1),
    },
  }),
});

Members

NameDescription
SERVER_ERRORHTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511.
GATEWAY_ERRORHTTP status codes 502, 503, and 504.
CLIENT_ERRORHTTP status code 409.
STREAM_ERRORRetry on refused stream.

SERVER_ERROR

HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511.


GATEWAY_ERROR

HTTP status codes 502, 503, and 504.


CLIENT_ERROR

HTTP status code 409.


STREAM_ERROR

Retry on refused stream.