AWS App Mesh Virtual Router

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

aws_appmesh_virtual_router (Terraform)

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

Example Usage from GitHub

virtual_routes.tf#L1
resource "aws_appmesh_virtual_router" "router" {

    name      = format("%s-%s", var.cluster_name, var.service_name)
    mesh_name = var.cluster_mesh

    spec {
virtual_routes.tf#L1
resource "aws_appmesh_virtual_router" "router" {

    name      = format("%s-%s", var.cluster_name, var.service_name)
    mesh_name = var.cluster_mesh

    spec {
virtual_routes.tf#L1
resource "aws_appmesh_virtual_router" "router" {

    name      = format("%s-%s", var.cluster_name, var.service_name)
    mesh_name = var.cluster_mesh

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

  spec {
    listener {
main.tf#L1
resource "aws_appmesh_virtual_router" "virtual_router" {
  count     = length(var.virtual_router)
  mesh_name = element(var.mesh_name, lookup(var.virtual_router[count.index], "mesh_id"))
  name      = lookup(var.virtual_router[count.index], "name")

  dynamic "spec" {

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 router resource.

AWS::AppMesh::VirtualRouter (CloudFormation)

The VirtualRouter in AppMesh can be configured in CloudFormation with the resource name AWS::AppMesh::VirtualRouter. 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 router within a service mesh.

Specify a listener for any inbound traffic that your virtual router receives. Create a virtual router for each protocol and port that you need to route. Virtual routers handle traffic for one or more virtual services within your mesh. After you create your virtual router, create and associate routes for your virtual router that direct incoming requests to different virtual nodes.

For more information about virtual routers, see Virtual routers.

Frequently asked questions

What is AWS App Mesh Virtual Router?

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

For Terraform, the longhanhee/ecs-microservices-orchestration, msfidelis/ecs-microservices-orchestration and longhanhee/ecs-microservices-mall-learning source code examples are useful. See the Terraform Example section for further details.