Class VirtualService

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.appmesh.VirtualService
All Implemented Interfaces:
IConstruct, IDependable, IResource, IVirtualService, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:46.200Z") @Stability(Stable) public class VirtualService extends Resource implements IVirtualService
VirtualService represents a service inside an AppMesh.

It routes traffic either to a Virtual Node or to a Virtual Router.

Example:

 Mesh mesh;
 VirtualNode node = VirtualNode.Builder.create(this, "node")
         .mesh(mesh)
         .serviceDiscovery(ServiceDiscovery.dns("node"))
         .build();
 VirtualService virtualService = VirtualService.Builder.create(this, "service-1")
         .virtualServiceProvider(VirtualServiceProvider.virtualNode(node))
         .virtualServiceName("service1.domain.local")
         .build();
 node.addBackend(Backend.virtualService(virtualService));
 

See Also:
  • Constructor Details

    • VirtualService

      protected VirtualService(software.amazon.jsii.JsiiObjectRef objRef)
    • VirtualService

      protected VirtualService(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • VirtualService

      @Stability(Stable) public VirtualService(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull VirtualServiceProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromVirtualServiceArn

      @Stability(Stable) @NotNull public static IVirtualService fromVirtualServiceArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String virtualServiceArn)
      Import an existing VirtualService given an ARN.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      virtualServiceArn - This parameter is required.
    • fromVirtualServiceAttributes

      @Stability(Stable) @NotNull public static IVirtualService fromVirtualServiceAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull VirtualServiceAttributes attrs)
      Import an existing VirtualService given its attributes.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      attrs - This parameter is required.
    • getMesh

      @Stability(Stable) @NotNull public IMesh getMesh()
      The Mesh which the VirtualService belongs to.
      Specified by:
      getMesh in interface IVirtualService
    • getVirtualServiceArn

      @Stability(Stable) @NotNull public String getVirtualServiceArn()
      The Amazon Resource Name (ARN) for the virtual service.
      Specified by:
      getVirtualServiceArn in interface IVirtualService
    • getVirtualServiceName

      @Stability(Stable) @NotNull public String getVirtualServiceName()
      The name of the VirtualService, it is recommended this follows the fully-qualified domain name format.
      Specified by:
      getVirtualServiceName in interface IVirtualService