Class HealthCheck
Contains static factory methods for creating health checks for different protocols.
Namespace: Amazon.CDK.AWS.AppMesh
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class HealthCheck : DeputyBase
Syntax (vb)
Public MustInherit Class HealthCheck Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
Mesh mesh;
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 {
Port = 8081,
HealthCheck = HealthCheck.Http(new HttpHealthCheckOptions {
HealthyThreshold = 3,
Interval = Duration.Seconds(5), // minimum
Path = "/health-check-path",
Timeout = Duration.Seconds(2), // minimum
UnhealthyThreshold = 2
})
}) },
AccessLog = AccessLog.FromFilePath("/dev/stdout")
});
Synopsis
Constructors
HealthCheck() | Contains static factory methods for creating health checks for different protocols. |
Methods
Bind(Construct, IHealthCheckBindOptions) | Called when the AccessLog type is initialized. |
Grpc(IGrpcHealthCheckOptions?) | Construct a GRPC health check. |
Http(IHttpHealthCheckOptions?) | Construct a HTTP health check. |
Http2(IHttpHealthCheckOptions?) | Construct a HTTP2 health check. |
Tcp(ITcpHealthCheckOptions?) | Construct a TCP health check. |
Constructors
HealthCheck()
Contains static factory methods for creating health checks for different protocols.
protected HealthCheck()
Remarks
ExampleMetadata: infused
Examples
Mesh mesh;
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 {
Port = 8081,
HealthCheck = HealthCheck.Http(new HttpHealthCheckOptions {
HealthyThreshold = 3,
Interval = Duration.Seconds(5), // minimum
Path = "/health-check-path",
Timeout = Duration.Seconds(2), // minimum
UnhealthyThreshold = 2
})
}) },
AccessLog = AccessLog.FromFilePath("/dev/stdout")
});
Methods
Bind(Construct, IHealthCheckBindOptions)
Called when the AccessLog type is initialized.
public abstract IHealthCheckConfig Bind(Construct scope, IHealthCheckBindOptions options)
Parameters
- scope Construct
- options IHealthCheckBindOptions
Returns
Remarks
Can be used to enforce mutual exclusivity with future properties
Grpc(IGrpcHealthCheckOptions?)
Construct a GRPC health check.
public static HealthCheck Grpc(IGrpcHealthCheckOptions? options = null)
Parameters
- options IGrpcHealthCheckOptions
Returns
Remarks
ExampleMetadata: infused
Http(IHttpHealthCheckOptions?)
Construct a HTTP health check.
public static HealthCheck Http(IHttpHealthCheckOptions? options = null)
Parameters
- options IHttpHealthCheckOptions
Returns
Remarks
ExampleMetadata: infused
Http2(IHttpHealthCheckOptions?)
Construct a HTTP2 health check.
public static HealthCheck Http2(IHttpHealthCheckOptions? options = null)
Parameters
- options IHttpHealthCheckOptions
Returns
Remarks
ExampleMetadata: infused
Tcp(ITcpHealthCheckOptions?)
Construct a TCP health check.
public static HealthCheck Tcp(ITcpHealthCheckOptions? options = null)
Parameters
- options ITcpHealthCheckOptions
Returns
Remarks
ExampleMetadata: infused