# VirtualRouterProps

The properties used when creating a new VirtualRouter.

Extends: VirtualRouterProps
Extends: VirtualRouterBaseProps
Used as props by: VirtualRouter

- Source: [`aws-appmesh/lib/virtual-router.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-appmesh/lib/virtual-router.ts#L101)

## 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

- `listeners`: [VirtualRouterListener](/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.VirtualRouterListener.html)[] — Listener specification for the VirtualRouter.

  **Default:** A listener on HTTP port 8080

- `mesh`: [IMesh](/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.IMesh.html) (required) — The Mesh which the VirtualRouter belongs to.

- `virtualRouterName`: string — The name of the VirtualRouter.

  **Default:** A name is automatically determined
