Skip to content
v2.274.0

HttpRoutePathMatch Class ​

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

Example ​

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

ts
new HttpRoutePathMatch()
python
HttpRoutePathMatch()
java
new HttpRoutePathMatch()
csharp
new HttpRoutePathMatch()
go
NewHttpRoutePathMatch()

Methods ​

bind(scope: Construct): HttpRoutePathMatchConfigdef bind(self, scope: Construct) -> HttpRoutePathMatchConfigpublic HttpRoutePathMatchConfig bind(Construct scope)public HttpRoutePathMatchConfig Bind(Construct scope)func Bind(Scope Construct) HttpRoutePathMatchConfig#
Returns the route path match configuration.
exactly(path: string): HttpRoutePathMatch // chainable@staticmethod def exactly(path: str) -> HttpRoutePathMatchpublic static HttpRoutePathMatch exactly(String path)public static HttpRoutePathMatch Exactly(string path)func Exactly(Path *string) HttpRoutePathMatchstatic#
The value of the path must match the specified value exactly.

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

1 parameter

Parameters

  • pathpathpathpathPath — the exact path to match on.
regex(regex: string): HttpRoutePathMatch // chainable@staticmethod def regex(regex: str) -> HttpRoutePathMatchpublic static HttpRoutePathMatch regex(String regex)public static HttpRoutePathMatch Regex(string regex)func Regex(Regex *string) HttpRoutePathMatchstatic#
The value of the path must match the specified regex.
1 parameter

Parameters

  • regexregexregexregexRegex — the regex used to match the path.
startsWith(prefix: string): HttpRoutePathMatch // chainable@staticmethod def starts_with(prefix: str) -> HttpRoutePathMatchpublic static HttpRoutePathMatch startsWith(String prefix)public static HttpRoutePathMatch StartsWith(string prefix)func StartsWith(Prefix *string) HttpRoutePathMatchstatic#
The value of the path must match the specified prefix.
1 parameter

Parameters

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