aws-cdk-lib.aws_appmesh.HttpGatewayRouteMatch

interface HttpGatewayRouteMatch

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

The criterion for determining a request match for this GatewayRoute.

Example

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

NameTypeDescription
headers?HeaderMatch[]Specifies the client request headers to match on.
hostname?GatewayRouteHostnameMatchThe gateway route host name to be matched on.
method?HttpRouteMethodThe method to match on.
path?HttpGatewayRoutePathMatchSpecify how to match requests based on the 'path' part of their URL.
port?numberThe port number to match on.
queryParameters?QueryParameterMatch[]The query parameters to match on.
rewriteRequestHostname?booleanWhen true, rewrites the original request received at the Virtual Gateway to the destination Virtual Service name.

headers?

Type: HeaderMatch[] (optional, default: do not match on headers)

Specifies the client request headers to match on.

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


hostname?

Type: GatewayRouteHostnameMatch (optional, default: do not match on host name)

The gateway route host name to be matched on.


method?

Type: HttpRouteMethod (optional, default: do not match on method)

The method to match on.


path?

Type: HttpGatewayRoutePathMatch (optional, default: matches requests with any path)

Specify how to match requests based on the 'path' part of their URL.


port?

Type: number (optional, default: no default port)

The port number to match on.


queryParameters?

Type: QueryParameterMatch[] (optional, default: do not match on query parameters)

The query parameters to match on.

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


rewriteRequestHostname?

Type: boolean (optional, default: 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.