Skip to content
v2.273.0

VirtualRouterProps Struct ​

The properties used when creating a new VirtualRouter.

Example ​

ts
declare const infraStack: cdk.Stack;
declare const appStack: cdk.Stack;

const mesh = new appmesh.Mesh(infraStack, 'AppMesh', {
  meshName: 'myAwsMesh',
  egressFilter: appmesh.MeshFilterType.ALLOW_ALL,
});

// the VirtualRouter will belong to 'appStack',
// even though the Mesh belongs to 'infraStack'
const router = new appmesh.VirtualRouter(appStack, 'router', {
  mesh, // notice that mesh is a required property when creating a router with the 'new' statement
  listeners: [appmesh.VirtualRouterListener.http(8081)],
});

Properties ​

listenersVirtualRouterListener[]listenerstyping.List[VirtualRouterListener]listenersList<VirtualRouterListener>ListenersVirtualRouterListener[]Listeners*[]VirtualRouterListener= A listener on HTTP port 8080#
Listener specification for the VirtualRouter.
meshIMeshmeshIMeshmeshIMeshMeshIMeshMeshIMeshrequired#
The Mesh which the VirtualRouter belongs to.
virtualRouterNamestringvirtual_router_namestrvirtualRouterNameStringVirtualRouterNamestringVirtualRouterName*string= A name is automatically determin…#
The name of the VirtualRouter.
default

Default: A name is automatically determined

Used as props by ​