aws-cdk-lib.aws_appmesh.HttpRoutePathMatch

class HttpRoutePathMatch

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

Defines HTTP route matching based on the URL path of the request.

Example

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

router.addRoute('route-http', {
  routeSpec: appmesh.RouteSpec.http({
    weightedTargets: [
      {
        virtualNode: node,
        weight: 50,
      },
      {
        virtualNode: node,
        weight: 50,
      },
    ],
    match: {
      path: appmesh.HttpRoutePathMatch.startsWith('/path-to-app'),
    },
  }),
});

Initializer

new HttpRoutePathMatch()

Methods

NameDescription
bind(scope)Returns the route path match configuration.
static exactly(path)The value of the path must match the specified value exactly.
static regex(regex)The value of the path must match the specified regex.
static startsWith(prefix)The value of the path must match the specified prefix.

bind(scope)

public bind(scope: Construct): HttpRoutePathMatchConfig

Parameters

  • scope Construct

Returns

  • HttpRoutePathMatchConfig

Returns the route path match configuration.


static exactly(path)

public static exactly(path: string): HttpRoutePathMatch

Parameters

  • path string — the exact path to match on.

Returns

  • HttpRoutePathMatch

The value of the path must match the specified value exactly.

The provided path must start with the '/' character.


static regex(regex)

public static regex(regex: string): HttpRoutePathMatch

Parameters

  • regex string — the regex used to match the path.

Returns

  • HttpRoutePathMatch

The value of the path must match the specified regex.


static startsWith(prefix)

public static startsWith(prefix: string): HttpRoutePathMatch

Parameters

  • prefix string — the value to use to match the beginning of the path part of the URL of the request.

Returns

  • HttpRoutePathMatch

The value of the path must match the specified prefix.