AWS App Mesh
User Guide

Virtual Routers

Virtual routers handle traffic for one or more virtual services within your mesh. After you create a virtual router, you can create and associate routes for your virtual router that direct incoming requests to different virtual nodes.

Any inbound traffic that your virtual router expects should be specified as a listener.

Creating a Virtual Router

This topic helps you to create a virtual router in your service mesh.

Creating a virtual router in the AWS Management Console.

  1. Open the App Mesh console at https://console.aws.amazon.com/appmesh/.

  2. Choose the mesh that you want to create the virtual router in.

  3. Choose Virtual routers in the left navigation.

  4. Choose Create virtual router.

  5. For Virtual router name, specify a name for your virtual router. Up to 255 letters, numbers, hyphens, and underscores are allowed.

  6. For Listener, specify a Port and Protocol for your virtual router.

  7. Choose Create virtual router to finish.

Creating a virtual router in the AWS CLI.

  • The following JSON represents a virtual router named serviceB that listens for HTTP traffic on port 80.

    { "meshName": "simpleapp", "spec": { "listeners": [ { "portMapping": { "port": 80, "protocol": "http" } } ] }, "virtualRouterName": "serviceB" }

    If you save the preceding JSON as a file, you can create the virtual router with the following AWS CLI command.

    aws appmesh create-virtual-router --cli-input-json file://serviceB-router.json

    Note

    You must use at least version 1.16.219 of the AWS CLI with App Mesh. To install the latest version of the AWS CLI, see Installing the AWS Command Line Interface in the AWS Command Line Interface User Guide.

    For more information about creating virtual routers with the AWS CLI, see create-virtual-router in the AWS Command Line Interface User Guide.