# AWS App Mesh Construct Library

AWS App Mesh is a service mesh based on the [Envoy](https://www.envoyproxy.io/) proxy that makes it easy to monitor and control microservices. App Mesh standardizes how your microservices communicate, giving you end-to-end visibility and helping to ensure high-availability for your applications.

App Mesh gives you consistent visibility and network traffic controls for every microservice in an application.

App Mesh supports microservice applications that use service discovery naming for their components. To use App Mesh, you must have an existing application running on AWS Fargate, Amazon ECS, Amazon EKS, Kubernetes on AWS, or Amazon EC2.

For further information on **AWS App Mesh**, visit the [AWS App Mesh Documentation](https://docs.aws.amazon.com/app-mesh/index.html).

## Create the App and Stack

```ts
const app = new cdk.App();
const stack = new cdk.Stack(app, 'stack');
```

## Creating the Mesh

A service mesh is a logical boundary for network traffic between the services that reside within it.

After you create your service mesh, you can create virtual services, virtual nodes, virtual routers, and routes to distribute traffic between the applications in your mesh.

The following example creates the `AppMesh` service mesh with the default egress filter of `DROP_ALL`. See [the AWS CloudFormation `EgressFilter` resource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-mesh-egressfilter.html) for more info on egress filters.

```ts
const mesh = new appmesh.Mesh(this, 'AppMesh', {
  meshName: 'myAwsMesh',
});
```

The mesh can instead be created with the `ALLOW_ALL` egress filter by providing the `egressFilter` property.

```ts
const mesh = new appmesh.Mesh(this, 'AppMesh', {
  meshName: 'myAwsMesh',
  egressFilter: appmesh.MeshFilterType.ALLOW_ALL,
});
```

A mesh with an IP preference can be created by providing the property `serviceDiscovery` that specifes an `ipPreference`.

```ts
const mesh = new appmesh.Mesh(this, 'AppMesh', {
  meshName: 'myAwsMesh',
  serviceDiscovery: {
    ipPreference: appmesh.IpPreference.IPV4_ONLY,
  },
});
```

## Adding VirtualRouters

A _mesh_ uses  _virtual routers_ as logical units to route requests to _virtual nodes_.

Virtual routers handle traffic for one or more virtual services within your mesh.
After you create a virtual router, you can create and associate routes to your virtual router that direct incoming requests to different virtual nodes.

```ts
declare const mesh: appmesh.Mesh;
const router = mesh.addVirtualRouter('router', {
  listeners: [appmesh.VirtualRouterListener.http(8080)],
});
```

Note that creating the router using the `addVirtualRouter()` method places it in the same stack as the mesh
(which might be different from the current stack).
The router can also be created using the [`VirtualRouter`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualRouter) constructor (passing in the mesh) instead of calling the `addVirtualRouter()` method.
This is particularly useful when splitting your resources between many stacks: for example, defining the mesh itself as part of an infrastructure stack, but defining the other resources, such as routers, in the application stack:

```ts
declare const infraStack: cdk.Stack;
declare const appStack: cdk.Stack;

const mesh = new appmesh.Mesh(infraStack, 'AppMesh', {
  meshName: 'myAwsMesh',
  egressFilter: appmesh.MeshFilterType.ALLOW_ALL,
});

// the VirtualRouter will belong to 'appStack',
// even though the Mesh belongs to 'infraStack'
const router = new appmesh.VirtualRouter(appStack, 'router', {
  mesh, // notice that mesh is a required property when creating a router with the 'new' statement
  listeners: [appmesh.VirtualRouterListener.http(8081)],
});
```

The same is true for other `add*()` methods in the App Mesh construct library.

The [`VirtualRouterListener`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualRouterListener) class lets you define protocol-specific listeners.
The `http()`, `http2()`, `grpc()` and `tcp()` methods create listeners for the named protocols.
They accept a single parameter that defines the port to on which requests will be matched.
The port parameter defaults to 8080 if omitted.

## Adding a VirtualService

A _virtual service_ is an abstraction of a real service that is provided by a virtual node directly, or indirectly by means of a virtual router. Dependent services call your virtual service by its `virtualServiceName`, and those requests are routed to the virtual node or virtual router specified as the provider for the virtual service.

We recommend that you use the service discovery name of the real service that you're targeting (such as `my-service.default.svc.cluster.local`).

When creating a virtual service:

- If you want the virtual service to spread traffic across multiple virtual nodes, specify a virtual router.
- If you want the virtual service to reach a virtual node directly, without a virtual router, specify a virtual node.

Adding a virtual router as the provider:

```ts
declare const router: appmesh.VirtualRouter;

new appmesh.VirtualService(this, 'virtual-service', {
  virtualServiceName: 'my-service.default.svc.cluster.local', // optional
  virtualServiceProvider: appmesh.VirtualServiceProvider.virtualRouter(router),
});
```

Adding a virtual node as the provider:

```ts
declare const node: appmesh.VirtualNode;

new appmesh.VirtualService(this, 'virtual-service', {
  virtualServiceName: `my-service.default.svc.cluster.local`, // optional
  virtualServiceProvider: appmesh.VirtualServiceProvider.virtualNode(node),
});
```

## Adding a VirtualNode

A _virtual node_ acts as a logical pointer to a particular task group, such as an Amazon ECS service or a Kubernetes deployment.

When you create a virtual node, accept inbound traffic by specifying a *listener*. Outbound traffic that your virtual node expects to send should be specified as a *back end*.

The response metadata for your new virtual node contains the Amazon Resource Name (ARN) that is associated with the virtual node. Set this value (either the full ARN or the truncated resource name) as the `APPMESH_VIRTUAL_NODE_NAME` environment variable for your task group's Envoy proxy container in your task definition or pod spec. For example, the value could be `mesh/default/virtualNode/simpleapp`. This is then mapped to the `node.id` and `node.cluster` Envoy parameters.

> **Note**
> If you require your Envoy stats or tracing to use a different name, you can override the `node.cluster` value that is set by `APPMESH_VIRTUAL_NODE_NAME` with the `APPMESH_VIRTUAL_NODE_CLUSTER` environment variable.

```ts
const vpc = new ec2.Vpc(this, 'vpc');
const namespace = new cloudmap.PrivateDnsNamespace(this, 'test-namespace', {
    vpc,
    name: 'domain.local',
});
const service = namespace.createService('Svc');

declare const mesh: appmesh.Mesh;
const node = mesh.addVirtualNode('virtual-node', {
  serviceDiscovery: appmesh.ServiceDiscovery.cloudMap(service),
  listeners: [appmesh.VirtualNodeListener.http({
    port: 8081,
    healthCheck: appmesh.HealthCheck.http({
      healthyThreshold: 3,
      interval: Duration.seconds(5), // minimum
      path: '/health-check-path',
      timeout: Duration.seconds(2), // minimum
      unhealthyThreshold: 2,
    }),
  })],
  accessLog: appmesh.AccessLog.fromFilePath('/dev/stdout'),
});
```

Create a [`VirtualNode`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualNode) with the constructor and add tags.

```ts
declare const mesh: appmesh.Mesh;
declare const service: cloudmap.Service;

const node = new appmesh.VirtualNode(this, 'node', {
  mesh,
  serviceDiscovery: appmesh.ServiceDiscovery.cloudMap(service),
  listeners: [appmesh.VirtualNodeListener.http({
    port: 8080,
    healthCheck: appmesh.HealthCheck.http({
      healthyThreshold: 3,
      interval: Duration.seconds(5),
      path: '/ping',
      timeout: Duration.seconds(2),
      unhealthyThreshold: 2,
    }),
    timeout: {
      idle: Duration.seconds(5),
    },
  })],
  backendDefaults: {
    tlsClientPolicy: {
      validation: {
        trust: appmesh.TlsValidationTrust.file('/keys/local_cert_chain.pem'),
      },
    },
  },
  accessLog: appmesh.AccessLog.fromFilePath('/dev/stdout'),
});

cdk.Tags.of(node).add('Environment', 'Dev');
```

Create a [`VirtualNode`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualNode) with the customized access logging format.

```ts
declare const mesh: appmesh.Mesh;
declare const service: cloudmap.Service;
const node = new appmesh.VirtualNode(this, 'node', {
  mesh,
  serviceDiscovery: appmesh.ServiceDiscovery.cloudMap(service),
  listeners: [appmesh.VirtualNodeListener.http({
    port: 8080,
    healthCheck: appmesh.HealthCheck.http({
      healthyThreshold: 3,
      interval: cdk.Duration.seconds(5),
      path: '/ping',
      timeout: cdk.Duration.seconds(2),
      unhealthyThreshold: 2,
    }),
    timeout: {
      idle: cdk.Duration.seconds(5),
    },
  })],
  backendDefaults: {
    tlsClientPolicy: {
      validation: {
        trust: appmesh.TlsValidationTrust.file('/keys/local_cert_chain.pem'),
      },
    },
  },
  accessLog: appmesh.AccessLog.fromFilePath('/dev/stdout',
    appmesh.LoggingFormat.fromJson(
      {testKey1: 'testValue1', testKey2: 'testValue2'})),
});
```

By using a key-value pair indexed signature, you can specify json key pairs to customize the log entry pattern. You can also use text format as below. You can only specify one of these 2 formats.

```text
  accessLog: appmesh.AccessLog.fromFilePath('/dev/stdout', appmesh.LoggingFormat.fromText('test_pattern')),
```

For what values and operators you can use for these two formats, please visit the latest envoy documentation. (https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage)
Create a [`VirtualNode`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualNode) with the constructor and add backend virtual service.

```ts
declare const mesh: appmesh.Mesh;
declare const router: appmesh.VirtualRouter;
declare const service: cloudmap.Service;

const node = new appmesh.VirtualNode(this, 'node', {
  mesh,
  serviceDiscovery: appmesh.ServiceDiscovery.cloudMap(service),
  listeners: [appmesh.VirtualNodeListener.http({
    port: 8080,
    healthCheck: appmesh.HealthCheck.http({
      healthyThreshold: 3,
      interval: Duration.seconds(5),
      path: '/ping',
      timeout: Duration.seconds(2),
      unhealthyThreshold: 2,
    }),
    timeout: {
      idle: Duration.seconds(5),
    },
  })],
  accessLog: appmesh.AccessLog.fromFilePath('/dev/stdout'),
});

const virtualService = new appmesh.VirtualService(this, 'service-1', {
  virtualServiceProvider: appmesh.VirtualServiceProvider.virtualRouter(router),
  virtualServiceName: 'service1.domain.local',
});

node.addBackend(appmesh.Backend.virtualService(virtualService));
```

The `listeners` property can be left blank and added later with the `node.addListener()` method. The `serviceDiscovery` property must be specified when specifying a listener.

The `backends` property can be added with `node.addBackend()`. In the example, we define a virtual service and add it to the virtual node to allow egress traffic to other nodes.

The `backendDefaults` property is added to the node while creating the virtual node. These are the virtual node's default settings for all backends.

The `VirtualNode.addBackend()` method is especially useful if you want to create a circular traffic flow by having a Virtual Service as a backend whose provider is that same Virtual Node:

```ts
declare const mesh: appmesh.Mesh;

const node = new appmesh.VirtualNode(this, 'node', {
  mesh,
  serviceDiscovery: appmesh.ServiceDiscovery.dns('node'),
});

const virtualService = new appmesh.VirtualService(this, 'service-1', {
  virtualServiceProvider: appmesh.VirtualServiceProvider.virtualNode(node),
  virtualServiceName: 'service1.domain.local',
});

node.addBackend(appmesh.Backend.virtualService(virtualService));
```

### Adding TLS to a listener

The `tls` property specifies TLS configuration when creating a listener for a virtual node or a virtual gateway.
Provide the TLS certificate to the proxy in one of the following ways:

- A certificate from AWS Certificate Manager (ACM).

- A customer-provided certificate (specify a `certificateChain` path file and a `privateKey` file path).

- A certificate provided by a Secrets Discovery Service (SDS) endpoint over local Unix Domain Socket (specify its `secretName`).

```ts
// A Virtual Node with listener TLS from an ACM provided certificate
declare const cert: certificatemanager.Certificate;
declare const mesh: appmesh.Mesh;

const node = new appmesh.VirtualNode(this, 'node', {
  mesh,
  serviceDiscovery: appmesh.ServiceDiscovery.dns('node'),
  listeners: [appmesh.VirtualNodeListener.grpc({
    port: 80,
    tls: {
      mode: appmesh.TlsMode.STRICT,
      certificate: appmesh.TlsCertificate.acm(cert),
    },
  })],
});

// A Virtual Gateway with listener TLS from a customer provided file certificate
const gateway = new appmesh.VirtualGateway(this, 'gateway', {
  mesh,
  listeners: [appmesh.VirtualGatewayListener.grpc({
    port: 8080,
    tls: {
      mode: appmesh.TlsMode.STRICT,
      certificate: appmesh.TlsCertificate.file('path/to/certChain', 'path/to/privateKey'),
    },
  })],
  virtualGatewayName: 'gateway',
});

// A Virtual Gateway with listener TLS from a SDS provided certificate
const gateway2 = new appmesh.VirtualGateway(this, 'gateway2', {
  mesh,
  listeners: [appmesh.VirtualGatewayListener.http2({
    port: 8080,
    tls: {
      mode: appmesh.TlsMode.STRICT,
      certificate: appmesh.TlsCertificate.sds('secrete_certificate'),
    },
  })],
  virtualGatewayName: 'gateway2',
});
```

### Adding mutual TLS authentication

Mutual TLS authentication is an optional component of TLS that offers two-way peer authentication.
To enable mutual TLS authentication, add the `mutualTlsCertificate` property to TLS client policy and/or the `mutualTlsValidation` property to your TLS listener.

`tls.mutualTlsValidation` and `tlsClientPolicy.mutualTlsCertificate` can be sourced from either:

- A customer-provided certificate (specify a `certificateChain` path file and a `privateKey` file path).

- A certificate provided by a Secrets Discovery Service (SDS) endpoint over local Unix Domain Socket (specify its `secretName`).

> **Note**
> Currently, a certificate from AWS Certificate Manager (ACM) cannot be used for mutual TLS authentication.

```ts
declare const mesh: appmesh.Mesh;

const node1 = new appmesh.VirtualNode(this, 'node1', {
  mesh,
  serviceDiscovery: appmesh.ServiceDiscovery.dns('node'),
  listeners: [appmesh.VirtualNodeListener.grpc({
    port: 80,
    tls: {
      mode: appmesh.TlsMode.STRICT,
      certificate: appmesh.TlsCertificate.file('path/to/certChain', 'path/to/privateKey'),
      // Validate a file client certificates to enable mutual TLS authentication when a client provides a certificate.
      mutualTlsValidation: {
        trust: appmesh.TlsValidationTrust.file('path-to-certificate'),
      },
    },
  })],
});

const certificateAuthorityArn = 'arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/12345678-1234-1234-1234-123456789012';
const node2 = new appmesh.VirtualNode(this, 'node2', {
  mesh,
  serviceDiscovery: appmesh.ServiceDiscovery.dns('node2'),
  backendDefaults: {
    tlsClientPolicy: {
      ports: [8080, 8081],
      validation: {
        subjectAlternativeNames: appmesh.SubjectAlternativeNames.matchingExactly('mesh-endpoint.apps.local'),
        trust: appmesh.TlsValidationTrust.acm([
          acmpca.CertificateAuthority.fromCertificateAuthorityArn(this, 'certificate', certificateAuthorityArn)]),
      },
      // Provide a SDS client certificate when a server requests it and enable mutual TLS authentication.
      mutualTlsCertificate: appmesh.TlsCertificate.sds('secret_certificate'),
    },
  },
});
```

### Adding outlier detection to a Virtual Node listener

The `outlierDetection` property adds outlier detection to a Virtual Node listener. The properties
`baseEjectionDuration`, `interval`, `maxEjectionPercent`, and `maxServerErrors` are required.

```ts
// Cloud Map service discovery is currently required for host ejection by outlier detection
const vpc = new ec2.Vpc(this, 'vpc');
const namespace = new cloudmap.PrivateDnsNamespace(this, 'test-namespace', {
    vpc,
    name: 'domain.local',
});
const service = namespace.createService('Svc');

declare const mesh: appmesh.Mesh;
const node = mesh.addVirtualNode('virtual-node', {
  serviceDiscovery: appmesh.ServiceDiscovery.cloudMap(service),
  listeners: [appmesh.VirtualNodeListener.http({
    outlierDetection: {
      baseEjectionDuration: Duration.seconds(10),
      interval: Duration.seconds(30),
      maxEjectionPercent: 50,
      maxServerErrors: 5,
    },
  })],
});
```

### Adding a connection pool to a listener

The `connectionPool` property can be added to a Virtual Node listener or Virtual Gateway listener to add a request connection pool. Each listener protocol type has its own connection pool properties.

```ts
// A Virtual Node with a gRPC listener with a connection pool set
declare const mesh: appmesh.Mesh;
const node = new appmesh.VirtualNode(this, 'node', {
  mesh,
  // DNS service discovery can optionally specify the DNS response type as either LOAD_BALANCER or ENDPOINTS.
  // LOAD_BALANCER means that the DNS resolver returns a loadbalanced set of endpoints,
  // whereas ENDPOINTS means that the DNS resolver is returning all the endpoints.
  // By default, the response type is assumed to be LOAD_BALANCER
  serviceDiscovery: appmesh.ServiceDiscovery.dns('node', appmesh.DnsResponseType.ENDPOINTS),
  listeners: [appmesh.VirtualNodeListener.http({
    port: 80,
    connectionPool: {
      maxConnections: 100,
      maxPendingRequests: 10,
    },
  })],
});

// A Virtual Gateway with a gRPC listener with a connection pool set
const gateway = new appmesh.VirtualGateway(this, 'gateway', {
  mesh,
  listeners: [appmesh.VirtualGatewayListener.grpc({
    port: 8080,
    connectionPool: {
      maxRequests: 10,
    },
  })],
  virtualGatewayName: 'gateway',
});
```

### Adding an IP Preference to a Virtual Node

An `ipPreference` can be specified as part of a Virtual Node's service discovery. An IP preference defines how clients for this Virtual Node will interact with it.

There a four different IP preferences available to use which each specify what IP versions this Virtual Node will use and prefer.

- `IPv4_ONLY` - Only use IPv4. For CloudMap service discovery, only IPv4 addresses returned from CloudMap will be used. For DNS service discovery, Envoy's DNS resolver will only resolve DNS queries for IPv4.

- `IPv4_PREFERRED` - Prefer IPv4 and fall back to IPv6. For CloudMap service discovery, an IPv4 address will be used if returned from CloudMap. Otherwise, an IPv6 address will be used if available. For DNS service discovery, Envoy's DNS resolver will first attempt to resolve DNS queries using IPv4 and fall back to IPv6.

- `IPv6_ONLY` - Only use IPv6. For CloudMap service discovery, only IPv6 addresses returned from CloudMap will be used. For DNS service discovery, Envoy's DNS resolver will only resolve DNS queries for IPv6.

- `IPv6_PREFERRED` - Prefer IPv6 and fall back to IPv4. For CloudMap service discovery, an IPv6 address will be used if returned from CloudMap. Otherwise, an IPv4 address will be used if available. For DNS service discovery, Envoy's DNS resolver will first attempt to resolve DNS queries using IPv6 and fall back to IPv4.

```ts
const mesh = new appmesh.Mesh(this, 'mesh', {
  meshName: 'mesh-with-preference',
});

// Virtual Node with DNS service discovery and an IP preference
const dnsNode = new appmesh.VirtualNode(this, 'dns-node', {
  mesh,
  serviceDiscovery: appmesh.ServiceDiscovery.dns('test', appmesh.DnsResponseType.LOAD_BALANCER, appmesh.IpPreference.IPV4_ONLY),
});

// Virtual Node with CloudMap service discovery and an IP preference
const vpc = new ec2.Vpc(this, 'vpc');
const namespace = new cloudmap.PrivateDnsNamespace(this, 'test-namespace', {
  vpc,
  name: 'domain.local',
});
const service = namespace.createService('Svc');

const instanceAttribute : { [key: string]: string} = {};
instanceAttribute.testKey = 'testValue';

const cloudmapNode = new appmesh.VirtualNode(this, 'cloudmap-node', {
  mesh,
  serviceDiscovery: appmesh.ServiceDiscovery.cloudMap(service, instanceAttribute, appmesh.IpPreference.IPV4_ONLY),
});
```

## Adding a Route

A _route_ matches requests with an associated virtual router and distributes traffic to its associated virtual nodes.
The route distributes matching requests to one or more target virtual nodes with relative weighting.

The [`RouteSpec`](/v2/docs/aws-cdk-lib.aws_appmesh.RouteSpec) class lets you define protocol-specific route specifications.
The `tcp()`, `http()`, `http2()`, and `grpc()` methods create a specification for the named protocols.

For HTTP-based routes, the match field can match on path (prefix, exact, or regex), HTTP method, scheme,
HTTP headers, and query parameters. By default, HTTP-based routes match all requests.

For gRPC-based routes, the match field can  match on service name, method name, and metadata.
When specifying the method name, the service name must also be specified.

For example, here's how to add an HTTP route that matches based on a prefix of the URL path:

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

router.addRoute('route-http', {
  routeSpec: appmesh.RouteSpec.http({
    weightedTargets: [
      {
        virtualNode: node,
      },
    ],
    match: {
      // Path that is passed to this method must start with '/'.
      path: appmesh.HttpRoutePathMatch.startsWith('/path-to-app'),
    },
  }),
});
```

Add an HTTP2 route that matches based on exact path, method, scheme, headers, and query parameters:

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

router.addRoute('route-http2', {
  routeSpec: appmesh.RouteSpec.http2({
    weightedTargets: [
      {
        virtualNode: node,
      },
    ],
    match: {
      path: appmesh.HttpRoutePathMatch.exactly('/exact'),
      method: appmesh.HttpRouteMethod.POST,
      protocol: appmesh.HttpRouteProtocol.HTTPS,
      headers: [
        // All specified headers must match for the route to match.
        appmesh.HeaderMatch.valueIs('Content-Type', 'application/json'),
        appmesh.HeaderMatch.valueIsNot('Content-Type', 'application/json'),
      ],
      queryParameters: [
        // All specified query parameters must match for the route to match.
        appmesh.QueryParameterMatch.valueIs('query-field', 'value')
      ],
    },
  }),
});
```

Add a single route with two targets and split traffic 50/50:

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

router.addRoute('route-http', {
  routeSpec: appmesh.RouteSpec.http({
    weightedTargets: [
      {
        virtualNode: node,
        weight: 50,
      },
      {
        virtualNode: node,
        weight: 50,
      },
    ],
    match: {
      path: appmesh.HttpRoutePathMatch.startsWith('/path-to-app'),
    },
  }),
});
```

Add an http2 route with retries:

```ts
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: Duration.seconds(1),
    },
  }),
});
```

Add a gRPC route with retries:

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

router.addRoute('route-grpc-retry', {
  routeSpec: appmesh.RouteSpec.grpc({
    weightedTargets: [{ virtualNode: node }],
    match: { serviceName: 'servicename' },
    retryPolicy: {
      tcpRetryEvents: [appmesh.TcpRetryEvent.CONNECTION_ERROR],
      httpRetryEvents: [appmesh.HttpRetryEvent.GATEWAY_ERROR],
      // Retry if gRPC responds that the request was cancelled, a resource
      // was exhausted, or if the service is unavailable
      grpcRetryEvents: [
        appmesh.GrpcRetryEvent.CANCELLED,
        appmesh.GrpcRetryEvent.RESOURCE_EXHAUSTED,
        appmesh.GrpcRetryEvent.UNAVAILABLE,
      ],
      retryAttempts: 5,
      retryTimeout: Duration.seconds(1),
    },
  }),
});
```

