class HttpRoutePathMatch
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.AppMesh.HttpRoutePathMatch |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsappmesh#HttpRoutePathMatch |
Java | software.amazon.awscdk.services.appmesh.HttpRoutePathMatch |
Python | aws_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
| Name | Description |
|---|---|
| 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 starts | The value of the path must match the specified prefix. |
bind(scope)
public bind(scope: Construct): HttpRoutePathMatchConfig
Parameters
- scope
Construct
Returns
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
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
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
The value of the path must match the specified prefix.

.NET
Go
Java
Python
TypeScript (