Defines a basic AWS App Mesh virtual node with DNS-based service discovery.

Terraform Template

resource "aws_appmesh_virtual_node" "serviceb1" {
  mesh_name = "aws_appmesh_mesh.simple.id"
  name = "serviceBv1"

  spec {

    backend {

      virtual_service {
        virtual_service_name = "servicea.simpleapp.local"
      }
    }

    listener {

      port_mapping {
        port = 8080
        protocol = "http"
      }
    }

    service_discovery {

      dns {
        hostname = "serviceb.simpleapp.local"
      }
    }
  }
}