HttpRouteMatch
- class aws_cdk.aws_appmesh.HttpRouteMatch(*, headers=None, method=None, path=None, port=None, protocol=None, query_parameters=None)
Bases:
object
The criterion for determining a request match for this Route.
- Parameters:
headers (
Optional
[Sequence
[HeaderMatch
]]) – Specifies the client request headers to match on. All specified headers must match for the route to match. Default: - do not match on headersmethod (
Optional
[HttpRouteMethod
]) – The HTTP client request method to match on. Default: - do not match on request methodpath (
Optional
[HttpRoutePathMatch
]) – Specifies how is the request matched based on the path part of its URL. Default: - matches requests with all pathsport (
Union
[int
,float
,None
]) – The port to match from the request. Default: - do not match on portprotocol (
Optional
[HttpRouteProtocol
]) – The client request protocol to match on. Applicable only for HTTP2 routes. Default: - do not match on HTTP2 request protocolquery_parameters (
Optional
[Sequence
[QueryParameterMatch
]]) – The query parameters to match on. All specified query parameters must match for the route to match. Default: - do not match on query parameters
- ExampleMetadata:
infused
Example:
# router: appmesh.VirtualRouter # node: appmesh.VirtualNode router.add_route("route-http", route_spec=appmesh.RouteSpec.http( weighted_targets=[appmesh.WeightedTarget( virtual_node=node, weight=50 ), appmesh.WeightedTarget( virtual_node=node, weight=50 ) ], match=appmesh.HttpRouteMatch( path=appmesh.HttpRoutePathMatch.starts_with("/path-to-app") ) ) )
Attributes
- headers
Specifies the client request headers to match on.
All specified headers must match for the route to match.
- Default:
do not match on headers
- method
The HTTP client request method to match on.
- Default:
do not match on request method
- path
Specifies how is the request matched based on the path part of its URL.
- Default:
matches requests with all paths
- port
The port to match from the request.
- Default:
do not match on port
- protocol
The client request protocol to match on.
Applicable only for HTTP2 routes.
- Default:
do not match on HTTP2 request protocol
- query_parameters
The query parameters to match on.
All specified query parameters must match for the route to match.
- Default:
do not match on query parameters