package
1.204.0-devpreview
Repository: https://github.com/aws/aws-cdk-go.git
Documentation: pkg.go.dev

# README

AWS App Mesh Construct Library

AWS App Mesh is a service mesh based on the Envoy 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.

Create the App and Stack

app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("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 for more info on egress filters.

mesh := appmesh.NewMesh(this, jsii.String("AppMesh"), &MeshProps{
	MeshName: jsii.String("myAwsMesh"),
})

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

mesh := appmesh.NewMesh(this, jsii.String("AppMesh"), &MeshProps{
	MeshName: jsii.String("myAwsMesh"),
	EgressFilter: appmesh.MeshFilterType_ALLOW_ALL,
})

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.

var mesh mesh

router := mesh.addVirtualRouter(jsii.String("router"), &VirtualRouterBaseProps{
	Listeners: []virtualRouterListener{
		appmesh.*virtualRouterListener_Http(jsii.Number(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 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:

var infraStack stack
var appStack stack


mesh := appmesh.NewMesh(infraStack, jsii.String("AppMesh"), &MeshProps{
	MeshName: jsii.String("myAwsMesh"),
	EgressFilter: appmesh.MeshFilterType_ALLOW_ALL,
})

// the VirtualRouter will belong to 'appStack',
// even though the Mesh belongs to 'infraStack'
router := appmesh.NewVirtualRouter(appStack, jsii.String("router"), &VirtualRouterProps{
	Mesh: Mesh,
	 // notice that mesh is a required property when creating a router with the 'new' statement
	Listeners: []virtualRouterListener{
		appmesh.*virtualRouterListener_Http(jsii.Number(8081)),
	},
})

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

The 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:

var router virtualRouter


appmesh.NewVirtualService(this, jsii.String("virtual-service"), &VirtualServiceProps{
	VirtualServiceName: jsii.String("my-service.default.svc.cluster.local"),
	 // optional
	VirtualServiceProvider: appmesh.VirtualServiceProvider_VirtualRouter(router),
})

Adding a virtual node as the provider:

var node virtualNode


appmesh.NewVirtualService(this, jsii.String("virtual-service"), &VirtualServiceProps{
	VirtualServiceName: jsii.String("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.

var mesh mesh
vpc := ec2.NewVpc(this, jsii.String("vpc"))
namespace := cloudmap.NewPrivateDnsNamespace(this, jsii.String("test-namespace"), &PrivateDnsNamespaceProps{
	Vpc: Vpc,
	Name: jsii.String("domain.local"),
})
service := namespace.CreateService(jsii.String("Svc"))
node := mesh.addVirtualNode(jsii.String("virtual-node"), &VirtualNodeBaseProps{
	ServiceDiscovery: appmesh.ServiceDiscovery_CloudMap(service),
	Listeners: []virtualNodeListener{
		appmesh.*virtualNodeListener_Http(&HttpVirtualNodeListenerOptions{
			Port: jsii.Number(8081),
			HealthCheck: appmesh.HealthCheck_Http(&HttpHealthCheckOptions{
				HealthyThreshold: jsii.Number(3),
				Interval: cdk.Duration_Seconds(jsii.Number(5)),
				 // minimum
				Path: jsii.String("/health-check-path"),
				Timeout: cdk.Duration_*Seconds(jsii.Number(2)),
				 // minimum
				UnhealthyThreshold: jsii.Number(2),
			}),
		}),
	},
	AccessLog: appmesh.AccessLog_FromFilePath(jsii.String("/dev/stdout")),
})

Create a VirtualNode with the constructor and add tags.

var mesh mesh
var service service


node := appmesh.NewVirtualNode(this, jsii.String("node"), &VirtualNodeProps{
	Mesh: Mesh,
	ServiceDiscovery: appmesh.ServiceDiscovery_CloudMap(service),
	Listeners: []virtualNodeListener{
		appmesh.*virtualNodeListener_Http(&HttpVirtualNodeListenerOptions{
			Port: jsii.Number(8080),
			HealthCheck: appmesh.HealthCheck_Http(&HttpHealthCheckOptions{
				HealthyThreshold: jsii.Number(3),
				Interval: cdk.Duration_Seconds(jsii.Number(5)),
				Path: jsii.String("/ping"),
				Timeout: cdk.Duration_*Seconds(jsii.Number(2)),
				UnhealthyThreshold: jsii.Number(2),
			}),
			Timeout: &HttpTimeout{
				Idle: cdk.Duration_*Seconds(jsii.Number(5)),
			},
		}),
	},
	BackendDefaults: &BackendDefaults{
		TlsClientPolicy: &TlsClientPolicy{
			Validation: &TlsValidation{
				Trust: appmesh.TlsValidationTrust_File(jsii.String("/keys/local_cert_chain.pem")),
			},
		},
	},
	AccessLog: appmesh.AccessLog_FromFilePath(jsii.String("/dev/stdout")),
})

cdk.Tags_Of(node).Add(jsii.String("Environment"), jsii.String("Dev"))

Create a VirtualNode with the constructor and add backend virtual service.

var mesh mesh
var router virtualRouter
var service service


node := appmesh.NewVirtualNode(this, jsii.String("node"), &VirtualNodeProps{
	Mesh: Mesh,
	ServiceDiscovery: appmesh.ServiceDiscovery_CloudMap(service),
	Listeners: []virtualNodeListener{
		appmesh.*virtualNodeListener_Http(&HttpVirtualNodeListenerOptions{
			Port: jsii.Number(8080),
			HealthCheck: appmesh.HealthCheck_Http(&HttpHealthCheckOptions{
				HealthyThreshold: jsii.Number(3),
				Interval: cdk.Duration_Seconds(jsii.Number(5)),
				Path: jsii.String("/ping"),
				Timeout: cdk.Duration_*Seconds(jsii.Number(2)),
				UnhealthyThreshold: jsii.Number(2),
			}),
			Timeout: &HttpTimeout{
				Idle: cdk.Duration_*Seconds(jsii.Number(5)),
			},
		}),
	},
	AccessLog: appmesh.AccessLog_FromFilePath(jsii.String("/dev/stdout")),
})

virtualService := appmesh.NewVirtualService(this, jsii.String("service-1"), &VirtualServiceProps{
	VirtualServiceProvider: appmesh.VirtualServiceProvider_VirtualRouter(router),
	VirtualServiceName: jsii.String("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:

var mesh mesh


node := appmesh.NewVirtualNode(this, jsii.String("node"), &VirtualNodeProps{
	Mesh: Mesh,
	ServiceDiscovery: appmesh.ServiceDiscovery_Dns(jsii.String("node")),
})

virtualService := appmesh.NewVirtualService(this, jsii.String("service-1"), &VirtualServiceProps{
	VirtualServiceProvider: appmesh.VirtualServiceProvider_VirtualNode(node),
	VirtualServiceName: jsii.String("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).
// A Virtual Node with listener TLS from an ACM provided certificate
var cert certificate
var mesh mesh


node := appmesh.NewVirtualNode(this, jsii.String("node"), &VirtualNodeProps{
	Mesh: Mesh,
	ServiceDiscovery: appmesh.ServiceDiscovery_Dns(jsii.String("node")),
	Listeners: []virtualNodeListener{
		appmesh.*virtualNodeListener_Grpc(&GrpcVirtualNodeListenerOptions{
			Port: jsii.Number(80),
			Tls: &ListenerTlsOptions{
				Mode: appmesh.TlsMode_STRICT,
				Certificate: appmesh.TlsCertificate_Acm(cert),
			},
		}),
	},
})

// A Virtual Gateway with listener TLS from a customer provided file certificate
gateway := appmesh.NewVirtualGateway(this, jsii.String("gateway"), &VirtualGatewayProps{
	Mesh: Mesh,
	Listeners: []virtualGatewayListener{
		appmesh.*virtualGatewayListener_Grpc(&GrpcGatewayListenerOptions{
			Port: jsii.Number(8080),
			Tls: &ListenerTlsOptions{
				Mode: appmesh.TlsMode_STRICT,
				Certificate: appmesh.TlsCertificate_File(jsii.String("path/to/certChain"), jsii.String("path/to/privateKey")),
			},
		}),
	},
	VirtualGatewayName: jsii.String("gateway"),
})

// A Virtual Gateway with listener TLS from a SDS provided certificate
gateway2 := appmesh.NewVirtualGateway(this, jsii.String("gateway2"), &VirtualGatewayProps{
	Mesh: Mesh,
	Listeners: []*virtualGatewayListener{
		appmesh.*virtualGatewayListener_Http2(&Http2GatewayListenerOptions{
			Port: jsii.Number(8080),
			Tls: &ListenerTlsOptions{
				Mode: appmesh.TlsMode_STRICT,
				Certificate: appmesh.TlsCertificate_Sds(jsii.String("secrete_certificate")),
			},
		}),
	},
	VirtualGatewayName: jsii.String("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.

var mesh mesh


node1 := appmesh.NewVirtualNode(this, jsii.String("node1"), &VirtualNodeProps{
	Mesh: Mesh,
	ServiceDiscovery: appmesh.ServiceDiscovery_Dns(jsii.String("node")),
	Listeners: []virtualNodeListener{
		appmesh.*virtualNodeListener_Grpc(&GrpcVirtualNodeListenerOptions{
			Port: jsii.Number(80),
			Tls: &ListenerTlsOptions{
				Mode: appmesh.TlsMode_STRICT,
				Certificate: appmesh.TlsCertificate_File(jsii.String("path/to/certChain"), jsii.String("path/to/privateKey")),
				// Validate a file client certificates to enable mutual TLS authentication when a client provides a certificate.
				MutualTlsValidation: &MutualTlsValidation{
					Trust: appmesh.TlsValidationTrust_File(jsii.String("path-to-certificate")),
				},
			},
		}),
	},
})

certificateAuthorityArn := "arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/12345678-1234-1234-1234-123456789012"
node2 := appmesh.NewVirtualNode(this, jsii.String("node2"), &VirtualNodeProps{
	Mesh: Mesh,
	ServiceDiscovery: appmesh.ServiceDiscovery_*Dns(jsii.String("node2")),
	BackendDefaults: &BackendDefaults{
		TlsClientPolicy: &TlsClientPolicy{
			Ports: []*f64{
				jsii.Number(8080),
				jsii.Number(8081),
			},
			Validation: &TlsValidation{
				SubjectAlternativeNames: appmesh.SubjectAlternativeNames_MatchingExactly(jsii.String("mesh-endpoint.apps.local")),
				Trust: appmesh.TlsValidationTrust_Acm([]iCertificateAuthority{
					acmpca.CertificateAuthority_FromCertificateAuthorityArn(this, jsii.String("certificate"), certificateAuthorityArn),
				}),
			},
			// Provide a SDS client certificate when a server requests it and enable mutual TLS authentication.
			MutualTlsCertificate: appmesh.TlsCertificate_Sds(jsii.String("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.

var mesh mesh
// Cloud Map service discovery is currently required for host ejection by outlier detection
vpc := ec2.NewVpc(this, jsii.String("vpc"))
namespace := cloudmap.NewPrivateDnsNamespace(this, jsii.String("test-namespace"), &PrivateDnsNamespaceProps{
	Vpc: Vpc,
	Name: jsii.String("domain.local"),
})
service := namespace.CreateService(jsii.String("Svc"))
node := mesh.addVirtualNode(jsii.String("virtual-node"), &VirtualNodeBaseProps{
	ServiceDiscovery: appmesh.ServiceDiscovery_CloudMap(service),
	Listeners: []virtualNodeListener{
		appmesh.*virtualNodeListener_Http(&HttpVirtualNodeListenerOptions{
			OutlierDetection: &OutlierDetection{
				BaseEjectionDuration: cdk.Duration_Seconds(jsii.Number(10)),
				Interval: cdk.Duration_*Seconds(jsii.Number(30)),
				MaxEjectionPercent: jsii.Number(50),
				MaxServerErrors: jsii.Number(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.

// A Virtual Node with a gRPC listener with a connection pool set
var mesh mesh

node := appmesh.NewVirtualNode(this, jsii.String("node"), &VirtualNodeProps{
	Mesh: 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(jsii.String("node"), appmesh.DnsResponseType_ENDPOINTS),
	Listeners: []virtualNodeListener{
		appmesh.*virtualNodeListener_Http(&HttpVirtualNodeListenerOptions{
			Port: jsii.Number(80),
			ConnectionPool: &HttpConnectionPool{
				MaxConnections: jsii.Number(100),
				MaxPendingRequests: jsii.Number(10),
			},
		}),
	},
})

// A Virtual Gateway with a gRPC listener with a connection pool set
gateway := appmesh.NewVirtualGateway(this, jsii.String("gateway"), &VirtualGatewayProps{
	Mesh: Mesh,
	Listeners: []virtualGatewayListener{
		appmesh.*virtualGatewayListener_Grpc(&GrpcGatewayListenerOptions{
			Port: jsii.Number(8080),
			ConnectionPool: &GrpcConnectionPool{
				MaxRequests: jsii.Number(10),
			},
		}),
	},
	VirtualGatewayName: jsii.String("gateway"),
})

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 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:

var router virtualRouter
var node virtualNode


router.addRoute(jsii.String("route-http"), &RouteBaseProps{
	RouteSpec: appmesh.RouteSpec_Http(&HttpRouteSpecOptions{
		WeightedTargets: []weightedTarget{
			&weightedTarget{
				VirtualNode: node,
			},
		},
		Match: &HttpRouteMatch{
			// Path that is passed to this method must start with '/'.
			Path: appmesh.HttpRoutePathMatch_StartsWith(jsii.String("/path-to-app")),
		},
	}),
})

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

var router virtualRouter
var node virtualNode


router.addRoute(jsii.String("route-http2"), &RouteBaseProps{
	RouteSpec: appmesh.RouteSpec_Http2(&HttpRouteSpecOptions{
		WeightedTargets: []weightedTarget{
			&weightedTarget{
				VirtualNode: node,
			},
		},
		Match: &HttpRouteMatch{
			Path: appmesh.HttpRoutePathMatch_Exactly(jsii.String("/exact")),
			Method: appmesh.HttpRouteMethod_POST,
			Protocol: appmesh.HttpRouteProtocol_HTTPS,
			Headers: []headerMatch{
				appmesh.*headerMatch_ValueIs(jsii.String("Content-Type"), jsii.String("application/json")),
				appmesh.*headerMatch_ValueIsNot(jsii.String("Content-Type"), jsii.String("application/json")),
			},
			QueryParameters: []queryParameterMatch{
				appmesh.*queryParameterMatch_ValueIs(jsii.String("query-field"), jsii.String("value")),
			},
		},
	}),
})

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

var router virtualRouter
var node virtualNode


router.addRoute(jsii.String("route-http"), &RouteBaseProps{
	RouteSpec: appmesh.RouteSpec_Http(&HttpRouteSpecOptions{
		WeightedTargets: []weightedTarget{
			&weightedTarget{
				VirtualNode: node,
				Weight: jsii.Number(50),
			},
			&weightedTarget{
				VirtualNode: node,
				Weight: jsii.Number(50),
			},
		},
		Match: &HttpRouteMatch{
			Path: appmesh.HttpRoutePathMatch_StartsWith(jsii.String("/path-to-app")),
		},
	}),
})

Add an http2 route with retries:

var router virtualRouter
var node virtualNode


router.addRoute(jsii.String("route-http2-retry"), &RouteBaseProps{
	RouteSpec: appmesh.RouteSpec_Http2(&HttpRouteSpecOptions{
		WeightedTargets: []weightedTarget{
			&weightedTarget{
				VirtualNode: node,
			},
		},
		RetryPolicy: &HttpRetryPolicy{
			// Retry if the connection failed
			TcpRetryEvents: []cONNECTION_ERROR{
				appmesh.TcpRetryEvent_*cONNECTION_ERROR,
			},
			// Retry if HTTP responds with a gateway error (502, 503, 504)
			HttpRetryEvents: []httpRetryEvent{
				appmesh.*httpRetryEvent_GATEWAY_ERROR,
			},
			// Retry five times
			RetryAttempts: jsii.Number(5),
			// Use a 1 second timeout per retry
			RetryTimeout: cdk.Duration_Seconds(jsii.Number(1)),
		},
	}),
})

Add a gRPC route with retries:

var router virtualRouter
var node virtualNode


router.addRoute(jsii.String("route-grpc-retry"), &RouteBaseProps{
	RouteSpec: appmesh.RouteSpec_Grpc(&GrpcRouteSpecOptions{
		WeightedTargets: []weightedTarget{
			&weightedTarget{
				VirtualNode: node,
			},
		},
		Match: &GrpcRouteMatch{
			ServiceName: jsii.String("servicename"),
		},
		RetryPolicy: &GrpcRetryPolicy{
			TcpRetryEvents: []cONNECTION_ERROR{
				appmesh.TcpRetryEvent_*cONNECTION_ERROR,
			},
			HttpRetryEvents: []httpRetryEvent{
				appmesh.*httpRetryEvent_GATEWAY_ERROR,
			},
			// Retry if gRPC responds that the request was cancelled, a resource
			// was exhausted, or if the service is unavailable
			GrpcRetryEvents: []grpcRetryEvent{
				appmesh.*grpcRetryEvent_CANCELLED,
				appmesh.*grpcRetryEvent_RESOURCE_EXHAUSTED,
				appmesh.*grpcRetryEvent_UNAVAILABLE,
			},
			RetryAttempts: jsii.Number(5),
			RetryTimeout: cdk.Duration_Seconds(jsii.Number(1)),
		},
	}),
})

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

var router virtualRouter
var node virtualNode


router.addRoute(jsii.String("route-grpc-retry"), &RouteBaseProps{
	RouteSpec: appmesh.RouteSpec_Grpc(&GrpcRouteSpecOptions{
		WeightedTargets: []weightedTarget{
			&weightedTarget{
				VirtualNode: node,
			},
		},
		Match: &GrpcRouteMatch{
			// When method name is specified, service name must be also specified.
			MethodName: jsii.String("methodname"),
			ServiceName: jsii.String("servicename"),
			Metadata: []headerMatch{
				appmesh.*headerMatch_ValueStartsWith(jsii.String("Content-Type"), jsii.String("application/")),
				appmesh.*headerMatch_ValueDoesNotStartWith(jsii.String("Content-Type"), jsii.String("text/")),
			},
		},
	}),
})

Add a gRPC route with timeout:

var router virtualRouter
var node virtualNode


router.addRoute(jsii.String("route-http"), &RouteBaseProps{
	RouteSpec: appmesh.RouteSpec_Grpc(&GrpcRouteSpecOptions{
		WeightedTargets: []weightedTarget{
			&weightedTarget{
				VirtualNode: node,
			},
		},
		Match: &GrpcRouteMatch{
			ServiceName: jsii.String("my-service.default.svc.cluster.local"),
		},
		Timeout: &GrpcTimeout{
			Idle: cdk.Duration_Seconds(jsii.Number(2)),
			PerRequest: cdk.Duration_*Seconds(jsii.Number(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:

var mesh mesh

certificateAuthorityArn := "arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/12345678-1234-1234-1234-123456789012"

gateway := appmesh.NewVirtualGateway(this, jsii.String("gateway"), &VirtualGatewayProps{
	Mesh: mesh,
	Listeners: []virtualGatewayListener{
		appmesh.*virtualGatewayListener_Http(&HttpGatewayListenerOptions{
			Port: jsii.Number(443),
			HealthCheck: appmesh.HealthCheck_Http(&HttpHealthCheckOptions{
				Interval: cdk.Duration_Seconds(jsii.Number(10)),
			}),
		}),
	},
	BackendDefaults: &BackendDefaults{
		TlsClientPolicy: &TlsClientPolicy{
			Ports: []*f64{
				jsii.Number(8080),
				jsii.Number(8081),
			},
			Validation: &TlsValidation{
				Trust: appmesh.TlsValidationTrust_Acm([]iCertificateAuthority{
					acmpca.CertificateAuthority_FromCertificateAuthorityArn(this, jsii.String("certificate"), certificateAuthorityArn),
				}),
			},
		},
	},
	AccessLog: appmesh.AccessLog_FromFilePath(jsii.String("/dev/stdout")),
	VirtualGatewayName: jsii.String("virtualGateway"),
})

Add a virtual gateway directly to the mesh:

var mesh mesh


gateway := mesh.addVirtualGateway(jsii.String("gateway"), &VirtualGatewayBaseProps{
	AccessLog: appmesh.AccessLog_FromFilePath(jsii.String("/dev/stdout")),
	VirtualGatewayName: jsii.String("virtualGateway"),
	Listeners: []virtualGatewayListener{
		appmesh.*virtualGatewayListener_Http(&HttpGatewayListenerOptions{
			Port: jsii.Number(443),
			HealthCheck: appmesh.HealthCheck_Http(&HttpHealthCheckOptions{
				Interval: cdk.Duration_Seconds(jsii.Number(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.

var gateway virtualGateway
var virtualService virtualService


gateway.addGatewayRoute(jsii.String("gateway-route-http"), &GatewayRouteBaseProps{
	RouteSpec: appmesh.GatewayRouteSpec_Http(&HttpGatewayRouteSpecOptions{
		RouteTarget: virtualService,
		Match: &HttpGatewayRouteMatch{
			Path: appmesh.HttpGatewayRoutePathMatch_Regex(jsii.String("regex")),
		},
	}),
})

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

var gateway virtualGateway
var virtualService virtualService


gateway.addGatewayRoute(jsii.String("gateway-route-grpc"), &GatewayRouteBaseProps{
	RouteSpec: appmesh.GatewayRouteSpec_Grpc(&GrpcGatewayRouteSpecOptions{
		RouteTarget: virtualService,
		Match: &GrpcGatewayRouteMatch{
			Hostname: appmesh.GatewayRouteHostnameMatch_EndsWith(jsii.String(".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:

var gateway virtualGateway
var virtualService virtualService


gateway.addGatewayRoute(jsii.String("gateway-route-http"), &GatewayRouteBaseProps{
	RouteSpec: appmesh.GatewayRouteSpec_Http(&HttpGatewayRouteSpecOptions{
		RouteTarget: virtualService,
		Match: &HttpGatewayRouteMatch{
			// This disables the default rewrite to '/', and retains original path.
			Path: appmesh.HttpGatewayRoutePathMatch_StartsWith(jsii.String("/path-to-app/"), jsii.String("")),
		},
	}),
})

gateway.addGatewayRoute(jsii.String("gateway-route-http-1"), &GatewayRouteBaseProps{
	RouteSpec: appmesh.GatewayRouteSpec_*Http(&HttpGatewayRouteSpecOptions{
		RouteTarget: virtualService,
		Match: &HttpGatewayRouteMatch{
			// 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(jsii.String("/path-to-app/"), jsii.String("/rewrittenUri/")),
		},
	}),
})

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

var gateway virtualGateway
var virtualService virtualService


gateway.addGatewayRoute(jsii.String("gateway-route-http-2"), &GatewayRouteBaseProps{
	RouteSpec: appmesh.GatewayRouteSpec_Http(&HttpGatewayRouteSpecOptions{
		RouteTarget: virtualService,
		Match: &HttpGatewayRouteMatch{
			// This rewrites the path from '/test' to '/rewrittenPath'.
			Path: appmesh.HttpGatewayRoutePathMatch_Exactly(jsii.String("/test"), jsii.String("/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:

var gateway virtualGateway
var virtualService virtualService


gateway.addGatewayRoute(jsii.String("gateway-route-grpc"), &GatewayRouteBaseProps{
	RouteSpec: appmesh.GatewayRouteSpec_Grpc(&GrpcGatewayRouteSpecOptions{
		RouteTarget: virtualService,
		Match: &GrpcGatewayRouteMatch{
			Hostname: appmesh.GatewayRouteHostnameMatch_Exactly(jsii.String("example.com")),
			// This disables the default rewrite to virtual service name and retain original request.
			RewriteRequestHostname: jsii.Boolean(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) 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.

arn := "arn:aws:appmesh:us-east-1:123456789012:mesh/testMesh/virtualNode/testNode"
appmesh.VirtualNode_FromVirtualNodeArn(this, jsii.String("importedVirtualNode"), arn)
virtualNodeName := "my-virtual-node"
appmesh.VirtualNode_FromVirtualNodeAttributes(this, jsii.String("imported-virtual-node"), &VirtualNodeAttributes{
	Mesh: appmesh.Mesh_FromMeshName(this, jsii.String("Mesh"), jsii.String("testMesh")),
	VirtualNodeName: virtualNodeName,
})

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

arn := "arn:aws:appmesh:us-east-1:123456789012:mesh/testMesh"
appmesh.Mesh_FromMeshArn(this, jsii.String("imported-mesh"), arn)
appmesh.Mesh_FromMeshName(this, jsii.String("imported-mesh"), jsii.String("abc"))

IAM Grants

VirtualNode and VirtualGateway provide grantStreamAggregatedResources methods that grant identities that are running Envoy access to stream generated config from App Mesh.

var mesh mesh

gateway := appmesh.NewVirtualGateway(this, jsii.String("testGateway"), &VirtualGatewayProps{
	Mesh: Mesh,
})
envoyUser := iam.NewUser(this, jsii.String("envoyUser"))

/**
 * This will grant `grantStreamAggregatedResources` ONLY for this gateway.
 */
gateway.grantStreamAggregatedResources(envoyUser)

Adding Resources to shared meshes

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

// 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
arn := "arn:aws:appmesh:us-east-1:123456789012:mesh/testMesh"
sharedMesh := appmesh.Mesh_FromMeshArn(this, jsii.String("imported-mesh"), arn)

// This VirtualNode resource can communicate with the resources in the mesh from different AWS IAM account ID.
// This VirtualNode resource can communicate with the resources in the mesh from different AWS IAM account ID.
appmesh.NewVirtualNode(this, jsii.String("test-node"), &VirtualNodeProps{
	Mesh: sharedMesh,
})

# Functions

Path to a file to write access logs to.
Construct a Virtual Service backend.
No description provided by the author
Returns `true` if a construct is a stack element (i.e.
Check whether the given construct is a CfnResource.
Return whether the given object is a Construct.
No description provided by the author
Returns `true` if a construct is a stack element (i.e.
Check whether the given construct is a CfnResource.
Return whether the given object is a Construct.
No description provided by the author
Returns `true` if a construct is a stack element (i.e.
Check whether the given construct is a CfnResource.
Return whether the given object is a Construct.
No description provided by the author
Returns `true` if a construct is a stack element (i.e.
Check whether the given construct is a CfnResource.
Return whether the given object is a Construct.
No description provided by the author
Returns `true` if a construct is a stack element (i.e.
Check whether the given construct is a CfnResource.
Return whether the given object is a Construct.
No description provided by the author
Returns `true` if a construct is a stack element (i.e.
Check whether the given construct is a CfnResource.
Return whether the given object is a Construct.
No description provided by the author
Returns `true` if a construct is a stack element (i.e.
Check whether the given construct is a CfnResource.
Return whether the given object is a Construct.
Import an existing GatewayRoute given an ARN.
Import an existing GatewayRoute given attributes.
Return whether the given object is a Construct.
Check whether the given construct is a Resource.
The value of the host name with the given name must end with the specified characters.
The value of the host name must match the specified value exactly.
Creates an gRPC Based GatewayRoute.
Creates an HTTP Based GatewayRoute.
Creates an HTTP2 Based GatewayRoute.
The value of the header with the given name in the request must not end with the specified characters.
The value of the header with the given name in the request must not include the specified characters.
The value of the header with the given name in the request must not start with the specified characters.
The value of the header with the given name in the request must end with the specified characters.
The value of the header with the given name in the request must match the specified value exactly.
The value of the header with the given name in the request must not match the specified value exactly.
The value of the header with the given name in the request must include the specified characters.
The value of the header with the given name in the request must be in a range of values.
The value of the header with the given name in the request must not be in a range of values.
The value of the header with the given name in the request must start with the specified characters.
Construct a GRPC health check.
Construct a HTTP health check.
Construct a HTTP2 health check.
Construct a TCP health check.
The value of the path must match the specified value exactly.
The value of the path must match the specified regex.
The value of the path must match the specified prefix.
The value of the path must match the specified value exactly.
The value of the path must match the specified regex.
The value of the path must match the specified prefix.
Import an existing mesh by arn.
Import an existing mesh by name.
Return whether the given object is a Construct.
Check whether the given construct is a Resource.
Returns an ACM TLS Certificate.
Returns an File TLS Certificate.
Returns an SDS TLS Certificate.
TLS Validation Context Trust for ACM Private Certificate Authority (CA).
Tells envoy where to fetch the validation context from.
TLS Validation Context Trust for Envoy' service discovery service.
Experimental.
Experimental.
Create a new `AWS::AppMesh::GatewayRoute`.
Create a new `AWS::AppMesh::GatewayRoute`.
Create a new `AWS::AppMesh::Mesh`.
Create a new `AWS::AppMesh::Mesh`.
Create a new `AWS::AppMesh::Route`.
Create a new `AWS::AppMesh::Route`.
Create a new `AWS::AppMesh::VirtualGateway`.
Create a new `AWS::AppMesh::VirtualGateway`.
Create a new `AWS::AppMesh::VirtualNode`.
Create a new `AWS::AppMesh::VirtualNode`.
Create a new `AWS::AppMesh::VirtualRouter`.
Create a new `AWS::AppMesh::VirtualRouter`.
Create a new `AWS::AppMesh::VirtualService`.
Create a new `AWS::AppMesh::VirtualService`.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
Experimental.
The value of the query parameter with the given name in the request must match the specified value exactly.
Import an existing Route given an ARN.
Import an existing Route given attributes.
Return whether the given object is a Construct.
Check whether the given construct is a Resource.
Creates a GRPC Based RouteSpec.
Creates an HTTP Based RouteSpec.
Creates an HTTP2 Based RouteSpec.
Creates a TCP Based RouteSpec.
Returns Cloud Map based service discovery.
Returns DNS based service discovery.
The values of the SAN must match the specified values exactly.
Returns an ACM TLS Certificate.
Returns an File TLS Certificate.
Returns an SDS TLS Certificate.
TLS Validation Context Trust for ACM Private Certificate Authority (CA).
Tells envoy where to fetch the validation context from.
TLS Validation Context Trust for Envoy' service discovery service.
Import an existing VirtualGateway given an ARN.
Import an existing VirtualGateway given its attributes.
Return whether the given object is a Construct.
Check whether the given construct is a Resource.
Returns a GRPC Listener for a VirtualGateway.
Returns an HTTP Listener for a VirtualGateway.
Returns an HTTP2 Listener for a VirtualGateway.
Import an existing VirtualNode given an ARN.
Import an existing VirtualNode given its name.
Return whether the given object is a Construct.
Check whether the given construct is a Resource.
Returns an GRPC Listener for a VirtualNode.
Returns an HTTP Listener for a VirtualNode.
Returns an HTTP2 Listener for a VirtualNode.
Returns an TCP Listener for a VirtualNode.
Import an existing VirtualRouter given an ARN.
Import an existing VirtualRouter given attributes.
Return whether the given object is a Construct.
Check whether the given construct is a Resource.
Returns a GRPC Listener for a VirtualRouter.
Returns an HTTP Listener for a VirtualRouter.
Returns an HTTP2 Listener for a VirtualRouter.
Returns a TCP Listener for a VirtualRouter.
Import an existing VirtualService given an ARN.
Import an existing VirtualService given its attributes.
Return whether the given object is a Construct.
Check whether the given construct is a Resource.
Returns an Empty Provider for a VirtualService.
Returns a VirtualNode based Provider for a VirtualService.
Returns a VirtualRouter based Provider for a VirtualService.

# Constants

DNS resolver is returning all the endpoints.
DNS resolver returns a loadbalanced set of endpoints and the traffic would be sent to the given endpoints.
Request was cancelled.
The deadline was exceeded.
Internal error.
A resource was exhausted.
The service is unavailable.
HTTP status code 409.
HTTP status codes 502, 503, and 504.
HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511.
Retry on refused stream.
CONNECT request.
DELETE request.
GET request.
HEAD request.
OPTIONS request.
PATCH request.
HttpRouteMethod_POST
POST request.
PUT request.
TRACE request.
Match HTTP requests.
Match HTTPS requests.
Allows all outbound traffic.
Allows traffic only to other resources inside the mesh, or API calls to amazon resources.
Deprecated: not for use outside package.
Deprecated: not for use outside package.
Deprecated: not for use outside package.
Deprecated: not for use outside package.
A connection error.
TLS is disabled, only accept plaintext traffic.
Accept encrypted and plaintext traffic.
Only accept encrypted traffic.

# Structs

All Properties for Envoy Access logs for mesh endpoints.
Properties for a backend.
Represents the properties needed to define backend defaults.
An object representing the gateway route host name to match.
An object representing the gateway route host name to rewrite.
An object representing the method header to be matched.
An object that represents the range of values to match on.
An object that represents a gateway route specification.
An object that represents a gateway route target.
An object that represents the virtual service that traffic is routed to.
An object that represents the action to take if a match is determined.
An object that represents the criteria for determining a request match.
An object representing the metadata of the gateway route.
An object that represents a gRPC gateway route.
An object that represents the gateway route to rewrite.
An object that represents the action to take if a match is determined.
An object that represents the method and value to match with the header value sent in a request.
An object that represents the HTTP header in the gateway route.
An object that represents the criteria for determining a request match.
An object that represents the path to rewrite.
An object representing the beginning characters of the route to rewrite.
An object that represents an HTTP gateway route.
An object representing the gateway route to rewrite.
An object representing the path to match in the request.
An object representing the query parameter to match.
An object that represents the query parameter in the request.
Properties for defining a `CfnGatewayRoute`.
An object that represents the egress filter rules for a service mesh.
An object that represents the service discovery information for a service mesh.
An object that represents the specification of a service mesh.
Properties for defining a `CfnMesh`.
An object that represents a duration of time.
An object that represents a retry policy.
An object that represents the action to take if a match is determined.
An object that represents the criteria for determining a request match.
An object that represents the match method.
An object that represents the match metadata for the route.
An object that represents a gRPC route type.
An object that represents types of timeouts.
An object that represents the method and value to match with the header value sent in a request.
An object representing the path to match in the request.
An object representing the query parameter to match.
An object that represents a retry policy.
An object that represents the action to take if a match is determined.
An object that represents the HTTP header in the request.
An object that represents the requirements for a route to match HTTP requests for a virtual router.
An object that represents an HTTP or HTTP/2 route type.
An object that represents types of timeouts.
An object that represents the range of values to match on.
An object that represents the query parameter in the request.
An object that represents a route specification.
An object that represents the action to take if a match is determined.
An object representing the TCP route to match.
An object that represents a TCP route type.
An object that represents types of timeouts.
An object that represents a target and its relative weight.
Properties for defining a `CfnRoute`.
An object that represents the key value pairs for the JSON.
An object that represents the format for the logs.
An object that represents the methods by which a subject alternative name on a peer Transport Layer Security (TLS) certificate can be matched.
An object that represents the subject alternative names secured by the certificate.
The access log configuration for a virtual gateway.
An object that represents the default properties for a backend.
An object that represents a client policy.
An object that represents a Transport Layer Security (TLS) client policy.
An object that represents the virtual gateway's client's Transport Layer Security (TLS) certificate.
An object that represents the type of virtual gateway connection pool.
An object that represents an access log file.
An object that represents a type of connection pool.
An object that represents the health check policy for a virtual gateway's listener.
An object that represents a type of connection pool.
An object that represents a type of connection pool.
An object that represents a listener for a virtual gateway.
An object that represents an AWS Certificate Manager certificate.
An object that represents a listener's Transport Layer Security (TLS) certificate.
An object that represents a local file certificate.
An object that represents the Transport Layer Security (TLS) properties for a listener.
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.
An object that represents a virtual gateway's listener's Transport Layer Security (TLS) validation context.
An object that represents a virtual gateway's listener's Transport Layer Security (TLS) validation context trust.
An object that represents logging information.
An object that represents a port mapping.
An object that represents the specification of a service mesh resource.
An object that represents a Transport Layer Security (TLS) validation context trust for an AWS Certificate Manager certificate.
An object that represents a Transport Layer Security (TLS) validation context trust for a local file.
An object that represents a Transport Layer Security (TLS) validation context.
An object that represents a virtual gateway's listener's Transport Layer Security (TLS) Secret Discovery Service validation context trust.
An object that represents a Transport Layer Security (TLS) validation context trust.
Properties for defining a `CfnVirtualGateway`.
An object that represents the access logging information for a virtual node.
An object that represents the AWS Cloud Map attribute information for your virtual node.
An object that represents the AWS Cloud Map service discovery information for your virtual node.
An object that represents the default properties for a backend.
An object that represents the backends that a virtual node is expected to send outbound traffic to.
An object that represents a client policy.
A reference to an object that represents a Transport Layer Security (TLS) client policy.
An object that represents the client's certificate.
An object that represents the DNS service discovery information for your virtual node.
An object that represents a duration of time.
An object that represents an access log file.
An object that represents types of timeouts.
An object that represents the health check policy for a virtual node's listener.
An object that represents types of timeouts.
An object that represents the key value pairs for the JSON.
An object that represents a listener for a virtual node.
An object that represents timeouts for different protocols.
An object that represents an AWS Certificate Manager certificate.
An object that represents a listener's Transport Layer Security (TLS) certificate.
An object that represents a local file certificate.
An object that represents the Transport Layer Security (TLS) properties for a listener.
An object that represents the listener's Secret Discovery Service certificate.
An object that represents a listener's Transport Layer Security (TLS) validation context.
An object that represents a listener's Transport Layer Security (TLS) validation context trust.
An object that represents the format for the logs.
An object that represents the logging information for a virtual node.
An object that represents the outlier detection for a virtual node's listener.
An object representing a virtual node or virtual router listener port mapping.
An object that represents the service discovery information for a virtual node.
An object that represents the methods by which a subject alternative name on a peer Transport Layer Security (TLS) certificate can be matched.
An object that represents the subject alternative names secured by the certificate.
An object that represents types of timeouts.
An object that represents a Transport Layer Security (TLS) validation context trust for an AWS Certificate Manager certificate.
An object that represents a Transport Layer Security (TLS) validation context trust for a local file.
An object that represents how the proxy will validate its peer during Transport Layer Security (TLS) negotiation.
An object that represents a Transport Layer Security (TLS) Secret Discovery Service validation context trust.
An object that represents a Transport Layer Security (TLS) validation context trust.
An object that represents the type of virtual node connection pool.
An object that represents a type of connection pool.
An object that represents a type of connection pool.
An object that represents a type of connection pool.
An object that represents the specification of a virtual node.
An object that represents a type of connection pool.
An object that represents a virtual service backend for a virtual node.
Properties for defining a `CfnVirtualNode`.
An object representing a virtual router listener port mapping.
An object that represents a virtual router listener.
An object that represents the specification of a virtual router.
Properties for defining a `CfnVirtualRouter`.
An object that represents a virtual node service provider.
An object that represents a virtual node service provider.
An object that represents the provider for a virtual service.
An object that represents the specification of a virtual service.
Properties for defining a `CfnVirtualService`.
Base options for all gateway route specs.
Interface with properties necessary to import a reusable GatewayRoute.
Basic configuration properties for a GatewayRoute.
Configuration for gateway route host name match.
Properties to define a new GatewayRoute.
All Properties for GatewayRoute Specs.
Connection pool properties for gRPC listeners.
Represents the properties needed to define GRPC Listeners for a VirtualGateway.
The criterion for determining a request match for this GatewayRoute.
Properties specific for a gRPC GatewayRoute.
Properties used to define GRPC Based healthchecks.
gRPC retry policy.
The criterion for determining a request match for this Route.
Properties specific for a GRPC Based Routes.
Represents timeouts for GRPC protocols.
Represent the GRPC Node Listener prorperty.
Configuration for `HeaderMatch`.
Options used for creating the Health Check object.
All Properties for Health Checks for mesh endpoints.
Connection pool properties for HTTP2 listeners.
Represents the properties needed to define HTTP2 Listeners for a VirtualGateway.
Represent the HTTP2 Node Listener prorperty.
Connection pool properties for HTTP listeners.
Represents the properties needed to define HTTP Listeners for a VirtualGateway.
The criterion for determining a request match for this GatewayRoute.
The type returned from the `bind()` method in {@link HttpGatewayRoutePathMatch}.
Properties specific for HTTP Based GatewayRoutes.
Properties used to define HTTP Based healthchecks.
HTTP retry policy.
The criterion for determining a request match for this Route.
The type returned from the `bind()` method in {@link HttpRoutePathMatch}.
Properties specific for HTTP Based Routes.
Represents timeouts for HTTP protocols.
Represent the HTTP Node Listener prorperty.
Represents TLS properties for listener.
The set of properties used when creating a Mesh.
Represents the properties needed to define TLS Validation context that is supported for mutual TLS authentication.
Represents the outlier detection for a listener.
Configuration for `QueryParameterMatch`.
Interface with properties ncecessary to import a reusable Route.
Base interface properties for all Routes.
Properties to define new Routes.
All Properties for Route Specs.
Base options for all route specs.
Properties for VirtualNode Service Discovery.
All Properties for Subject Alternative Names Matcher for both Client Policy and Listener.
Connection pool properties for TCP listeners.
Properties used to define TCP Based healthchecks.
Properties specific for a TCP Based Routes.
Represents timeouts for TCP protocols.
Represent the TCP Node Listener prorperty.
A wrapper for the tls config returned by {@link TlsCertificate.bind}.
Represents the properties needed to define client policy.
Represents the properties needed to define TLS Validation context.
All Properties for TLS Validation Trusts for both Client Policy and Listener.
Unterface with properties necessary to import a reusable VirtualGateway.
Basic configuration properties for a VirtualGateway.
Properties for a VirtualGateway listener.
Properties used when creating a new VirtualGateway.
Interface with properties necessary to import a reusable VirtualNode.
Basic configuration properties for a VirtualNode.
Properties for a VirtualNode listener.
The properties used when creating a new VirtualNode.
Interface with properties ncecessary to import a reusable VirtualRouter.
Interface with base properties all routers willl inherit.
Properties for a VirtualRouter listener.
The properties used when creating a new VirtualRouter.
Interface with properties ncecessary to import a reusable VirtualService.
Represents the properties needed to define a Virtual Service backend.
The properties applied to the VirtualService being defined.
Properties for a VirtualService provider.
Properties for the Weighted Targets in the route.

# Interfaces

Configuration for Envoy Access logs for mesh endpoints.
Contains static factory methods to create backends.
A CloudFormation `AWS::AppMesh::GatewayRoute`.
A CloudFormation `AWS::AppMesh::Mesh`.
A CloudFormation `AWS::AppMesh::Route`.
A CloudFormation `AWS::AppMesh::VirtualGateway`.
A CloudFormation `AWS::AppMesh::VirtualNode`.
A CloudFormation `AWS::AppMesh::VirtualRouter`.
A CloudFormation `AWS::AppMesh::VirtualService`.
GatewayRoute represents a new or existing gateway route attached to a VirtualGateway and Mesh.
Used to generate host name matching methods.
Used to generate specs with different protocols for a GatewayRoute.
Used to generate header matching methods.
Contains static factory methods for creating health checks for different protocols.
Defines HTTP gateway route matching based on the URL path of the request.
Defines HTTP route matching based on the URL path of the request.
Interface for which all GatewayRoute based classes MUST implement.
Interface which all Mesh based classes MUST implement.
Interface for which all Route based classes MUST implement.
Interface which all Virtual Gateway based classes must implement.
Interface which all VirtualNode based classes must implement.
Interface which all VirtualRouter based classes MUST implement.
Represents the interface which all VirtualService based classes MUST implement.
Define a new AppMesh mesh.
Represents a TLS certificate that is supported for mutual TLS authentication.
Represents a TLS Validation Context Trust that is supported for mutual TLS authentication.
Used to generate query parameter matching methods.
Route represents a new or existing route attached to a VirtualRouter and Mesh.
Used to generate specs with different protocols for a RouteSpec.
Provides the Service Discovery method a VirtualNode uses.
Used to generate Subject Alternative Names Matchers.
Represents a TLS certificate.
Defines the TLS Validation Context Trust.
VirtualGateway represents a newly defined App Mesh Virtual Gateway.
Represents the properties needed to define listeners for a VirtualGateway.
VirtualNode represents a newly defined AppMesh VirtualNode.
Defines listener for a VirtualNode.
Example: var mesh mesh router := mesh.addVirtualRouter(jsii.String("router"), &VirtualRouterBaseProps{ Listeners: []virtualRouterListener{ appmesh.*virtualRouterListener_Http(jsii.Number(8080)), }, }) Experimental.
Represents the properties needed to define listeners for a VirtualRouter.
VirtualService represents a service inside an AppMesh.
Represents the properties needed to define the provider for a VirtualService.

# Type aliases

Enum of DNS service discovery response type.
gRPC events.
HTTP events on which to retry.
Supported values for matching routes based on the HTTP request method.
Supported :scheme options for HTTP2.
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.
Enum of supported AppMesh protocols.
TCP events on which you may retry.
Enum of supported TLS modes.