Add an gRPC route that matches based on method name and metadata:

```ts
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/'),
      ],
    },
  }),
});
```

Add a gRPC route that matches based on port:

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

router.addRoute('route-grpc-port', {
  routeSpec: appmesh.RouteSpec.grpc({
    weightedTargets: [
      {
        virtualNode: node,
      },
    ],
    match: {
      port: 1234,
    },
  }),
});
```

Add a gRPC route with timeout:

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

router.addRoute('route-http', {
  routeSpec: appmesh.RouteSpec.grpc({
    weightedTargets: [
      {
        virtualNode: node,
      },
    ],
    match: {
      serviceName: 'my-service.default.svc.cluster.local',
    },
    timeout:  {
      idle : Duration.seconds(2),
      perRequest: Duration.seconds(1),
    },
  }),
});
```

## Adding a Virtual Gateway

A _virtual gateway_ allows resources outside your mesh to communicate with resources inside your mesh.
The virtual gateway represents an Envoy proxy running in an Amazon ECS task, in a Kubernetes service, or on an Amazon EC2 instance.
Unlike a virtual node, which represents Envoy running with an application, a virtual gateway represents Envoy deployed by itself.

A virtual gateway is similar to a virtual node in that it has a listener that accepts traffic for a particular port and protocol (HTTP, HTTP2, gRPC).
Traffic received by the virtual gateway is directed to other services in your mesh
using rules defined in gateway routes which can be added to your virtual gateway.

