# HttpGatewayRouteMatch

The criterion for determining a request match for this GatewayRoute.

- Source: [`aws-appmesh/lib/gateway-route-spec.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-appmesh/lib/gateway-route-spec.ts#L66)
- Type last changed: v2.77.0 · 26 Apr 2023

## Example

```ts
declare const gateway: appmesh.VirtualGateway;
declare const virtualService: appmesh.VirtualService;

gateway.addGatewayRoute('gateway-route-http-2', {
  routeSpec: appmesh.GatewayRouteSpec.http({
    routeTarget: virtualService,
    match: {
      // This rewrites the path from '/test' to '/rewrittenPath'.
      path: appmesh.HttpGatewayRoutePathMatch.exactly('/test', '/rewrittenPath'),
    },
  }),
});
```

## Properties

- `headers`: [HeaderMatch](/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.HeaderMatch.html)[] — Specifies the client request headers to match on.

  **Default:** do not match on headers

  All specified headers
  must match for the gateway route to match.

- `hostname`: [GatewayRouteHostnameMatch](/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.GatewayRouteHostnameMatch.html) — The gateway route host name to be matched on.

  **Default:** do not match on host name

- `method`: [HttpRouteMethod](/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.HttpRouteMethod.html) — The method to match on.

  **Default:** do not match on method

- `path`: [HttpGatewayRoutePathMatch](/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.HttpGatewayRoutePathMatch.html) — Specify how to match requests based on the 'path' part of their URL.

  **Default:** matches requests with any path

- `port`: number — The port number to match on.

  **Default:** no default port

- `queryParameters`: [QueryParameterMatch](/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.QueryParameterMatch.html)[] — The query parameters to match on.

  **Default:** do not match on query parameters

  All specified query parameters must match for the route to match.

- `rewriteRequestHostname`: boolean = true — When `true`, rewrites the original request received at the Virtual Gateway to the destination Virtual Service name.

  When `false`, retains the original hostname from the request.
