HttpGatewayRouteMatch¶
-
class
aws_cdk.aws_appmesh.
HttpGatewayRouteMatch
(*, headers=None, hostname=None, method=None, path=None, query_parameters=None, rewrite_request_hostname=None)¶ Bases:
object
The criterion for determining a request match for this GatewayRoute.
- Parameters
headers (
Optional
[Sequence
[HeaderMatch
]]) – Specifies the client request headers to match on. All specified headers must match for the gateway route to match. Default: - do not match on headershostname (
Optional
[GatewayRouteHostnameMatch
]) – The gateway route host name to be matched on. Default: - do not match on host namemethod (
Optional
[HttpRouteMethod
]) – The method to match on. Default: - do not match on methodpath (
Optional
[HttpGatewayRoutePathMatch
]) – Specify how to match requests based on the ‘path’ part of their URL. Default: - matches requests with any pathquery_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 parametersrewrite_request_hostname (
Optional
[bool
]) – Whentrue
, rewrites the original request received at the Virtual Gateway to the destination Virtual Service name. Whenfalse
, retains the original hostname from the request. Default: true
- ExampleMetadata
infused
Example:
# 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") ) ) )
Attributes
-
headers
¶ Specifies the client request headers to match on.
All specified headers must match for the gateway route to match.
- Default
do not match on headers
- Return type
Optional
[List
[HeaderMatch
]]
-
hostname
¶ The gateway route host name to be matched on.
- Default
do not match on host name
- Return type
Optional
[GatewayRouteHostnameMatch
]
-
method
¶ The method to match on.
- Default
do not match on method
- Return type
Optional
[HttpRouteMethod
]
-
path
¶ Specify how to match requests based on the ‘path’ part of their URL.
- Default
matches requests with any path
- Return type
Optional
[HttpGatewayRoutePathMatch
]
-
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
- Return type
Optional
[List
[QueryParameterMatch
]]
-
rewrite_request_hostname
¶ When
true
, rewrites the original request received at the Virtual Gateway to the destination Virtual Service name.When
false
, retains the original hostname from the request.- Default
true
- Return type
Optional
[bool
]