AWS App Mesh Route

This page shows how to write Terraform and CloudFormation for App Mesh Route and write them securely.

aws_appmesh_route (Terraform)

The Route in App Mesh can be configured in Terraform with the resource name aws_appmesh_route. The following sections describe 5 examples of how to use the resource and its parameters.

Example Usage from GitHub

appmesh.tf#L116
resource "aws_appmesh_route" "blue" {
  name = "service-route-blue"
  mesh_name = aws_appmesh_mesh.mesh.id
  virtual_router_name = aws_appmesh_virtual_router.this.name

  spec {
service-b.tf#L26
resource "aws_appmesh_route" "service-b-route" {
  name = "service-b-route"
  mesh_name = aws_appmesh_mesh.fully-connected-mesh.name
  virtual_router_name = aws_appmesh_virtual_router.service-b-router.name

  spec {
main.tf#L1
resource "aws_appmesh_route" "template" {
  name                = var.name
  mesh_name           = var.mesh_name
  virtual_router_name = var.virtual_router_name

  spec {
main.tf#L1
resource "aws_appmesh_route" "template" {
  name                = var.name
  mesh_name           = var.mesh_name
  virtual_router_name = var.virtual_router_name

  spec {
main.tf#L1
resource "aws_appmesh_route" "route" {
  count               = length(var.route)
  mesh_name           = element(var.mesh_name, lookup(var.route[count.index], "mesh_id"))
  name                = lookup(var.route[count.index], "name")
  virtual_router_name = element(var.virtual_router_name, lookup(var.route[count.index], "virtual_router_id"))

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Provides an AWS App Mesh route resource.

AWS::AppMesh::Route (CloudFormation)

The Route in AppMesh can be configured in CloudFormation with the resource name AWS::AppMesh::Route. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

Explanation in CloudFormation Registry

Creates a route that is associated with a virtual router. You can route several different protocols and define a retry policy for a route. Traffic can be routed to one or more virtual nodes.

For more information about routes, see Routes.

Frequently asked questions

What is AWS App Mesh Route?

AWS App Mesh Route is a resource for App Mesh of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS App Mesh Route?

For Terraform, the inhumantsar/ecs-terraform-demo, akestner/fully-connected-mesh and Yoyo-Kikuchi/aws-app-mesh-example source code examples are useful. See the Terraform Example section for further details.