Sets up TCP routing for Service B in AWS App Mesh, directing all TCP traffic to a specific virtual node.

Terraform Template

resource "aws_appmesh_route" "serviceb" {
  mesh_name = "aws_appmesh_mesh.simple.id"
  name = "serviceB-route"

  spec {

    tcp_route {

      action {

        weighted_target {
          virtual_node = "aws_appmesh_virtual_node.serviceb1.name"
          weight = 100
        }
      }
    }
  }
  virtual_router_name = "aws_appmesh_virtual_router.serviceb.name"
}