GrpcRouteSpecOptions

class aws_cdk.aws_appmesh.GrpcRouteSpecOptions(*, priority=None, match, weighted_targets, retry_policy=None, timeout=None)

Bases: aws_cdk.aws_appmesh.RouteSpecOptionsBase

Properties specific for a GRPC Based Routes.

Parameters
  • priority (Union[int, float, None]) – The priority for the route. When a Virtual Router has multiple routes, route match is performed in the order of specified value, where 0 is the highest priority, and first matched route is selected. Default: - no particular priority

  • match (GrpcRouteMatch) – The criterion for determining a request match for this Route.

  • weighted_targets (Sequence[WeightedTarget]) – List of targets that traffic is routed to when a request matches the route.

  • retry_policy (Optional[GrpcRetryPolicy]) – The retry policy. Default: - no retry policy

  • timeout (Optional[GrpcTimeout]) – An object that represents a grpc timeout. Default: - None

ExampleMetadata

infused

Example:

# router: appmesh.VirtualRouter
# node: appmesh.VirtualNode


router.add_route("route-http",
    route_spec=appmesh.RouteSpec.grpc(
        weighted_targets=[appmesh.WeightedTarget(
            virtual_node=node
        )
        ],
        match=appmesh.GrpcRouteMatch(
            service_name="my-service.default.svc.cluster.local"
        ),
        timeout=appmesh.GrpcTimeout(
            idle=cdk.Duration.seconds(2),
            per_request=cdk.Duration.seconds(1)
        )
    )
)

Attributes

match

The criterion for determining a request match for this Route.

Return type

GrpcRouteMatch

priority

The priority for the route.

When a Virtual Router has multiple routes, route match is performed in the order of specified value, where 0 is the highest priority, and first matched route is selected.

Default
  • no particular priority

Return type

Union[int, float, None]

retry_policy

The retry policy.

Default
  • no retry policy

Return type

Optional[GrpcRetryPolicy]

timeout

An object that represents a grpc timeout.

Default
  • None

Return type

Optional[GrpcTimeout]

weighted_targets

List of targets that traffic is routed to when a request matches the route.

Return type

List[WeightedTarget]