aws-cdk-lib.aws_appmesh.HttpRouteSpecOptions

interface HttpRouteSpecOptions

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

Properties specific for HTTP Based Routes.

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

Properties

NameTypeDescription
weightedTargetsWeightedTarget[]List of targets that traffic is routed to when a request matches the route.
match?HttpRouteMatchThe criterion for determining a request match for this Route.
priority?numberThe priority for the route.
retryPolicy?HttpRetryPolicyThe retry policy.
timeout?HttpTimeoutAn object that represents a http timeout.

weightedTargets

Type: WeightedTarget[]

List of targets that traffic is routed to when a request matches the route.


match?

Type: HttpRouteMatch (optional, default: matches on '/')

The criterion for determining a request match for this Route.


priority?

Type: number (optional, default: no particular priority)

The priority for the route.

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?

Type: HttpRetryPolicy (optional, default: no retry policy)

The retry policy.


timeout?

Type: HttpTimeout (optional, default: None)

An object that represents a http timeout.