Create a virtual gateway with the constructor:

```ts
declare const mesh: appmesh.Mesh;
const certificateAuthorityArn = 'arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/12345678-1234-1234-1234-123456789012';

const gateway = new appmesh.VirtualGateway(this, 'gateway', {
  mesh: mesh,
  listeners: [appmesh.VirtualGatewayListener.http({
    port: 443,
    healthCheck: appmesh.HealthCheck.http({
      interval: Duration.seconds(10),
    }),
  })],
  backendDefaults: {
    tlsClientPolicy: {
      ports: [8080, 8081],
      validation: {
        trust: appmesh.TlsValidationTrust.acm([
          acmpca.CertificateAuthority.fromCertificateAuthorityArn(this, 'certificate', certificateAuthorityArn)]),
      },
    },
  },
  accessLog: appmesh.AccessLog.fromFilePath('/dev/stdout'),
  virtualGatewayName: 'virtualGateway',
});
```

Add a virtual gateway directly to the mesh:

```ts
declare const mesh: appmesh.Mesh;

const gateway = mesh.addVirtualGateway('gateway', {
  accessLog: appmesh.AccessLog.fromFilePath('/dev/stdout'),
  virtualGatewayName: 'virtualGateway',
    listeners: [appmesh.VirtualGatewayListener.http({
      port: 443,
      healthCheck: appmesh.HealthCheck.http({
        interval: Duration.seconds(10),
      }),
  })],
});
```

The `listeners` field defaults to an HTTP Listener on port 8080 if omitted.
A gateway route can be added using the `gateway.addGatewayRoute()` method.

The `backendDefaults` property, provided when creating the virtual gateway, specifies the virtual gateway's default settings for all backends.

## Adding a Gateway Route

A _gateway route_ is attached to a virtual gateway and routes matching traffic to an existing virtual service.

For HTTP-based gateway routes, the `match` field can be used to match on
path (prefix, exact, or regex), HTTP method, host name, HTTP headers, and query parameters.
By default, HTTP-based gateway routes match all requests.

```ts
declare const gateway: appmesh.VirtualGateway;
declare const virtualService: appmesh.VirtualService;

gateway.addGatewayRoute('gateway-route-http', {
  routeSpec: appmesh.GatewayRouteSpec.http({
    routeTarget: virtualService,
    match: {
      path: appmesh.HttpGatewayRoutePathMatch.regex('regex'),
    },
  }),
});
```

For gRPC-based gateway routes, the `match` field can be used to match on service name, host name, port and metadata.

```ts
declare const gateway: appmesh.VirtualGateway;
declare const virtualService: appmesh.VirtualService;

gateway.addGatewayRoute('gateway-route-grpc', {
  routeSpec: appmesh.GatewayRouteSpec.grpc({
    routeTarget: virtualService,
    match: {
      hostname: appmesh.GatewayRouteHostnameMatch.endsWith('.example.com'),
    },
  }),
});
```

For HTTP based gateway routes, App Mesh automatically rewrites the matched prefix path in Gateway Route to “/”.
This automatic rewrite configuration can be overwritten in following ways:

```ts
declare const gateway: appmesh.VirtualGateway;
declare const virtualService: appmesh.VirtualService;

gateway.addGatewayRoute('gateway-route-http', {
  routeSpec: appmesh.GatewayRouteSpec.http({
    routeTarget: virtualService,
    match: {
      // This disables the default rewrite to '/', and retains original path.
      path: appmesh.HttpGatewayRoutePathMatch.startsWith('/path-to-app/', ''),
    },
  }),
});

gateway.addGatewayRoute('gateway-route-http-1', {
  routeSpec: appmesh.GatewayRouteSpec.http({
    routeTarget: virtualService,
    match: {
      // If the request full path is '/path-to-app/xxxxx', this rewrites the path to '/rewrittenUri/xxxxx'.
      // Please note both `prefixPathMatch` and `rewriteTo` must start and end with the `/` character.
      path: appmesh.HttpGatewayRoutePathMatch.startsWith('/path-to-app/', '/rewrittenUri/'),
    },
  }),
});
```

If matching other path (exact or regex), only specific rewrite path can be specified.
Unlike `startsWith()` method above, no default rewrite is performed.

