interface HttpRouteSpecOptions
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.AppMesh.HttpRouteSpecOptions |
![]() | software.amazon.awscdk.services.appmesh.HttpRouteSpecOptions |
![]() | aws_cdk.aws_appmesh.HttpRouteSpecOptions |
![]() | @aws-cdk/aws-appmesh » HttpRouteSpecOptions |
Properties specific for HTTP Based Routes.
Example
declare const router: appmesh.VirtualRouter;
declare const node: appmesh.VirtualNode;
router.addRoute('route-http2-retry', {
routeSpec: appmesh.RouteSpec.http2({
weightedTargets: [{ virtualNode: node }],
retryPolicy: {
// Retry if the connection failed
tcpRetryEvents: [appmesh.TcpRetryEvent.CONNECTION_ERROR],
// Retry if HTTP responds with a gateway error (502, 503, 504)
httpRetryEvents: [appmesh.HttpRetryEvent.GATEWAY_ERROR],
// Retry five times
retryAttempts: 5,
// Use a 1 second timeout per retry
retryTimeout: cdk.Duration.seconds(1),
},
}),
});
Properties
Name | Type | Description |
---|---|---|
weighted | Weighted [] | List of targets that traffic is routed to when a request matches the route. |
match? | Http | The criterion for determining a request match for this Route. |
priority? | number | The priority for the route. |
retry | Http | The retry policy. |
timeout? | Http | An object that represents a http timeout. |
weightedTargets
Type:
Weighted
[]
List of targets that traffic is routed to when a request matches the route.
match?
Type:
Http
(optional, default: matches on '/')
The criterion for determining a request match for this Route.
priority?
Type:
number
(optional, default: no particular 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.
retryPolicy?
Type:
Http
(optional, default: no retry policy)
The retry policy.
timeout?
Type:
Http
(optional, default: None)
An object that represents a http timeout.