class VirtualNodeListener
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.AppMesh.VirtualNodeListener |
Java | software.amazon.awscdk.services.appmesh.VirtualNodeListener |
Python | aws_cdk.aws_appmesh.VirtualNodeListener |
TypeScript (source) | @aws-cdk/aws-appmesh » VirtualNodeListener |
Defines listener for a VirtualNode.
Example
const vpc = new ec2.Vpc(this, 'vpc');
const namespace = new cloudmap.PrivateDnsNamespace(this, 'test-namespace', {
vpc,
name: 'domain.local',
});
const service = namespace.createService('Svc');
declare const mesh: appmesh.Mesh;
const node = mesh.addVirtualNode('virtual-node', {
serviceDiscovery: appmesh.ServiceDiscovery.cloudMap(service),
listeners: [appmesh.VirtualNodeListener.http({
port: 8081,
healthCheck: appmesh.HealthCheck.http({
healthyThreshold: 3,
interval: cdk.Duration.seconds(5), // minimum
path: '/health-check-path',
timeout: cdk.Duration.seconds(2), // minimum
unhealthyThreshold: 2,
}),
})],
accessLog: appmesh.AccessLog.fromFilePath('/dev/stdout'),
});
Initializer
new VirtualNodeListener()
Methods
Name | Description |
---|---|
bind(scope) | Binds the current object when adding Listener to a VirtualNode. |
static grpc(props?) | Returns an GRPC Listener for a VirtualNode. |
static http(props?) | Returns an HTTP Listener for a VirtualNode. |
static http2(props?) | Returns an HTTP2 Listener for a VirtualNode. |
static tcp(props?) | Returns an TCP Listener for a VirtualNode. |
bind(scope)
public bind(scope: Construct): VirtualNodeListenerConfig
Parameters
- scope
Construct
Returns
Binds the current object when adding Listener to a VirtualNode.
static grpc(props?)
public static grpc(props?: GrpcVirtualNodeListenerOptions): VirtualNodeListener
Parameters
Returns
Returns an GRPC Listener for a VirtualNode.
static http(props?)
public static http(props?: HttpVirtualNodeListenerOptions): VirtualNodeListener
Parameters
Returns
Returns an HTTP Listener for a VirtualNode.
static http2(props?)
public static http2(props?: Http2VirtualNodeListenerOptions): VirtualNodeListener
Parameters
Returns
Returns an HTTP2 Listener for a VirtualNode.
static tcp(props?)
public static tcp(props?: TcpVirtualNodeListenerOptions): VirtualNodeListener
Parameters
Returns
Returns an TCP Listener for a VirtualNode.