Class VirtualNode

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.VirtualNode
All Implemented Interfaces:
IConstruct, IDependable, IResource, IVirtualNode, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:46.184Z") @Stability(Stable) public class VirtualNode extends Resource implements IVirtualNode
VirtualNode represents a newly defined AppMesh VirtualNode.

Any inbound traffic that your virtual node expects should be specified as a listener. Any outbound traffic that your virtual node expects to reach should be specified as a backend.

Example:

 Mesh mesh;
 // Cloud Map service discovery is currently required for host ejection by outlier detection
 Vpc vpc = new Vpc(this, "vpc");
 PrivateDnsNamespace namespace = PrivateDnsNamespace.Builder.create(this, "test-namespace")
         .vpc(vpc)
         .name("domain.local")
         .build();
 Service service = namespace.createService("Svc");
 VirtualNode node = mesh.addVirtualNode("virtual-node", VirtualNodeBaseProps.builder()
         .serviceDiscovery(ServiceDiscovery.cloudMap(service))
         .listeners(List.of(VirtualNodeListener.http(HttpVirtualNodeListenerOptions.builder()
                 .outlierDetection(OutlierDetection.builder()
                         .baseEjectionDuration(Duration.seconds(10))
                         .interval(Duration.seconds(30))
                         .maxEjectionPercent(50)
                         .maxServerErrors(5)
                         .build())
                 .build())))
         .build());
 

See Also:
  • Constructor Details

    • VirtualNode

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

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

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

    • fromVirtualNodeArn

      @Stability(Stable) @NotNull public static IVirtualNode fromVirtualNodeArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String virtualNodeArn)
      Import an existing VirtualNode given an ARN.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      virtualNodeArn - This parameter is required.
    • fromVirtualNodeAttributes

      @Stability(Stable) @NotNull public static IVirtualNode fromVirtualNodeAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull VirtualNodeAttributes attrs)
      Import an existing VirtualNode given its name.

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

      @Stability(Stable) public void addBackend(@NotNull Backend backend)
      Add a Virtual Services that this node is expected to send outbound traffic to.

      Parameters:
      backend - This parameter is required.
    • addListener

      @Stability(Stable) public void addListener(@NotNull VirtualNodeListener listener)
      Utility method to add an inbound listener for this VirtualNode.

      Note: At this time, Virtual Nodes support at most one listener. Adding more than one will result in a failure to deploy the CloudFormation stack. However, the App Mesh team has plans to add support for multiple listeners on Virtual Nodes and Virtual Routers.

      Parameters:
      listener - This parameter is required.
      See Also:
    • grantStreamAggregatedResources

      @Stability(Stable) @NotNull public Grant grantStreamAggregatedResources(@NotNull IGrantable identity)
      Grants the given entity appmesh:StreamAggregatedResources.

      Specified by:
      grantStreamAggregatedResources in interface IVirtualNode
      Parameters:
      identity - This parameter is required.
    • getMesh

      @Stability(Stable) @NotNull public IMesh getMesh()
      The Mesh which the VirtualNode belongs to.
      Specified by:
      getMesh in interface IVirtualNode
    • getVirtualNodeArn

      @Stability(Stable) @NotNull public String getVirtualNodeArn()
      The Amazon Resource Name belonging to the VirtualNode.
      Specified by:
      getVirtualNodeArn in interface IVirtualNode
    • getVirtualNodeName

      @Stability(Stable) @NotNull public String getVirtualNodeName()
      The name of the VirtualNode.
      Specified by:
      getVirtualNodeName in interface IVirtualNode