HttpGatewayRouteSpecOptions Struct
Properties specific for HTTP Based GatewayRoutes.
Example
ts
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'),
},
}),
});
python
# gateway: appmesh.VirtualGateway
# virtual_service: appmesh.VirtualService
gateway.add_gateway_route("gateway-route-http-2",
route_spec=appmesh.GatewayRouteSpec.http(
route_target=virtual_service,
match=appmesh.HttpGatewayRouteMatch(
# This rewrites the path from '/test' to '/rewrittenPath'.
path=appmesh.HttpGatewayRoutePathMatch.exactly("/test", "/rewrittenPath")
)
)
)
java
VirtualGateway gateway;
VirtualService virtualService;
gateway.addGatewayRoute("gateway-route-http-2", GatewayRouteBaseProps.builder()
.routeSpec(GatewayRouteSpec.http(HttpGatewayRouteSpecOptions.builder()
.routeTarget(virtualService)
.match(HttpGatewayRouteMatch.builder()
// This rewrites the path from '/test' to '/rewrittenPath'.
.path(HttpGatewayRoutePathMatch.exactly("/test", "/rewrittenPath"))
.build())
.build()))
.build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
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")
}
})
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var gateway VirtualGateway
var virtualService VirtualService
gateway.addGatewayRoute(jsii.String("gateway-route-http-2"), &GatewayRouteBaseProps{
RouteSpec: appmesh.GatewayRouteSpec_Http(&HttpGatewayRouteSpecOptions{
RouteTarget: virtualService,
Match: &HttpGatewayRouteMatch{
// This rewrites the path from '/test' to '/rewrittenPath'.
Path: appmesh.HttpGatewayRoutePathMatch_Exactly(jsii.String("/test"), jsii.String("/rewrittenPath")),
},
}),
})
Properties
matchoptionalHttpGatewayRouteMatchmatchoptionalHttpGatewayRouteMatchmatchoptionalHttpGatewayRouteMatchMatchoptionalHttpGatewayRouteMatchMatchoptionalHttpGatewayRouteMatch#The criterion for determining a request match for this GatewayRoute.
Default: matches any path and automatically rewrites the path to '/'
When path match is defined, this may optionally determine the path rewrite configuration.
priorityoptionalnumberpriorityoptionalint | floatpriorityoptionalNumberPriorityoptionaldoublePriorityoptional*float64#The priority for the gateway route.
Default: no particular priority
When a Virtual Gateway has multiple gateway routes, gateway route match is performed in the order of specified value, where 0 is the highest priority, and first matched gateway route is selected.
routeTargetIVirtualServiceroute_targetIVirtualServicerouteTargetIVirtualServiceRouteTargetIVirtualServiceRouteTargetIVirtualServicerequired#The VirtualService this GatewayRoute directs traffic to.