AWS App Mesh Virtual Node

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

aws_appmesh_virtual_node (Terraform)

The Virtual Node in App Mesh can be configured in Terraform with the resource name aws_appmesh_virtual_node. The following sections describe 4 examples of how to use the resource and its parameters.

Example Usage from GitHub

appmesh.tf#L27
resource "aws_appmesh_virtual_node" "blue" {
  name = "blue"
  mesh_name = aws_appmesh_mesh.mesh.id

  spec {
    backend {
appmesh.tf#L1
resource "aws_appmesh_virtual_node" "envoy-proxy" {
  count     = var.enable_appmesh ? 1 : 0
  name      = "envoy-proxy"
  mesh_name = var.appmesh_name

  spec {
service-b.tf#L73
resource "aws_appmesh_virtual_node" "node-b-v1" {
  mesh_name = aws_appmesh_mesh.fully-connected-mesh.name
  name = "node-b-v1"
  spec {
    listener {
      port_mapping {
service-e.tf#L57
resource "aws_appmesh_virtual_node" "node-e-v1" {
  mesh_name = aws_appmesh_mesh.fully-connected-mesh.name
  name = "node-e-v1"
  spec {
    listener {
      port_mapping {

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 virtual node resource.

AWS::AppMesh::VirtualNode (CloudFormation)

The VirtualNode in AppMesh can be configured in CloudFormation with the resource name AWS::AppMesh::VirtualNode. 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 virtual node within a service mesh. 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, you can specify the service discovery information for your task group, and whether the proxy running in a task group will communicate with other proxies using Transport Layer Security (TLS).

You define a listener for any inbound traffic that your virtual node expects. Any virtual service that your virtual node expects to communicate to is specified as a backend.

The response metadata for your new virtual node contains the arn that is associated with the virtual node. Set this value to the full ARN; for example, arn:aws:appmesh:us-west-2:123456789012:myMesh/default/virtualNode/myApp) as the APPMESH_RESOURCE_ARN environment variable for your task group's Envoy proxy container in your task definition or pod spec. This is then mapped to the node.id and node.cluster Envoy parameters.

Note By default, App Mesh uses the name of the resource you specified in APPMESH_RESOURCE_ARN when Envoy is referring to itself in metrics and traces. You can override this behavior by setting the APPMESH_RESOURCE_CLUSTER environment variable with your own name.

For more information about virtual nodes, see Virtual nodes. You must be using 1.15.0 or later of the Envoy image when setting these variables. For more information aboutApp Mesh Envoy variables, see Envoy image in the AWS App Mesh User Guide.

Frequently asked questions

What is AWS App Mesh Virtual Node?

AWS App Mesh Virtual Node 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 Virtual Node?

For Terraform, the inhumantsar/ecs-terraform-demo, in4it/roxprox and akestner/fully-connected-mesh source code examples are useful. See the Terraform Example section for further details.