Class HttpGatewayRoutePathMatch
Defines HTTP gateway route matching based on the URL path of the request.
Inheritance
Namespace: Amazon.CDK.AWS.AppMesh
Assembly: Amazon.CDK.AWS.AppMesh.dll
Syntax (csharp)
public abstract class HttpGatewayRoutePathMatch : DeputyBase
Syntax (vb)
Public MustInherit Class HttpGatewayRoutePathMatch
Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
VirtualGateway gateway;
VirtualService virtualService;
gateway.AddGatewayRoute("gateway-route-http-2", new GatewayRouteBaseProps {
RouteSpec = GatewayRouteSpec.Http(new HttpGatewayRouteSpecOptions {
RouteTarget = virtualService,
Match = new HttpGatewayRouteMatch {
// This rewrites the path from '/test' to '/rewrittenPath'.
Path = HttpGatewayRoutePathMatch.Exactly("/test", "/rewrittenPath")
}
})
});
Synopsis
Constructors
HttpGatewayRoutePathMatch() | |
HttpGatewayRoutePathMatch(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
HttpGatewayRoutePathMatch(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
Bind(Construct) | Returns the gateway route path match configuration. |
Exactly(String, String) | The value of the path must match the specified value exactly. |
Regex(String, String) | The value of the path must match the specified regex. |
StartsWith(String, String) | The value of the path must match the specified prefix. |
Constructors
HttpGatewayRoutePathMatch()
protected HttpGatewayRoutePathMatch()
HttpGatewayRoutePathMatch(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected HttpGatewayRoutePathMatch(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
HttpGatewayRoutePathMatch(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected HttpGatewayRoutePathMatch(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
Bind(Construct)
Returns the gateway route path match configuration.
public abstract IHttpGatewayRoutePathMatchConfig Bind(Construct scope)
Parameters
- scope Construct
Returns
IHttpGatewayRoutePathMatchConfig
Exactly(String, String)
The value of the path must match the specified value exactly.
public static HttpGatewayRoutePathMatch Exactly(string path, string rewriteTo = null)
Parameters
- path System.String
the exact path to match on.
- rewriteTo System.String
the value to substitute for the matched part of the path of the gateway request URL As a default, retains original request's URL path.
Returns
Remarks
The provided path
must start with the '/' character.
Regex(String, String)
The value of the path must match the specified regex.
public static HttpGatewayRoutePathMatch Regex(string regex, string rewriteTo = null)
Parameters
- regex System.String
the regex used to match the path.
- rewriteTo System.String
the value to substitute for the matched part of the path of the gateway request URL As a default, retains original request's URL path.
Returns
StartsWith(String, String)
The value of the path must match the specified prefix.
public static HttpGatewayRoutePathMatch StartsWith(string prefix, string rewriteTo = null)
Parameters
- prefix System.String
the value to use to match the beginning of the path part of the URL of the request.
- rewriteTo System.String
Specify either disabling automatic rewrite or rewriting to specified prefix path.
Returns