GatewayRouteSpec

class aws_cdk.aws_appmesh.GatewayRouteSpec

Bases: object

Used to generate specs with different protocols for a GatewayRoute.

ExampleMetadata

infused

Example:

# gateway: appmesh.VirtualGateway
# virtual_service: appmesh.VirtualService


gateway.add_gateway_route("gateway-route-grpc",
    route_spec=appmesh.GatewayRouteSpec.grpc(
        route_target=virtual_service,
        match=appmesh.GrpcGatewayRouteMatch(
            hostname=appmesh.GatewayRouteHostnameMatch.exactly("example.com"),
            # This disables the default rewrite to virtual service name and retain original request.
            rewrite_request_hostname=False
        )
    )
)

Methods

abstract bind(scope)

Called when the GatewayRouteSpec type is initialized.

Can be used to enforce mutual exclusivity with future properties

Parameters

scope (Construct) –

Return type

GatewayRouteSpecConfig

Static Methods

classmethod grpc(*, match, route_target, priority=None)

Creates an gRPC Based GatewayRoute.

Parameters
  • match (GrpcGatewayRouteMatch) – The criterion for determining a request match for this GatewayRoute.

  • route_target (IVirtualService) – The VirtualService this GatewayRoute directs traffic to.

  • priority (Union[int, float, None]) – The priority for the gateway route. 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. Default: - no particular priority

Return type

GatewayRouteSpec

classmethod http(*, route_target, match=None, priority=None)

Creates an HTTP Based GatewayRoute.

Parameters
  • route_target (IVirtualService) – The VirtualService this GatewayRoute directs traffic to.

  • match (Optional[HttpGatewayRouteMatch]) – The criterion for determining a request match for this GatewayRoute. When path match is defined, this may optionally determine the path rewrite configuration. Default: - matches any path and automatically rewrites the path to ‘/’

  • priority (Union[int, float, None]) – The priority for the gateway route. 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. Default: - no particular priority

Return type

GatewayRouteSpec

classmethod http2(*, route_target, match=None, priority=None)

Creates an HTTP2 Based GatewayRoute.

Parameters
  • route_target (IVirtualService) – The VirtualService this GatewayRoute directs traffic to.

  • match (Optional[HttpGatewayRouteMatch]) – The criterion for determining a request match for this GatewayRoute. When path match is defined, this may optionally determine the path rewrite configuration. Default: - matches any path and automatically rewrites the path to ‘/’

  • priority (Union[int, float, None]) – The priority for the gateway route. 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. Default: - no particular priority

Return type

GatewayRouteSpec