GrpcRetryEvent

class aws_cdk.aws_appmesh.GrpcRetryEvent(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

gRPC events.

ExampleMetadata:

infused

Example:

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


router.add_route("route-grpc-retry",
    route_spec=appmesh.RouteSpec.grpc(
        weighted_targets=[appmesh.WeightedTarget(virtual_node=node)],
        match=appmesh.GrpcRouteMatch(service_name="servicename"),
        retry_policy=appmesh.GrpcRetryPolicy(
            tcp_retry_events=[appmesh.TcpRetryEvent.CONNECTION_ERROR],
            http_retry_events=[appmesh.HttpRetryEvent.GATEWAY_ERROR],
            # Retry if gRPC responds that the request was cancelled, a resource
            # was exhausted, or if the service is unavailable
            grpc_retry_events=[appmesh.GrpcRetryEvent.CANCELLED, appmesh.GrpcRetryEvent.RESOURCE_EXHAUSTED, appmesh.GrpcRetryEvent.UNAVAILABLE
            ],
            retry_attempts=5,
            retry_timeout=Duration.seconds(1)
        )
    )
)

Attributes

CANCELLED

Request was cancelled.

See:

https://grpc.github.io/grpc/core/md_doc_statuscodes.html

DEADLINE_EXCEEDED

The deadline was exceeded.

See:

https://grpc.github.io/grpc/core/md_doc_statuscodes.html

INTERNAL_ERROR

Internal error.

See:

https://grpc.github.io/grpc/core/md_doc_statuscodes.html

RESOURCE_EXHAUSTED

A resource was exhausted.

See:

https://grpc.github.io/grpc/core/md_doc_statuscodes.html

UNAVAILABLE

The service is unavailable.

See:

https://grpc.github.io/grpc/core/md_doc_statuscodes.html