Class VirtualNode
VirtualNode represents a newly defined AppMesh VirtualNode.
Inherited Members
Namespace: Amazon.CDK.AWS.AppMesh
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class VirtualNode : Resource, IVirtualNode, IResource
Syntax (vb)
Public Class VirtualNode
Inherits Resource
Implements IVirtualNode, IResource
Remarks
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.
See: https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_nodes.html
ExampleMetadata: infused
Examples
Mesh mesh;
// Cloud Map service discovery is currently required for host ejection by outlier detection
var vpc = new Vpc(this, "vpc");
var namespace = new PrivateDnsNamespace(this, "test-namespace", new PrivateDnsNamespaceProps {
Vpc = vpc,
Name = "domain.local"
});
var service = namespace.CreateService("Svc");
var node = mesh.AddVirtualNode("virtual-node", new VirtualNodeBaseProps {
ServiceDiscovery = ServiceDiscovery.CloudMap(service),
Listeners = new [] { VirtualNodeListener.Http(new HttpVirtualNodeListenerOptions {
OutlierDetection = new OutlierDetection {
BaseEjectionDuration = Duration.Seconds(10),
Interval = Duration.Seconds(30),
MaxEjectionPercent = 50,
MaxServerErrors = 5
}
}) }
});
Synopsis
Constructors
VirtualNode(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
VirtualNode(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
VirtualNode(Construct, String, IVirtualNodeProps) |
Properties
Mesh | The Mesh which the VirtualNode belongs to. |
VirtualNodeArn | The Amazon Resource Name belonging to the VirtualNode. |
VirtualNodeName | The name of the VirtualNode. |
Methods
AddBackend(Backend) | Add a Virtual Services that this node is expected to send outbound traffic to. |
AddListener(VirtualNodeListener) | Utility method to add an inbound listener for this VirtualNode. |
FromVirtualNodeArn(Construct, String, String) | Import an existing VirtualNode given an ARN. |
FromVirtualNodeAttributes(Construct, String, IVirtualNodeAttributes) | Import an existing VirtualNode given its name. |
GrantStreamAggregatedResources(IGrantable) | Grants the given entity |
Constructors
VirtualNode(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected VirtualNode(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
VirtualNode(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected VirtualNode(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
VirtualNode(Construct, String, IVirtualNodeProps)
public VirtualNode(Construct scope, string id, IVirtualNodeProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IVirtualNodeProps
Properties
Mesh
VirtualNodeArn
The Amazon Resource Name belonging to the VirtualNode.
public virtual string VirtualNodeArn { get; }
Property Value
System.String
VirtualNodeName
The name of the VirtualNode.
public virtual string VirtualNodeName { get; }
Property Value
System.String
Methods
AddBackend(Backend)
Add a Virtual Services that this node is expected to send outbound traffic to.
public virtual void AddBackend(Backend backend)
Parameters
- backend Backend
AddListener(VirtualNodeListener)
Utility method to add an inbound listener for this VirtualNode.
public virtual void AddListener(VirtualNodeListener listener)
Parameters
- listener VirtualNodeListener
Remarks
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.
FromVirtualNodeArn(Construct, String, String)
Import an existing VirtualNode given an ARN.
public static IVirtualNode FromVirtualNodeArn(Construct scope, string id, string virtualNodeArn)
Parameters
- scope Constructs.Construct
- id System.String
- virtualNodeArn System.String
Returns
FromVirtualNodeAttributes(Construct, String, IVirtualNodeAttributes)
Import an existing VirtualNode given its name.
public static IVirtualNode FromVirtualNodeAttributes(Construct scope, string id, IVirtualNodeAttributes attrs)
Parameters
- scope Constructs.Construct
- id System.String
- attrs IVirtualNodeAttributes
Returns
GrantStreamAggregatedResources(IGrantable)
Grants the given entity appmesh:StreamAggregatedResources
.
public virtual Grant GrantStreamAggregatedResources(IGrantable identity)
Parameters
- identity IGrantable
Returns