Skip to content
v2.278.0

CfnVirtualRouterProps Struct ​

Properties for defining a CfnVirtualRouter.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_appmesh as appmesh } from 'aws-cdk-lib';
const cfnVirtualRouterProps: appmesh.CfnVirtualRouterProps = {
  meshName: 'meshName',
  spec: {
    listeners: [{
      portMapping: {
        port: 123,
        protocol: 'protocol',
      },
    }],
  },

  // the properties below are optional
  meshOwner: 'meshOwner',
  tags: [{
    key: 'key',
    value: 'value',
  }],
  virtualRouterName: 'virtualRouterName',
};
python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_appmesh as appmesh

cfn_virtual_router_props = appmesh.CfnVirtualRouterProps(
    mesh_name="meshName",
    spec=appmesh.CfnVirtualRouter.VirtualRouterSpecProperty(
        listeners=[appmesh.CfnVirtualRouter.VirtualRouterListenerProperty(
            port_mapping=appmesh.CfnVirtualRouter.PortMappingProperty(
                port=123,
                protocol="protocol"
            )
        )]
    ),

    # the properties below are optional
    mesh_owner="meshOwner",
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    virtual_router_name="virtualRouterName"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.appmesh.*;

CfnVirtualRouterProps cfnVirtualRouterProps = CfnVirtualRouterProps.builder()
        .meshName("meshName")
        .spec(VirtualRouterSpecProperty.builder()
                .listeners(List.of(VirtualRouterListenerProperty.builder()
                        .portMapping(PortMappingProperty.builder()
                                .port(123)
                                .protocol("protocol")
                                .build())
                        .build()))
                .build())

        // the properties below are optional
        .meshOwner("meshOwner")
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .virtualRouterName("virtualRouterName")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.AppMesh;

var cfnVirtualRouterProps = new CfnVirtualRouterProps {
    MeshName = "meshName",
    Spec = new VirtualRouterSpecProperty {
        Listeners = new [] { new VirtualRouterListenerProperty {
            PortMapping = new PortMappingProperty {
                Port = 123,
                Protocol = "protocol"
            }
        } }
    },

    // the properties below are optional
    MeshOwner = "meshOwner",
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } },
    VirtualRouterName = "virtualRouterName"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnVirtualRouterProps := &CfnVirtualRouterProps{
	MeshName: jsii.String("meshName"),
	Spec: &VirtualRouterSpecProperty{
		Listeners: []interface{}{
			&VirtualRouterListenerProperty{
				PortMapping: &PortMappingProperty{
					Port: jsii.Number(123),
					Protocol: jsii.String("protocol"),
				},
			},
		},
	},

	// the properties below are optional
	MeshOwner: jsii.String("meshOwner"),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	VirtualRouterName: jsii.String("virtualRouterName"),
}

Properties ​

meshNamestringmesh_namestrmeshNameStringMeshNamestringMeshName*string required #
The name of the service mesh to create the virtual router in.
meshOwneroptionalstringmesh_owneroptionalstrmeshOwneroptionalStringMeshOwneroptionalstringMeshOwneroptional*string #
The AWS IAM account ID of the service mesh owner.
notes

If the account ID is not your own, then the account that you specify must share the mesh with your account before you can create the resource in the service mesh. For more information about mesh sharing, see Working with shared meshes .

The virtual router specification to apply.
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #
Optional metadata that you can apply to the virtual router to assist with categorization and organization.

Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

virtualRouterNameoptionalstringvirtual_router_nameoptionalstrvirtualRouterNameoptionalStringVirtualRouterNameoptionalstringVirtualRouterNameoptional*string #
The name to use for the virtual router.