RouteBaseProps

class aws_cdk.aws_appmesh.RouteBaseProps(*, route_name=None, route_spec)

Bases: object

Base interface properties for all Routes.

Parameters
  • route_name (Optional[str]) – The name of the route. Default: - An automatically generated name

  • route_spec (RouteSpec) – Protocol specific spec.

Example:

# router is of type VirtualRouter
# node is of type VirtualNode


router.add_route("route-http2-retry",
    route_spec=appmesh.RouteSpec.http2(
        weighted_targets=[appmesh.WeightedTarget(virtual_node=node)],
        retry_policy=appmesh.HttpRetryPolicy(
            # Retry if the connection failed
            tcp_retry_events=[appmesh.TcpRetryEvent.CONNECTION_ERROR],
            # Retry if HTTP responds with a gateway error (502, 503, 504)
            http_retry_events=[appmesh.HttpRetryEvent.GATEWAY_ERROR],
            # Retry five times
            retry_attempts=5,
            # Use a 1 second timeout per retry
            retry_timeout=cdk.Duration.seconds(1)
        )
    )
)

Attributes

route_name

The name of the route.

Default
  • An automatically generated name

Return type

Optional[str]

route_spec

Protocol specific spec.

Return type

RouteSpec