# HttpRouteSpecOptions

Properties specific for HTTP Based Routes.

Extends: HttpRouteSpecOptions
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#L154)

## Example

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

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

  **Default:** matches on '/'

- `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`: [HttpRetryPolicy](/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.HttpRetryPolicy.html) — The retry policy.

  **Default:** no retry policy

- `timeout`: [HttpTimeout](/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.HttpTimeout.html) = None — An object that represents a http 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.
