GatewayRouteSpec

class aws_cdk.aws_appmesh.GatewayRouteSpec

Bases: object

Used to generate specs with different protocols for a GatewayRoute.

Example:

# gateway is of type VirtualGateway
# virtual_service is of type 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)

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.

Return type

GatewayRouteSpec

classmethod http(*, match=None, route_target)

Creates an HTTP Based GatewayRoute.

Parameters
  • 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 ‘/’

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

Return type

GatewayRouteSpec

classmethod http2(*, match=None, route_target)

Creates an HTTP2 Based GatewayRoute.

Parameters
  • 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 ‘/’

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

Return type

GatewayRouteSpec