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, IVirtualNodeRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class VirtualNode Inherits Resource Implements IVirtualNode, IResource, IVirtualNodeRef, IConstruct, IDependable, IEnvironmentAware
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. [disable-awslint:no-grants]
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(Construct, string, IVirtualNodeProps) | VirtualNode represents a newly defined AppMesh VirtualNode. |
Properties
| Grants | Collection of grants for this Virtual Node. |
| Mesh | The Mesh which the VirtualNode belongs to. |
| PROPERTY_INJECTION_ID | Uniquely identifies this class. |
| VirtualNodeArn | The Amazon Resource Name belonging to the VirtualNode. |
| VirtualNodeName | The name of the VirtualNode. |
| VirtualNodeRef | A reference to a VirtualNode resource. |
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) | The use of this method is discouraged. Please use |
Constructors
VirtualNode(Construct, string, IVirtualNodeProps)
VirtualNode represents a newly defined AppMesh VirtualNode.
public VirtualNode(Construct scope, string id, IVirtualNodeProps props)
Parameters
- scope Construct
- id string
- props IVirtualNodeProps
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. [disable-awslint:no-grants]
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
}
}) }
});
Properties
Grants
Collection of grants for this Virtual Node.
public virtual VirtualNodeGrants Grants { get; }
Property Value
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. [disable-awslint:no-grants]
See: https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_nodes.html
ExampleMetadata: infused
Mesh
The Mesh which the VirtualNode belongs to.
public virtual IMesh Mesh { get; }
Property Value
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. [disable-awslint:no-grants]
See: https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_nodes.html
ExampleMetadata: infused
PROPERTY_INJECTION_ID
Uniquely identifies this class.
public static string PROPERTY_INJECTION_ID { get; }
Property Value
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. [disable-awslint:no-grants]
See: https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_nodes.html
ExampleMetadata: infused
VirtualNodeArn
The Amazon Resource Name belonging to the VirtualNode.
public virtual string VirtualNodeArn { get; }
Property Value
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. [disable-awslint:no-grants]
See: https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_nodes.html
ExampleMetadata: infused
VirtualNodeName
The name of the VirtualNode.
public virtual string VirtualNodeName { get; }
Property Value
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. [disable-awslint:no-grants]
See: https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_nodes.html
ExampleMetadata: infused
VirtualNodeRef
A reference to a VirtualNode resource.
public virtual IVirtualNodeReference VirtualNodeRef { get; }
Property Value
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. [disable-awslint:no-grants]
See: https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_nodes.html
ExampleMetadata: infused
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
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. [disable-awslint:no-grants]
See: https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_nodes.html
ExampleMetadata: infused
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
Returns
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. [disable-awslint:no-grants]
See: https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_nodes.html
ExampleMetadata: infused
FromVirtualNodeAttributes(Construct, string, IVirtualNodeAttributes)
Import an existing VirtualNode given its name.
public static IVirtualNode FromVirtualNodeAttributes(Construct scope, string id, IVirtualNodeAttributes attrs)
Parameters
- scope Construct
- id string
- attrs IVirtualNodeAttributes
Returns
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. [disable-awslint:no-grants]
See: https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_nodes.html
ExampleMetadata: infused
GrantStreamAggregatedResources(IGrantable)
The use of this method is discouraged. Please use grants.streamAggregatedResources() instead.
public virtual Grant GrantStreamAggregatedResources(IGrantable identity)
Parameters
- identity IGrantable
Returns
Remarks
[disable-awslint:no-grants]