aws-cdk-lib.aws_appmesh.GrpcRouteSpecOptions

interface GrpcRouteSpecOptions

LanguageType name
.NETAmazon.CDK.AWS.AppMesh.GrpcRouteSpecOptions
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsappmesh#GrpcRouteSpecOptions
Javasoftware.amazon.awscdk.services.appmesh.GrpcRouteSpecOptions
Pythonaws_cdk.aws_appmesh.GrpcRouteSpecOptions
TypeScript (source)aws-cdk-lib » aws_appmesh » GrpcRouteSpecOptions

Properties specific for a GRPC Based Routes.

Example

declare const router: appmesh.VirtualRouter;
declare const node: appmesh.VirtualNode;

router.addRoute('route-grpc-retry', {
  routeSpec: appmesh.RouteSpec.grpc({
    weightedTargets: [{ virtualNode: node }],
    match: {
      // When method name is specified, service name must be also specified.
      methodName: 'methodname',
      serviceName: 'servicename',
      metadata: [
        // All specified metadata must match for the route to match.
        appmesh.HeaderMatch.valueStartsWith('Content-Type', 'application/'),
        appmesh.HeaderMatch.valueDoesNotStartWith('Content-Type', 'text/'),
      ],
    },
  }),
});

Properties

NameTypeDescription
matchGrpcRouteMatchThe criterion for determining a request match for this Route.
weightedTargetsWeightedTarget[]List of targets that traffic is routed to when a request matches the route.
priority?numberThe priority for the route.
retryPolicy?GrpcRetryPolicyThe retry policy.
timeout?GrpcTimeoutAn object that represents a grpc timeout.

match

Type: GrpcRouteMatch

The criterion for determining a request match for this Route.


weightedTargets

Type: WeightedTarget[]

List of targets that traffic is routed to when a request matches the 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: GrpcRetryPolicy (optional, default: no retry policy)

The retry policy.


timeout?

Type: GrpcTimeout (optional, default: None)

An object that represents a grpc timeout.