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
resource "aws_appmesh_virtual_node" "blue" {
name = "blue"
mesh_name = aws_appmesh_mesh.mesh.id
spec {
backend {
resource "aws_appmesh_virtual_node" "envoy-proxy" {
count = var.enable_appmesh ? 1 : 0
name = "envoy-proxy"
mesh_name = var.appmesh_name
spec {
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 {
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 {
Parameters
-
arn
optional computed - string -
created_date
optional computed - string -
id
optional computed - string -
last_updated_date
optional computed - string -
mesh_name
required - string -
mesh_owner
optional computed - string -
name
required - string -
resource_owner
optional computed - string -
tags
optional - map from string to string -
spec
list block-
backend
set block-
virtual_service
list block-
virtual_service_name
required - string -
client_policy
list block-
tls
list block-
enforce
optional - bool -
ports
optional - set of number -
certificate
list block-
file
list block-
certificate_chain
required - string -
private_key
required - string
-
-
sds
list block-
secret_name
required - string
-
-
-
validation
list block-
subject_alternative_names
list block -
trust
list block-
acm
list block-
certificate_authority_arns
required - set of string
-
-
file
list block-
certificate_chain
required - string
-
-
sds
list block-
secret_name
required - string
-
-
-
-
-
-
-
-
backend_defaults
list block-
client_policy
list block-
tls
list block-
enforce
optional - bool -
ports
optional - set of number -
certificate
list block-
file
list block-
certificate_chain
required - string -
private_key
required - string
-
-
sds
list block-
secret_name
required - string
-
-
-
validation
list block-
subject_alternative_names
list block -
trust
list block-
acm
list block-
certificate_authority_arns
required - set of string
-
-
file
list block-
certificate_chain
required - string
-
-
sds
list block-
secret_name
required - string
-
-
-
-
-
-
-
listener
list block-
connection_pool
list block-
grpc
list block-
max_requests
required - number
-
-
http
list block-
max_connections
required - number -
max_pending_requests
optional - number
-
-
http2
list block-
max_requests
required - number
-
-
tcp
list block-
max_connections
required - number
-
-
-
health_check
list block-
healthy_threshold
required - number -
interval_millis
required - number -
path
optional - string -
port
optional computed - number -
protocol
required - string -
timeout_millis
required - number -
unhealthy_threshold
required - number
-
-
outlier_detection
list block-
max_ejection_percent
required - number -
max_server_errors
required - number -
base_ejection_duration
list block -
interval
list block
-
-
port_mapping
list block -
timeout
list block -
tls
list block-
mode
required - string -
certificate
list block-
acm
list block-
certificate_arn
required - string
-
-
file
list block-
certificate_chain
required - string -
private_key
required - string
-
-
sds
list block-
secret_name
required - string
-
-
-
validation
list block-
subject_alternative_names
list block -
trust
list block-
file
list block-
certificate_chain
required - string
-
-
sds
list block-
secret_name
required - string
-
-
-
-
-
-
logging
list block-
access_log
list block
-
-
service_discovery
list block-
aws_cloud_map
list block-
attributes
optional - map from string to string -
namespace_name
required - string -
service_name
required - string
-
-
dns
list block-
hostname
required - string
-
-
-
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
-
MeshName
required - String -
MeshOwner
optional - String -
Spec
required - VirtualNodeSpec -
VirtualNodeName
optional - String -
Tags
optional - List of Tag
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 abackend
.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 theAPPMESH_RESOURCE_ARN
environment variable for your task group's Envoy proxy container in your task definition or pod spec. This is then mapped to thenode.id
andnode.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 theAPPMESH_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.