```ts
declare const gateway: appmesh.VirtualGateway;
declare const virtualService: appmesh.VirtualService;

gateway.addGatewayRoute('gateway-route-http-2', {
  routeSpec: appmesh.GatewayRouteSpec.http({
    routeTarget: virtualService,
    match: {
      // This rewrites the path from '/test' to '/rewrittenPath'.
      path: appmesh.HttpGatewayRoutePathMatch.exactly('/test', '/rewrittenPath'),
    },
  }),
});
```

For HTTP/gRPC based routes, App Mesh automatically rewrites
the original request received at the Virtual Gateway to the destination Virtual Service name.
This default host name rewrite can be configured by specifying the rewrite rule as one of the `match` property:

```ts
declare const gateway: appmesh.VirtualGateway;
declare const virtualService: appmesh.VirtualService;

gateway.addGatewayRoute('gateway-route-grpc', {
  routeSpec: appmesh.GatewayRouteSpec.grpc({
    routeTarget: virtualService,
    match: {
      hostname: appmesh.GatewayRouteHostnameMatch.exactly('example.com'),
      // This disables the default rewrite to virtual service name and retain original request.
      rewriteRequestHostname: false,
    },
  }),
});
```

## Importing Resources

Each App Mesh resource class comes with two static methods, `from<Resource>Arn` and `from<Resource>Attributes` (where `<Resource>` is replaced with the resource name, such as [`VirtualNode`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualNode)) for importing a reference to an existing App Mesh resource.
These imported resources can be used with other resources in your mesh as if they were defined directly in your CDK application.

```ts
const arn = 'arn:aws:appmesh:us-east-1:123456789012:mesh/testMesh/virtualNode/testNode';
appmesh.VirtualNode.fromVirtualNodeArn(this, 'importedVirtualNode', arn);
```

```ts
const virtualNodeName = 'my-virtual-node';
appmesh.VirtualNode.fromVirtualNodeAttributes(this, 'imported-virtual-node', {
  mesh: appmesh.Mesh.fromMeshName(this, 'Mesh', 'testMesh'),
  virtualNodeName: virtualNodeName,
});
```

To import a mesh, again there are two static methods, `fromMeshArn` and `fromMeshName`.

```ts
const arn = 'arn:aws:appmesh:us-east-1:123456789012:mesh/testMesh';
appmesh.Mesh.fromMeshArn(this, 'imported-mesh', arn);
```

```ts
appmesh.Mesh.fromMeshName(this, 'imported-mesh', 'abc');
```

## IAM Grants

[`VirtualNode`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualNode) and [`VirtualGateway`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualGateway) have a `grants` property that provides a `streamAggregatedResources`
methods that grant identities that are running Envoy access to stream generated config from App Mesh.

```ts
declare const mesh: appmesh.Mesh;
const gateway = new appmesh.VirtualGateway(this, 'testGateway', { mesh });
const envoyUser = new iam.User(this, 'envoyUser');

/**
 * This will grant `appmesh:StreamAggregatedResources` ONLY for this gateway.
 */
gateway.grants.streamAggregatedResources(envoyUser)
```

## Adding Resources to shared meshes

A shared mesh allows resources created by different accounts to communicate with each other in the same mesh:

```ts
// This is the ARN for the mesh from different AWS IAM account ID.
// Ensure mesh is properly shared with your account. For more details, see: https://github.com/aws/aws-cdk/issues/15404
const arn = 'arn:aws:appmesh:us-east-1:123456789012:mesh/testMesh';
const sharedMesh = appmesh.Mesh.fromMeshArn(this, 'imported-mesh', arn);

// This VirtualNode resource can communicate with the resources in the mesh from different AWS IAM account ID.
new appmesh.VirtualNode(this, 'test-node', {
  mesh: sharedMesh,
});
```

## Types

