Skip to content
v2.275.0

CfnRouteProps Struct ​

Properties for defining a CfnRoute.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_appmesh as appmesh } from 'aws-cdk-lib';
const cfnRouteProps: appmesh.CfnRouteProps = {
  meshName: 'meshName',
  spec: {
    grpcRoute: {
      action: {
        weightedTargets: [{
          virtualNode: 'virtualNode',
          weight: 123,

          // the properties below are optional
          port: 123,
        }],
      },
      match: {
        metadata: [{
          name: 'name',

          // the properties below are optional
          invert: false,
          match: {
            exact: 'exact',
            prefix: 'prefix',
            range: {
              end: 123,
              start: 123,
            },
            regex: 'regex',
            suffix: 'suffix',
          },
        }],
        methodName: 'methodName',
        port: 123,
        serviceName: 'serviceName',
      },

      // the properties below are optional
      retryPolicy: {
        maxRetries: 123,
        perRetryTimeout: {
          unit: 'unit',
          value: 123,
        },

        // the properties below are optional
        grpcRetryEvents: ['grpcRetryEvents'],
        httpRetryEvents: ['httpRetryEvents'],
        tcpRetryEvents: ['tcpRetryEvents'],
      },
      timeout: {
        idle: {
          unit: 'unit',
          value: 123,
        },
        perRequest: {
          unit: 'unit',
          value: 123,
        },
      },
    },
    http2Route: {
      action: {
        weightedTargets: [{
          virtualNode: 'virtualNode',
          weight: 123,

          // the properties below are optional
          port: 123,
        }],
      },
      match: {
        headers: [{
          name: 'name',

          // the properties below are optional
          invert: false,
          match: {
            exact: 'exact',
            prefix: 'prefix',
            range: {
              end: 123,
              start: 123,
            },
            regex: 'regex',
            suffix: 'suffix',
          },
        }],
        method: 'method',
        path: {
          exact: 'exact',
          regex: 'regex',
        },
        port: 123,
        prefix: 'prefix',
        queryParameters: [{
          name: 'name',

          // the properties below are optional
          match: {
            exact: 'exact',
          },
        }],
        scheme: 'scheme',
      },

      // the properties below are optional
      retryPolicy: {
        maxRetries: 123,
        perRetryTimeout: {
          unit: 'unit',
          value: 123,
        },

        // the properties below are optional
        httpRetryEvents: ['httpRetryEvents'],
        tcpRetryEvents: ['tcpRetryEvents'],
      },
      timeout: {
        idle: {
          unit: 'unit',
          value: 123,
        },
        perRequest: {
          unit: 'unit',
          value: 123,
        },
      },
    },
    httpRoute: {
      action: {
        weightedTargets: [{
          virtualNode: 'virtualNode',
          weight: 123,

          // the properties below are optional
          port: 123,
        }],
      },
      match: {
        headers: [{
          name: 'name',

          // the properties below are optional
          invert: false,
          match: {
            exact: 'exact',
            prefix: 'prefix',
            range: {
              end: 123,
              start: 123,
            },
            regex: 'regex',
            suffix: 'suffix',
          },
        }],
        method: 'method',
        path: {
          exact: 'exact',
          regex: 'regex',
        },
        port: 123,
        prefix: 'prefix',
        queryParameters: [{
          name: 'name',

          // the properties below are optional
          match: {
            exact: 'exact',
          },
        }],
        scheme: 'scheme',
      },

      // the properties below are optional
      retryPolicy: {
        maxRetries: 123,
        perRetryTimeout: {
          unit: 'unit',
          value: 123,
        },

        // the properties below are optional
        httpRetryEvents: ['httpRetryEvents'],
        tcpRetryEvents: ['tcpRetryEvents'],
      },
      timeout: {
        idle: {
          unit: 'unit',
          value: 123,
        },
        perRequest: {
          unit: 'unit',
          value: 123,
        },
      },
    },
    priority: 123,
    tcpRoute: {
      action: {
        weightedTargets: [{
          virtualNode: 'virtualNode',
          weight: 123,

          // the properties below are optional
          port: 123,
        }],
      },

      // the properties below are optional
      match: {
        port: 123,
      },
      timeout: {
        idle: {
          unit: 'unit',
          value: 123,
        },
      },
    },
  },
  virtualRouterName: 'virtualRouterName',

  // the properties below are optional
  meshOwner: 'meshOwner',
  routeName: 'routeName',
  tags: [{
    key: 'key',
    value: 'value',
  }],
};

Properties ​

meshNamestringmesh_namestrmeshNameStringMeshNamestringMeshName*stringrequired#
The name of the service mesh to create the route in.
meshOwneroptionalstringmesh_owneroptionalstrmeshOwneroptionalStringMeshOwneroptionalstringMeshOwneroptional*string#
The AWS IAM account ID of the service mesh owner.
notes

If the account ID is not your own, then the account that you specify must share the mesh with your account before you can create the resource in the service mesh. For more information about mesh sharing, see Working with shared meshes .

routeNameoptionalstringroute_nameoptionalstrrouteNameoptionalStringRouteNameoptionalstringRouteNameoptional*string#
The name to use for the route.
The route specification to apply.
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag#
Optional metadata that you can apply to the route to assist with categorization and organization.

Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

virtualRouterNamestringvirtual_router_namestrvirtualRouterNameStringVirtualRouterNamestringVirtualRouterName*stringrequired#
The name of the virtual router in which to create the route.

If the virtual router is in a shared mesh, then you must be the owner of the virtual router resource.