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
resource "aws_appmesh_virtual_router" "router" {
name = format("%s-%s", var.cluster_name, var.service_name)
mesh_name = var.cluster_mesh
spec {
resource "aws_appmesh_virtual_router" "router" {
name = format("%s-%s", var.cluster_name, var.service_name)
mesh_name = var.cluster_mesh
spec {
resource "aws_appmesh_virtual_router" "router" {
name = format("%s-%s", var.cluster_name, var.service_name)
mesh_name = var.cluster_mesh
spec {
resource "aws_appmesh_virtual_router" "template" {
name = var.name
mesh_name = var.mesh_name
spec {
listener {
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" {
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-
listener
list block-
port_mapping
list block
-
-
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
-
MeshName
required - String -
VirtualRouterName
optional - String -
MeshOwner
optional - String -
Spec
required - VirtualRouterSpec -
Tags
optional - List of Tag
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.