Skip to content
v2.277.0

CfnVirtualServiceProps Struct ​

Properties for defining a CfnVirtualService.

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 cfnVirtualServiceProps: appmesh.CfnVirtualServiceProps = {
  meshName: 'meshName',
  spec: {
    provider: {
      virtualNode: {
        virtualNodeName: 'virtualNodeName',
      },
      virtualRouter: {
        virtualRouterName: 'virtualRouterName',
      },
    },
  },
  virtualServiceName: 'virtualServiceName',

  // the properties below are optional
  meshOwner: 'meshOwner',
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
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_service_props = appmesh.CfnVirtualServiceProps(
    mesh_name="meshName",
    spec=appmesh.CfnVirtualService.VirtualServiceSpecProperty(
        provider=appmesh.CfnVirtualService.VirtualServiceProviderProperty(
            virtual_node=appmesh.CfnVirtualService.VirtualNodeServiceProviderProperty(
                virtual_node_name="virtualNodeName"
            ),
            virtual_router=appmesh.CfnVirtualService.VirtualRouterServiceProviderProperty(
                virtual_router_name="virtualRouterName"
            )
        )
    ),
    virtual_service_name="virtualServiceName",

    # the properties below are optional
    mesh_owner="meshOwner",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
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.*;

CfnVirtualServiceProps cfnVirtualServiceProps = CfnVirtualServiceProps.builder()
        .meshName("meshName")
        .spec(VirtualServiceSpecProperty.builder()
                .provider(VirtualServiceProviderProperty.builder()
                        .virtualNode(VirtualNodeServiceProviderProperty.builder()
                                .virtualNodeName("virtualNodeName")
                                .build())
                        .virtualRouter(VirtualRouterServiceProviderProperty.builder()
                                .virtualRouterName("virtualRouterName")
                                .build())
                        .build())
                .build())
        .virtualServiceName("virtualServiceName")

        // the properties below are optional
        .meshOwner("meshOwner")
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .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 cfnVirtualServiceProps = new CfnVirtualServiceProps {
    MeshName = "meshName",
    Spec = new VirtualServiceSpecProperty {
        Provider = new VirtualServiceProviderProperty {
            VirtualNode = new VirtualNodeServiceProviderProperty {
                VirtualNodeName = "virtualNodeName"
            },
            VirtualRouter = new VirtualRouterServiceProviderProperty {
                VirtualRouterName = "virtualRouterName"
            }
        }
    },
    VirtualServiceName = "virtualServiceName",

    // the properties below are optional
    MeshOwner = "meshOwner",
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
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"

cfnVirtualServiceProps := &CfnVirtualServiceProps{
	MeshName: jsii.String("meshName"),
	Spec: &VirtualServiceSpecProperty{
		Provider: &VirtualServiceProviderProperty{
			VirtualNode: &VirtualNodeServiceProviderProperty{
				VirtualNodeName: jsii.String("virtualNodeName"),
			},
			VirtualRouter: &VirtualRouterServiceProviderProperty{
				VirtualRouterName: jsii.String("virtualRouterName"),
			},
		},
	},
	VirtualServiceName: jsii.String("virtualServiceName"),

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

Properties ​

meshNamestringmesh_namestrmeshNameStringMeshNamestringMeshName*stringrequired#
The name of the service mesh to create the virtual service 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 service specification to apply.
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag#
Optional metadata that you can apply to the virtual service 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.

virtualServiceNamestringvirtual_service_namestrvirtualServiceNameStringVirtualServiceNamestringVirtualServiceName*stringrequired#
The name to use for the virtual service.