| Name | Kind | Summary |
| --- | --- | --- |
| [`GatewayRoute`](/v2/docs/aws-cdk-lib.aws_appmesh.GatewayRoute) | Construct (L2) | GatewayRoute represents a new or existing gateway route attached to a VirtualGateway and Mesh. |
| [`Mesh`](/v2/docs/aws-cdk-lib.aws_appmesh.Mesh) | Construct (L2) | Define a new AppMesh mesh. |
| [`Route`](/v2/docs/aws-cdk-lib.aws_appmesh.Route) | Construct (L2) | Route represents a new or existing route attached to a VirtualRouter and Mesh. |
| [`VirtualGateway`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualGateway) | Construct (L2) | VirtualGateway represents a newly defined App Mesh Virtual Gateway. |
| [`VirtualNode`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualNode) | Construct (L2) | VirtualNode represents a newly defined AppMesh VirtualNode. |
| [`VirtualRouter`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualRouter) | Construct (L2) |  |
| [`VirtualService`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualService) | Construct (L2) | VirtualService represents a service inside an AppMesh. |
| [`CfnGatewayRoute`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute) | Construct (L1) | Creates a gateway route. |
| [`CfnMesh`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnMesh) | Construct (L1) | Creates a service mesh. |
| [`CfnRoute`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute) | Construct (L1) | Creates a route that is associated with a virtual router. |
| [`CfnVirtualGateway`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway) | Construct (L1) | Creates a virtual gateway. |
| [`CfnVirtualNode`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode) | Construct (L1) | Creates a virtual node within a service mesh. |
| [`CfnVirtualRouter`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualRouter) | Construct (L1) | Creates a virtual router within a service mesh. |
| [`CfnVirtualService`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualService) | Construct (L1) | Creates a virtual service within a service mesh. |
| [`AccessLog`](/v2/docs/aws-cdk-lib.aws_appmesh.AccessLog) | Class | Configuration for Envoy Access logs for mesh endpoints. |
| [`AccessLogConfig`](/v2/docs/aws-cdk-lib.aws_appmesh.AccessLogConfig) | Struct | All Properties for Envoy Access logs for mesh endpoints. |
| [`Backend`](/v2/docs/aws-cdk-lib.aws_appmesh.Backend) | Class | Contains static factory methods to create backends. |
| [`BackendConfig`](/v2/docs/aws-cdk-lib.aws_appmesh.BackendConfig) | Struct | Properties for a backend. |
| [`BackendDefaults`](/v2/docs/aws-cdk-lib.aws_appmesh.BackendDefaults) | Struct | Represents the properties needed to define backend defaults. |
| [`CfnGatewayRoute.GatewayRouteHostnameMatchProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.GatewayRouteHostnameMatchProperty) | Struct | An object representing the gateway route host name to match. |
| [`CfnGatewayRoute.GatewayRouteHostnameRewriteProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.GatewayRouteHostnameRewriteProperty) | Struct | An object representing the gateway route host name to rewrite. |
| [`CfnGatewayRoute.GatewayRouteMetadataMatchProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.GatewayRouteMetadataMatchProperty) | Struct | An object representing the method header to be matched. |
| [`CfnGatewayRoute.GatewayRouteRangeMatchProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.GatewayRouteRangeMatchProperty) | Struct | An object that represents the range of values to match on. |
| [`CfnGatewayRoute.GatewayRouteSpecProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.GatewayRouteSpecProperty) | Struct | An object that represents a gateway route specification. |
| [`CfnGatewayRoute.GatewayRouteTargetProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.GatewayRouteTargetProperty) | Struct | An object that represents a gateway route target. |
| [`CfnGatewayRoute.GatewayRouteVirtualServiceProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.GatewayRouteVirtualServiceProperty) | Struct | An object that represents the virtual service that traffic is routed to. |
| [`CfnGatewayRoute.GrpcGatewayRouteActionProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.GrpcGatewayRouteActionProperty) | Struct | An object that represents the action to take if a match is determined. |
| [`CfnGatewayRoute.GrpcGatewayRouteMatchProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.GrpcGatewayRouteMatchProperty) | Struct | An object that represents the criteria for determining a request match. |
| [`CfnGatewayRoute.GrpcGatewayRouteMetadataProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.GrpcGatewayRouteMetadataProperty) | Struct | An object representing the metadata of the gateway route. |
| [`CfnGatewayRoute.GrpcGatewayRouteProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.GrpcGatewayRouteProperty) | Struct | An object that represents a gRPC gateway route. |
| [`CfnGatewayRoute.GrpcGatewayRouteRewriteProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.GrpcGatewayRouteRewriteProperty) | Struct | An object that represents the gateway route to rewrite. |
| [`CfnGatewayRoute.HttpGatewayRouteActionProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.HttpGatewayRouteActionProperty) | Struct | An object that represents the action to take if a match is determined. |
| [`CfnGatewayRoute.HttpGatewayRouteHeaderMatchProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.HttpGatewayRouteHeaderMatchProperty) | Struct | An object that represents the method and value to match with the header value sent in a request. |
| [`CfnGatewayRoute.HttpGatewayRouteHeaderProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.HttpGatewayRouteHeaderProperty) | Struct | An object that represents the HTTP header in the gateway route. |
| [`CfnGatewayRoute.HttpGatewayRouteMatchProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.HttpGatewayRouteMatchProperty) | Struct | An object that represents the criteria for determining a request match. |
| [`CfnGatewayRoute.HttpGatewayRoutePathRewriteProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.HttpGatewayRoutePathRewriteProperty) | Struct | An object that represents the path to rewrite. |
| [`CfnGatewayRoute.HttpGatewayRoutePrefixRewriteProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.HttpGatewayRoutePrefixRewriteProperty) | Struct | An object representing the beginning characters of the route to rewrite. |
| [`CfnGatewayRoute.HttpGatewayRouteProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.HttpGatewayRouteProperty) | Struct | An object that represents an HTTP gateway route. |
| [`CfnGatewayRoute.HttpGatewayRouteRewriteProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.HttpGatewayRouteRewriteProperty) | Struct | An object representing the gateway route to rewrite. |
| [`CfnGatewayRoute.HttpPathMatchProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.HttpPathMatchProperty) | Struct | An object representing the path to match in the request. |
| [`CfnGatewayRoute.HttpQueryParameterMatchProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.HttpQueryParameterMatchProperty) | Struct | An object representing the query parameter to match. |
| [`CfnGatewayRoute.QueryParameterProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.QueryParameterProperty) | Struct | An object that represents the query parameter in the request. |
| [`CfnGatewayRouteProps`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRouteProps) | Struct | Properties for defining a `CfnGatewayRoute`. |
| [`CfnMesh.EgressFilterProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnMesh.EgressFilterProperty) | Struct | An object that represents the egress filter rules for a service mesh. |
| [`CfnMesh.MeshServiceDiscoveryProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnMesh.MeshServiceDiscoveryProperty) | Struct | An object that represents the service discovery information for a service mesh. |
| [`CfnMesh.MeshSpecProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnMesh.MeshSpecProperty) | Struct | An object that represents the specification of a service mesh. |
| [`CfnMeshProps`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnMeshProps) | Struct | Properties for defining a `CfnMesh`. |
| [`CfnRoute.DurationProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.DurationProperty) | Struct | An object that represents a duration of time. |
| [`CfnRoute.GrpcRetryPolicyProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.GrpcRetryPolicyProperty) | Struct | An object that represents a retry policy. |
| [`CfnRoute.GrpcRouteActionProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.GrpcRouteActionProperty) | Struct | An object that represents the action to take if a match is determined. |
| [`CfnRoute.GrpcRouteMatchProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.GrpcRouteMatchProperty) | Struct | An object that represents the criteria for determining a request match. |
| [`CfnRoute.GrpcRouteMetadataMatchMethodProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.GrpcRouteMetadataMatchMethodProperty) | Struct | An object that represents the match method. |
| [`CfnRoute.GrpcRouteMetadataProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.GrpcRouteMetadataProperty) | Struct | An object that represents the match metadata for the route. |
| [`CfnRoute.GrpcRouteProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.GrpcRouteProperty) | Struct | An object that represents a gRPC route type. |
| [`CfnRoute.GrpcTimeoutProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.GrpcTimeoutProperty) | Struct | An object that represents types of timeouts. |
| [`CfnRoute.HeaderMatchMethodProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.HeaderMatchMethodProperty) | Struct | An object that represents the method and value to match with the header value sent in a request. |
| [`CfnRoute.HttpPathMatchProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.HttpPathMatchProperty) | Struct | An object representing the path to match in the request. |
| [`CfnRoute.HttpQueryParameterMatchProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.HttpQueryParameterMatchProperty) | Struct | An object representing the query parameter to match. |
| [`CfnRoute.HttpRetryPolicyProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.HttpRetryPolicyProperty) | Struct | An object that represents a retry policy. |
| [`CfnRoute.HttpRouteActionProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.HttpRouteActionProperty) | Struct | An object that represents the action to take if a match is determined. |
| [`CfnRoute.HttpRouteHeaderProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.HttpRouteHeaderProperty) | Struct | An object that represents the HTTP header in the request. |
| [`CfnRoute.HttpRouteMatchProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.HttpRouteMatchProperty) | Struct | An object that represents the requirements for a route to match HTTP requests for a virtual router. |
| [`CfnRoute.HttpRouteProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.HttpRouteProperty) | Struct | An object that represents an HTTP or HTTP/2 route type. |
| [`CfnRoute.HttpTimeoutProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.HttpTimeoutProperty) | Struct | An object that represents types of timeouts. |
| [`CfnRoute.MatchRangeProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.MatchRangeProperty) | Struct | An object that represents the range of values to match on. |
| [`CfnRoute.QueryParameterProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.QueryParameterProperty) | Struct | An object that represents the query parameter in the request. |
| [`CfnRoute.RouteSpecProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.RouteSpecProperty) | Struct | An object that represents a route specification. |
| [`CfnRoute.TcpRouteActionProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.TcpRouteActionProperty) | Struct | An object that represents the action to take if a match is determined. |
| [`CfnRoute.TcpRouteMatchProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.TcpRouteMatchProperty) | Struct | An object representing the TCP route to match. |
| [`CfnRoute.TcpRouteProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.TcpRouteProperty) | Struct | An object that represents a TCP route type. |
| [`CfnRoute.TcpTimeoutProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.TcpTimeoutProperty) | Struct | An object that represents types of timeouts. |
| [`CfnRoute.WeightedTargetProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.WeightedTargetProperty) | Struct | An object that represents a target and its relative weight. |
| [`CfnRouteProps`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnRouteProps) | Struct | Properties for defining a `CfnRoute`. |
| [`CfnVirtualGateway.JsonFormatRefProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.JsonFormatRefProperty) | Struct | An object that represents the key value pairs for the JSON. |
| [`CfnVirtualGateway.LoggingFormatProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.LoggingFormatProperty) | Struct | An object that represents the format for the logs. |
| [`CfnVirtualGateway.SubjectAlternativeNameMatchersProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.SubjectAlternativeNameMatchersProperty) | Struct | An object that represents the methods by which a subject alternative name on a peer Transport Layer Security (TLS) certificate can be matched. |
| [`CfnVirtualGateway.SubjectAlternativeNamesProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.SubjectAlternativeNamesProperty) | Struct | An object that represents the subject alternative names secured by the certificate. |
| [`CfnVirtualGateway.VirtualGatewayAccessLogProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayAccessLogProperty) | Struct | The access log configuration for a virtual gateway. |
| [`CfnVirtualGateway.VirtualGatewayBackendDefaultsProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayBackendDefaultsProperty) | Struct | An object that represents the default properties for a backend. |
| [`CfnVirtualGateway.VirtualGatewayClientPolicyProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayClientPolicyProperty) | Struct | An object that represents a client policy. |
| [`CfnVirtualGateway.VirtualGatewayClientPolicyTlsProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayClientPolicyTlsProperty) | Struct | An object that represents a Transport Layer Security (TLS) client policy. |
| [`CfnVirtualGateway.VirtualGatewayClientTlsCertificateProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayClientTlsCertificateProperty) | Struct | An object that represents the virtual gateway's client's Transport Layer Security (TLS) certificate. |
| [`CfnVirtualGateway.VirtualGatewayConnectionPoolProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayConnectionPoolProperty) | Struct | An object that represents the type of virtual gateway connection pool. |
| [`CfnVirtualGateway.VirtualGatewayFileAccessLogProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayFileAccessLogProperty) | Struct | An object that represents an access log file. |
| [`CfnVirtualGateway.VirtualGatewayGrpcConnectionPoolProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayGrpcConnectionPoolProperty) | Struct | An object that represents a type of connection pool. |
| [`CfnVirtualGateway.VirtualGatewayHealthCheckPolicyProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayHealthCheckPolicyProperty) | Struct | An object that represents the health check policy for a virtual gateway's listener. |
| [`CfnVirtualGateway.VirtualGatewayHttp2ConnectionPoolProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayHttp2ConnectionPoolProperty) | Struct | An object that represents a type of connection pool. |
| [`CfnVirtualGateway.VirtualGatewayHttpConnectionPoolProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayHttpConnectionPoolProperty) | Struct | An object that represents a type of connection pool. |
| [`CfnVirtualGateway.VirtualGatewayListenerProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayListenerProperty) | Struct | An object that represents a listener for a virtual gateway. |
| [`CfnVirtualGateway.VirtualGatewayListenerTlsAcmCertificateProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayListenerTlsAcmCertificateProperty) | Struct | An object that represents an Certificate Manager certificate. |
| [`CfnVirtualGateway.VirtualGatewayListenerTlsCertificateProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayListenerTlsCertificateProperty) | Struct | An object that represents a listener's Transport Layer Security (TLS) certificate. |
| [`CfnVirtualGateway.VirtualGatewayListenerTlsFileCertificateProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayListenerTlsFileCertificateProperty) | Struct | An object that represents a local file certificate. |
| [`CfnVirtualGateway.VirtualGatewayListenerTlsProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayListenerTlsProperty) | Struct | An object that represents the Transport Layer Security (TLS) properties for a listener. |
| [`CfnVirtualGateway.VirtualGatewayListenerTlsSdsCertificateProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayListenerTlsSdsCertificateProperty) | Struct | An object that represents the virtual gateway's listener's Secret Discovery Service certificate.The proxy must be configured with a local SDS provider via a Unix Domain Socket. See App Mesh [TLS documentation](https://docs.aws.amazon.com/app-mesh/latest/userguide/tls.html) for more info. |
| [`CfnVirtualGateway.VirtualGatewayListenerTlsValidationContextProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayListenerTlsValidationContextProperty) | Struct | An object that represents a virtual gateway's listener's Transport Layer Security (TLS) validation context. |
| [`CfnVirtualGateway.VirtualGatewayListenerTlsValidationContextTrustProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayListenerTlsValidationContextTrustProperty) | Struct | An object that represents a virtual gateway's listener's Transport Layer Security (TLS) validation context trust. |
| [`CfnVirtualGateway.VirtualGatewayLoggingProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayLoggingProperty) | Struct | An object that represents logging information. |
| [`CfnVirtualGateway.VirtualGatewayPortMappingProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayPortMappingProperty) | Struct | An object that represents a port mapping. |
| [`CfnVirtualGateway.VirtualGatewaySpecProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewaySpecProperty) | Struct | An object that represents the specification of a service mesh resource. |
| [`CfnVirtualGateway.VirtualGatewayTlsValidationContextAcmTrustProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayTlsValidationContextAcmTrustProperty) | Struct | An object that represents a Transport Layer Security (TLS) validation context trust for an Certificate Manager certificate. |
| [`CfnVirtualGateway.VirtualGatewayTlsValidationContextFileTrustProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayTlsValidationContextFileTrustProperty) | Struct | An object that represents a Transport Layer Security (TLS) validation context trust for a local file. |
| [`CfnVirtualGateway.VirtualGatewayTlsValidationContextProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayTlsValidationContextProperty) | Struct | An object that represents a Transport Layer Security (TLS) validation context. |
| [`CfnVirtualGateway.VirtualGatewayTlsValidationContextSdsTrustProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayTlsValidationContextSdsTrustProperty) | Struct | An object that represents a virtual gateway's listener's Transport Layer Security (TLS) Secret Discovery Service validation context trust. |
| [`CfnVirtualGateway.VirtualGatewayTlsValidationContextTrustProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGateway.VirtualGatewayTlsValidationContextTrustProperty) | Struct | An object that represents a Transport Layer Security (TLS) validation context trust. |
| [`CfnVirtualGatewayProps`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualGatewayProps) | Struct | Properties for defining a `CfnVirtualGateway`. |
| [`CfnVirtualNode.AccessLogProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.AccessLogProperty) | Struct | An object that represents the access logging information for a virtual node. |
| [`CfnVirtualNode.AwsCloudMapInstanceAttributeProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.AwsCloudMapInstanceAttributeProperty) | Struct | An object that represents the AWS Cloud Map attribute information for your virtual node. |
| [`CfnVirtualNode.AwsCloudMapServiceDiscoveryProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.AwsCloudMapServiceDiscoveryProperty) | Struct | An object that represents the AWS Cloud Map service discovery information for your virtual node. |
| [`CfnVirtualNode.BackendDefaultsProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.BackendDefaultsProperty) | Struct | An object that represents the default properties for a backend. |
| [`CfnVirtualNode.BackendProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.BackendProperty) | Struct | An object that represents the backends that a virtual node is expected to send outbound traffic to. |
| [`CfnVirtualNode.ClientPolicyProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.ClientPolicyProperty) | Struct | An object that represents a client policy. |
| [`CfnVirtualNode.ClientPolicyTlsProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.ClientPolicyTlsProperty) | Struct | A reference to an object that represents a Transport Layer Security (TLS) client policy. |
| [`CfnVirtualNode.ClientTlsCertificateProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.ClientTlsCertificateProperty) | Struct | An object that represents the client's certificate. |
| [`CfnVirtualNode.DnsServiceDiscoveryProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.DnsServiceDiscoveryProperty) | Struct | An object that represents the DNS service discovery information for your virtual node. |
| [`CfnVirtualNode.DurationProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.DurationProperty) | Struct | An object that represents a duration of time. |
| [`CfnVirtualNode.FileAccessLogProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.FileAccessLogProperty) | Struct | An object that represents an access log file. |
| [`CfnVirtualNode.GrpcTimeoutProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.GrpcTimeoutProperty) | Struct | An object that represents types of timeouts. |
| [`CfnVirtualNode.HealthCheckProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.HealthCheckProperty) | Struct | An object that represents the health check policy for a virtual node's listener. |
| [`CfnVirtualNode.HttpTimeoutProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.HttpTimeoutProperty) | Struct | An object that represents types of timeouts. |
| [`CfnVirtualNode.JsonFormatRefProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.JsonFormatRefProperty) | Struct | An object that represents the key value pairs for the JSON. |
| [`CfnVirtualNode.ListenerProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.ListenerProperty) | Struct | An object that represents a listener for a virtual node. |
| [`CfnVirtualNode.ListenerTimeoutProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.ListenerTimeoutProperty) | Struct | An object that represents timeouts for different protocols. |
| [`CfnVirtualNode.ListenerTlsAcmCertificateProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.ListenerTlsAcmCertificateProperty) | Struct | An object that represents an Certificate Manager certificate. |
| [`CfnVirtualNode.ListenerTlsCertificateProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.ListenerTlsCertificateProperty) | Struct | An object that represents a listener's Transport Layer Security (TLS) certificate. |
| [`CfnVirtualNode.ListenerTlsFileCertificateProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.ListenerTlsFileCertificateProperty) | Struct | An object that represents a local file certificate. |
| [`CfnVirtualNode.ListenerTlsProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.ListenerTlsProperty) | Struct | An object that represents the Transport Layer Security (TLS) properties for a listener. |
| [`CfnVirtualNode.ListenerTlsSdsCertificateProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.ListenerTlsSdsCertificateProperty) | Struct | An object that represents the listener's Secret Discovery Service certificate. |
| [`CfnVirtualNode.ListenerTlsValidationContextProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.ListenerTlsValidationContextProperty) | Struct | An object that represents a listener's Transport Layer Security (TLS) validation context. |
| [`CfnVirtualNode.ListenerTlsValidationContextTrustProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.ListenerTlsValidationContextTrustProperty) | Struct | An object that represents a listener's Transport Layer Security (TLS) validation context trust. |
| [`CfnVirtualNode.LoggingFormatProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.LoggingFormatProperty) | Struct | An object that represents the format for the logs. |
| [`CfnVirtualNode.LoggingProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.LoggingProperty) | Struct | An object that represents the logging information for a virtual node. |
| [`CfnVirtualNode.OutlierDetectionProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.OutlierDetectionProperty) | Struct | An object that represents the outlier detection for a virtual node's listener. |
| [`CfnVirtualNode.PortMappingProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.PortMappingProperty) | Struct | An object representing a virtual node or virtual router listener port mapping. |
| [`CfnVirtualNode.ServiceDiscoveryProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.ServiceDiscoveryProperty) | Struct | An object that represents the service discovery information for a virtual node. |
| [`CfnVirtualNode.SubjectAlternativeNameMatchersProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.SubjectAlternativeNameMatchersProperty) | Struct | An object that represents the methods by which a subject alternative name on a peer Transport Layer Security (TLS) certificate can be matched. |
| [`CfnVirtualNode.SubjectAlternativeNamesProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.SubjectAlternativeNamesProperty) | Struct | An object that represents the subject alternative names secured by the certificate. |
| [`CfnVirtualNode.TcpTimeoutProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.TcpTimeoutProperty) | Struct | An object that represents types of timeouts. |
| [`CfnVirtualNode.TlsValidationContextAcmTrustProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.TlsValidationContextAcmTrustProperty) | Struct | An object that represents a Transport Layer Security (TLS) validation context trust for an Certificate Manager certificate. |
| [`CfnVirtualNode.TlsValidationContextFileTrustProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.TlsValidationContextFileTrustProperty) | Struct | An object that represents a Transport Layer Security (TLS) validation context trust for a local file. |
| [`CfnVirtualNode.TlsValidationContextProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.TlsValidationContextProperty) | Struct | An object that represents how the proxy will validate its peer during Transport Layer Security (TLS) negotiation. |
| [`CfnVirtualNode.TlsValidationContextSdsTrustProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.TlsValidationContextSdsTrustProperty) | Struct | An object that represents a Transport Layer Security (TLS) Secret Discovery Service validation context trust. |
| [`CfnVirtualNode.TlsValidationContextTrustProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.TlsValidationContextTrustProperty) | Struct | An object that represents a Transport Layer Security (TLS) validation context trust. |
| [`CfnVirtualNode.VirtualNodeConnectionPoolProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.VirtualNodeConnectionPoolProperty) | Struct | An object that represents the type of virtual node connection pool. |
| [`CfnVirtualNode.VirtualNodeGrpcConnectionPoolProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.VirtualNodeGrpcConnectionPoolProperty) | Struct | An object that represents a type of connection pool. |
| [`CfnVirtualNode.VirtualNodeHttp2ConnectionPoolProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.VirtualNodeHttp2ConnectionPoolProperty) | Struct | An object that represents a type of connection pool. |
| [`CfnVirtualNode.VirtualNodeHttpConnectionPoolProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.VirtualNodeHttpConnectionPoolProperty) | Struct | An object that represents a type of connection pool. |
| [`CfnVirtualNode.VirtualNodeSpecProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.VirtualNodeSpecProperty) | Struct | An object that represents the specification of a virtual node. |
| [`CfnVirtualNode.VirtualNodeTcpConnectionPoolProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.VirtualNodeTcpConnectionPoolProperty) | Struct | An object that represents a type of connection pool. |
| [`CfnVirtualNode.VirtualServiceBackendProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.VirtualServiceBackendProperty) | Struct | An object that represents a virtual service backend for a virtual node. |
| [`CfnVirtualNodeProps`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNodeProps) | Struct | Properties for defining a `CfnVirtualNode`. |
| [`CfnVirtualRouter.PortMappingProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualRouter.PortMappingProperty) | Struct | An object representing a virtual router listener port mapping. |
| [`CfnVirtualRouter.VirtualRouterListenerProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualRouter.VirtualRouterListenerProperty) | Struct | An object that represents a virtual router listener. |
| [`CfnVirtualRouter.VirtualRouterSpecProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualRouter.VirtualRouterSpecProperty) | Struct | An object that represents the specification of a virtual router. |
| [`CfnVirtualRouterProps`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualRouterProps) | Struct | Properties for defining a `CfnVirtualRouter`. |
| [`CfnVirtualService.VirtualNodeServiceProviderProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualService.VirtualNodeServiceProviderProperty) | Struct | An object that represents a virtual node service provider. |
| [`CfnVirtualService.VirtualRouterServiceProviderProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualService.VirtualRouterServiceProviderProperty) | Struct | An object that represents a virtual node service provider. |
| [`CfnVirtualService.VirtualServiceProviderProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualService.VirtualServiceProviderProperty) | Struct | An object that represents the provider for a virtual service. |
| [`CfnVirtualService.VirtualServiceSpecProperty`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualService.VirtualServiceSpecProperty) | Struct | An object that represents the specification of a virtual service. |
| [`CfnVirtualServiceProps`](/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualServiceProps) | Struct | Properties for defining a `CfnVirtualService`. |
| [`CommonGatewayRouteSpecOptions`](/v2/docs/aws-cdk-lib.aws_appmesh.CommonGatewayRouteSpecOptions) | Struct | Base options for all gateway route specs. |
| [`DnsResponseType`](/v2/docs/aws-cdk-lib.aws_appmesh.DnsResponseType) | Enum | Enum of DNS service discovery response type. |
| [`GatewayRouteAttributes`](/v2/docs/aws-cdk-lib.aws_appmesh.GatewayRouteAttributes) | Struct | Interface with properties necessary to import a reusable GatewayRoute. |
| [`GatewayRouteBaseProps`](/v2/docs/aws-cdk-lib.aws_appmesh.GatewayRouteBaseProps) | Struct | Basic configuration properties for a GatewayRoute. |
| [`GatewayRouteHostnameMatch`](/v2/docs/aws-cdk-lib.aws_appmesh.GatewayRouteHostnameMatch) | Class | Used to generate host name matching methods. |
| [`GatewayRouteHostnameMatchConfig`](/v2/docs/aws-cdk-lib.aws_appmesh.GatewayRouteHostnameMatchConfig) | Struct | Configuration for gateway route host name match. |
| [`GatewayRouteProps`](/v2/docs/aws-cdk-lib.aws_appmesh.GatewayRouteProps) | Struct | Properties to define a new GatewayRoute. |
| [`GatewayRouteSpec`](/v2/docs/aws-cdk-lib.aws_appmesh.GatewayRouteSpec) | Class | Used to generate specs with different protocols for a GatewayRoute. |
| [`GatewayRouteSpecConfig`](/v2/docs/aws-cdk-lib.aws_appmesh.GatewayRouteSpecConfig) | Struct | All Properties for GatewayRoute Specs. |
| [`GrpcConnectionPool`](/v2/docs/aws-cdk-lib.aws_appmesh.GrpcConnectionPool) | Struct | Connection pool properties for gRPC listeners. |
| [`GrpcGatewayListenerOptions`](/v2/docs/aws-cdk-lib.aws_appmesh.GrpcGatewayListenerOptions) | Struct | Represents the properties needed to define GRPC Listeners for a VirtualGateway. |
| [`GrpcGatewayRouteMatch`](/v2/docs/aws-cdk-lib.aws_appmesh.GrpcGatewayRouteMatch) | Struct | The criterion for determining a request match for this GatewayRoute. |
| [`GrpcGatewayRouteSpecOptions`](/v2/docs/aws-cdk-lib.aws_appmesh.GrpcGatewayRouteSpecOptions) | Struct | Properties specific for a gRPC GatewayRoute. |
| [`GrpcHealthCheckOptions`](/v2/docs/aws-cdk-lib.aws_appmesh.GrpcHealthCheckOptions) | Struct | Properties used to define GRPC Based healthchecks. |
| [`GrpcRetryEvent`](/v2/docs/aws-cdk-lib.aws_appmesh.GrpcRetryEvent) | Enum | gRPC events. |
| [`GrpcRetryPolicy`](/v2/docs/aws-cdk-lib.aws_appmesh.GrpcRetryPolicy) | Struct | gRPC retry policy. |
| [`GrpcRouteMatch`](/v2/docs/aws-cdk-lib.aws_appmesh.GrpcRouteMatch) | Struct | The criterion for determining a request match for this Route. |
| [`GrpcRouteSpecOptions`](/v2/docs/aws-cdk-lib.aws_appmesh.GrpcRouteSpecOptions) | Struct | Properties specific for a GRPC Based Routes. |
| [`GrpcTimeout`](/v2/docs/aws-cdk-lib.aws_appmesh.GrpcTimeout) | Struct | Represents timeouts for GRPC protocols. |
| [`GrpcVirtualNodeListenerOptions`](/v2/docs/aws-cdk-lib.aws_appmesh.GrpcVirtualNodeListenerOptions) | Struct | Represent the GRPC Node Listener property. |
| [`HeaderMatch`](/v2/docs/aws-cdk-lib.aws_appmesh.HeaderMatch) | Class | Used to generate header matching methods. |
| [`HeaderMatchConfig`](/v2/docs/aws-cdk-lib.aws_appmesh.HeaderMatchConfig) | Struct | Configuration for `HeaderMatch`. |
| [`HealthCheck`](/v2/docs/aws-cdk-lib.aws_appmesh.HealthCheck) | Class | Contains static factory methods for creating health checks for different protocols. |
| [`HealthCheckBindOptions`](/v2/docs/aws-cdk-lib.aws_appmesh.HealthCheckBindOptions) | Struct | Options used for creating the Health Check object. |
| [`HealthCheckConfig`](/v2/docs/aws-cdk-lib.aws_appmesh.HealthCheckConfig) | Struct | All Properties for Health Checks for mesh endpoints. |
| [`Http2ConnectionPool`](/v2/docs/aws-cdk-lib.aws_appmesh.Http2ConnectionPool) | Struct | Connection pool properties for HTTP2 listeners. |
| [`Http2GatewayListenerOptions`](/v2/docs/aws-cdk-lib.aws_appmesh.Http2GatewayListenerOptions) | Struct | Represents the properties needed to define HTTP2 Listeners for a VirtualGateway. |
| [`Http2VirtualNodeListenerOptions`](/v2/docs/aws-cdk-lib.aws_appmesh.Http2VirtualNodeListenerOptions) | Struct | Represent the HTTP2 Node Listener property. |
| [`HttpConnectionPool`](/v2/docs/aws-cdk-lib.aws_appmesh.HttpConnectionPool) | Struct | Connection pool properties for HTTP listeners. |
| [`HttpGatewayListenerOptions`](/v2/docs/aws-cdk-lib.aws_appmesh.HttpGatewayListenerOptions) | Struct | Represents the properties needed to define HTTP Listeners for a VirtualGateway. |
| [`HttpGatewayRouteMatch`](/v2/docs/aws-cdk-lib.aws_appmesh.HttpGatewayRouteMatch) | Struct | The criterion for determining a request match for this GatewayRoute. |
| [`HttpGatewayRoutePathMatch`](/v2/docs/aws-cdk-lib.aws_appmesh.HttpGatewayRoutePathMatch) | Class | Defines HTTP gateway route matching based on the URL path of the request. |
| [`HttpGatewayRoutePathMatchConfig`](/v2/docs/aws-cdk-lib.aws_appmesh.HttpGatewayRoutePathMatchConfig) | Struct | The type returned from the `bind()` method in `HttpGatewayRoutePathMatch`. |
| [`HttpGatewayRouteSpecOptions`](/v2/docs/aws-cdk-lib.aws_appmesh.HttpGatewayRouteSpecOptions) | Struct | Properties specific for HTTP Based GatewayRoutes. |
| [`HttpHealthCheckOptions`](/v2/docs/aws-cdk-lib.aws_appmesh.HttpHealthCheckOptions) | Struct | Properties used to define HTTP Based healthchecks. |
| [`HttpRetryEvent`](/v2/docs/aws-cdk-lib.aws_appmesh.HttpRetryEvent) | Enum | HTTP events on which to retry. |
| [`HttpRetryPolicy`](/v2/docs/aws-cdk-lib.aws_appmesh.HttpRetryPolicy) | Struct | HTTP retry policy. |
| [`HttpRouteMatch`](/v2/docs/aws-cdk-lib.aws_appmesh.HttpRouteMatch) | Struct | The criterion for determining a request match for this Route. |
| [`HttpRouteMethod`](/v2/docs/aws-cdk-lib.aws_appmesh.HttpRouteMethod) | Enum | Supported values for matching routes based on the HTTP request method. |
| [`HttpRoutePathMatch`](/v2/docs/aws-cdk-lib.aws_appmesh.HttpRoutePathMatch) | Class | Defines HTTP route matching based on the URL path of the request. |
| [`HttpRoutePathMatchConfig`](/v2/docs/aws-cdk-lib.aws_appmesh.HttpRoutePathMatchConfig) | Struct | The type returned from the `bind()` method in `HttpRoutePathMatch`. |
| [`HttpRouteProtocol`](/v2/docs/aws-cdk-lib.aws_appmesh.HttpRouteProtocol) | Enum | Supported :scheme options for HTTP2. |
| [`HttpRouteSpecOptions`](/v2/docs/aws-cdk-lib.aws_appmesh.HttpRouteSpecOptions) | Struct | Properties specific for HTTP Based Routes. |
| [`HttpTimeout`](/v2/docs/aws-cdk-lib.aws_appmesh.HttpTimeout) | Struct | Represents timeouts for HTTP protocols. |
| [`HttpVirtualNodeListenerOptions`](/v2/docs/aws-cdk-lib.aws_appmesh.HttpVirtualNodeListenerOptions) | Struct | Represent the HTTP Node Listener property. |
| [`IGatewayRoute`](/v2/docs/aws-cdk-lib.aws_appmesh.IGatewayRoute) | Interface | Interface for which all GatewayRoute based classes MUST implement. |
| [`IMesh`](/v2/docs/aws-cdk-lib.aws_appmesh.IMesh) | Interface | Interface which all Mesh based classes MUST implement. |
| [`IpPreference`](/v2/docs/aws-cdk-lib.aws_appmesh.IpPreference) | Enum | Enum of supported IP preferences. |
| [`IRoute`](/v2/docs/aws-cdk-lib.aws_appmesh.IRoute) | Interface | Interface for which all Route based classes MUST implement. |
| [`IVirtualGateway`](/v2/docs/aws-cdk-lib.aws_appmesh.IVirtualGateway) | Interface | Interface which all Virtual Gateway based classes must implement. |
| [`IVirtualNode`](/v2/docs/aws-cdk-lib.aws_appmesh.IVirtualNode) | Interface | Interface which all VirtualNode based classes must implement. |
| [`IVirtualRouter`](/v2/docs/aws-cdk-lib.aws_appmesh.IVirtualRouter) | Interface | Interface which all VirtualRouter based classes MUST implement. |
| [`IVirtualService`](/v2/docs/aws-cdk-lib.aws_appmesh.IVirtualService) | Interface | Represents the interface which all VirtualService based classes MUST implement. |
| [`ListenerTlsOptions`](/v2/docs/aws-cdk-lib.aws_appmesh.ListenerTlsOptions) | Struct | Represents TLS properties for listener. |
| [`LoggingFormat`](/v2/docs/aws-cdk-lib.aws_appmesh.LoggingFormat) | Class | Configuration for Envoy Access Logging Format for mesh endpoints. |
| [`LoggingFormatConfig`](/v2/docs/aws-cdk-lib.aws_appmesh.LoggingFormatConfig) | Struct | All Properties for Envoy Access Logging Format for mesh endpoints. |
| [`MeshFilterType`](/v2/docs/aws-cdk-lib.aws_appmesh.MeshFilterType) | Enum | A utility enum defined for the egressFilter type property, the default of DROP_ALL, allows traffic only to other resources inside the mesh, or API calls to amazon resources. |
| [`MeshProps`](/v2/docs/aws-cdk-lib.aws_appmesh.MeshProps) | Struct | The set of properties used when creating a Mesh. |
| [`MeshServiceDiscovery`](/v2/docs/aws-cdk-lib.aws_appmesh.MeshServiceDiscovery) | Struct | Properties for Mesh Service Discovery. |
| [`MutualTlsCertificate`](/v2/docs/aws-cdk-lib.aws_appmesh.MutualTlsCertificate) | Class | Represents a TLS certificate that is supported for mutual TLS authentication. |
| [`MutualTlsValidation`](/v2/docs/aws-cdk-lib.aws_appmesh.MutualTlsValidation) | Struct | Represents the properties needed to define TLS Validation context that is supported for mutual TLS authentication. |
| [`MutualTlsValidationTrust`](/v2/docs/aws-cdk-lib.aws_appmesh.MutualTlsValidationTrust) | Class | Represents a TLS Validation Context Trust that is supported for mutual TLS authentication. |
| [`OutlierDetection`](/v2/docs/aws-cdk-lib.aws_appmesh.OutlierDetection) | Struct | Represents the outlier detection for a listener. |
| [`QueryParameterMatch`](/v2/docs/aws-cdk-lib.aws_appmesh.QueryParameterMatch) | Class | Used to generate query parameter matching methods. |
| [`QueryParameterMatchConfig`](/v2/docs/aws-cdk-lib.aws_appmesh.QueryParameterMatchConfig) | Struct | Configuration for `QueryParameterMatch`. |
| [`RouteAttributes`](/v2/docs/aws-cdk-lib.aws_appmesh.RouteAttributes) | Struct | Interface with properties ncecessary to import a reusable Route. |
| [`RouteBaseProps`](/v2/docs/aws-cdk-lib.aws_appmesh.RouteBaseProps) | Struct | Base interface properties for all Routes. |
| [`RouteProps`](/v2/docs/aws-cdk-lib.aws_appmesh.RouteProps) | Struct | Properties to define new Routes. |
| [`RouteSpec`](/v2/docs/aws-cdk-lib.aws_appmesh.RouteSpec) | Class | Used to generate specs with different protocols for a RouteSpec. |
| [`RouteSpecConfig`](/v2/docs/aws-cdk-lib.aws_appmesh.RouteSpecConfig) | Struct | All Properties for Route Specs. |
| [`RouteSpecOptionsBase`](/v2/docs/aws-cdk-lib.aws_appmesh.RouteSpecOptionsBase) | Struct | Base options for all route specs. |
| [`ServiceDiscovery`](/v2/docs/aws-cdk-lib.aws_appmesh.ServiceDiscovery) | Class | Provides the Service Discovery method a VirtualNode uses. |
| [`ServiceDiscoveryConfig`](/v2/docs/aws-cdk-lib.aws_appmesh.ServiceDiscoveryConfig) | Struct | Properties for VirtualNode Service Discovery. |
| [`SubjectAlternativeNames`](/v2/docs/aws-cdk-lib.aws_appmesh.SubjectAlternativeNames) | Class | Used to generate Subject Alternative Names Matchers. |
| [`SubjectAlternativeNamesMatcherConfig`](/v2/docs/aws-cdk-lib.aws_appmesh.SubjectAlternativeNamesMatcherConfig) | Struct | All Properties for Subject Alternative Names Matcher for both Client Policy and Listener. |
| [`TcpConnectionPool`](/v2/docs/aws-cdk-lib.aws_appmesh.TcpConnectionPool) | Struct | Connection pool properties for TCP listeners. |
| [`TcpHealthCheckOptions`](/v2/docs/aws-cdk-lib.aws_appmesh.TcpHealthCheckOptions) | Struct | Properties used to define TCP Based healthchecks. |
| [`TcpRetryEvent`](/v2/docs/aws-cdk-lib.aws_appmesh.TcpRetryEvent) | Enum | TCP events on which you may retry. |
| [`TcpRouteSpecOptions`](/v2/docs/aws-cdk-lib.aws_appmesh.TcpRouteSpecOptions) | Struct | Properties specific for a TCP Based Routes. |
| [`TcpTimeout`](/v2/docs/aws-cdk-lib.aws_appmesh.TcpTimeout) | Struct | Represents timeouts for TCP protocols. |
| [`TcpVirtualNodeListenerOptions`](/v2/docs/aws-cdk-lib.aws_appmesh.TcpVirtualNodeListenerOptions) | Struct | Represent the TCP Node Listener property. |
| [`TlsCertificate`](/v2/docs/aws-cdk-lib.aws_appmesh.TlsCertificate) | Class | Represents a TLS certificate. |
| [`TlsCertificateConfig`](/v2/docs/aws-cdk-lib.aws_appmesh.TlsCertificateConfig) | Struct | A wrapper for the tls config returned by `TlsCertificate.bind`. |
| [`TlsClientPolicy`](/v2/docs/aws-cdk-lib.aws_appmesh.TlsClientPolicy) | Struct | Represents the properties needed to define client policy. |
| [`TlsMode`](/v2/docs/aws-cdk-lib.aws_appmesh.TlsMode) | Enum | Enum of supported TLS modes. |
| [`TlsValidation`](/v2/docs/aws-cdk-lib.aws_appmesh.TlsValidation) | Struct | Represents the properties needed to define TLS Validation context. |
| [`TlsValidationTrust`](/v2/docs/aws-cdk-lib.aws_appmesh.TlsValidationTrust) | Class | Defines the TLS Validation Context Trust. |
| [`TlsValidationTrustConfig`](/v2/docs/aws-cdk-lib.aws_appmesh.TlsValidationTrustConfig) | Struct | All Properties for TLS Validation Trusts for both Client Policy and Listener. |
| [`VirtualGatewayAttributes`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualGatewayAttributes) | Struct | Unterface with properties necessary to import a reusable VirtualGateway. |
| [`VirtualGatewayBaseProps`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualGatewayBaseProps) | Struct | Basic configuration properties for a VirtualGateway. |
| [`VirtualGatewayGrants`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualGatewayGrants) | Facade | Collection of grant methods for a IVirtualGatewayRef. |
| [`VirtualGatewayListener`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualGatewayListener) | Class | Represents the properties needed to define listeners for a VirtualGateway. |
| [`VirtualGatewayListenerConfig`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualGatewayListenerConfig) | Struct | Properties for a VirtualGateway listener. |
| [`VirtualGatewayProps`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualGatewayProps) | Struct | Properties used when creating a new VirtualGateway. |
| [`VirtualNodeAttributes`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualNodeAttributes) | Struct | Interface with properties necessary to import a reusable VirtualNode. |
| [`VirtualNodeBaseProps`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualNodeBaseProps) | Struct | Basic configuration properties for a VirtualNode. |
| [`VirtualNodeGrants`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualNodeGrants) | Facade | Collection of grant methods for a IVirtualNodeRef. |
| [`VirtualNodeListener`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualNodeListener) | Class | Defines listener for a VirtualNode. |
| [`VirtualNodeListenerConfig`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualNodeListenerConfig) | Struct | Properties for a VirtualNode listener. |
| [`VirtualNodeProps`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualNodeProps) | Struct | The properties used when creating a new VirtualNode. |
| [`VirtualRouterAttributes`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualRouterAttributes) | Struct | Interface with properties ncecessary to import a reusable VirtualRouter. |
| [`VirtualRouterBaseProps`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualRouterBaseProps) | Struct | Interface with base properties all routers willl inherit. |
| [`VirtualRouterListener`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualRouterListener) | Class | Represents the properties needed to define listeners for a VirtualRouter. |
| [`VirtualRouterListenerConfig`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualRouterListenerConfig) | Struct | Properties for a VirtualRouter listener. |
| [`VirtualRouterProps`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualRouterProps) | Struct | The properties used when creating a new VirtualRouter. |
| [`VirtualServiceAttributes`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualServiceAttributes) | Struct | Interface with properties ncecessary to import a reusable VirtualService. |
| [`VirtualServiceBackendOptions`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualServiceBackendOptions) | Struct | Represents the properties needed to define a Virtual Service backend. |
| [`VirtualServiceProps`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualServiceProps) | Struct | The properties applied to the VirtualService being defined. |
| [`VirtualServiceProvider`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualServiceProvider) | Class | Represents the properties needed to define the provider for a VirtualService. |
| [`VirtualServiceProviderConfig`](/v2/docs/aws-cdk-lib.aws_appmesh.VirtualServiceProviderConfig) | Struct | Properties for a VirtualService provider. |
| [`WeightedTarget`](/v2/docs/aws-cdk-lib.aws_appmesh.WeightedTarget) | Struct | Properties for the Weighted Targets in the route. |
