Class HttpHealthCheckOptions
Properties used to define HTTP Based healthchecks.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.AppMesh
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class HttpHealthCheckOptions : IHttpHealthCheckOptions
Syntax (vb)
Public Class HttpHealthCheckOptions Implements IHttpHealthCheckOptions
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
| HttpHealthCheckOptions() | Properties used to define HTTP Based healthchecks. |
Properties
| HealthyThreshold | The number of consecutive successful health checks that must occur before declaring listener healthy. |
| Interval | The time period between each health check execution. |
| Path | The destination path for the health check request. |
| Timeout | The amount of time to wait when receiving a response from the health check. |
| UnhealthyThreshold | The number of consecutive failed health checks that must occur before declaring a listener unhealthy. |
Constructors
HttpHealthCheckOptions()
Properties used to define HTTP Based healthchecks.
public HttpHealthCheckOptions()
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")
});
Properties
HealthyThreshold
The number of consecutive successful health checks that must occur before declaring listener healthy.
public double? HealthyThreshold { get; set; }
Property Value
Remarks
Default: 2
Interval
The time period between each health check execution.
public Duration? Interval { get; set; }
Property Value
Remarks
Default: Duration.seconds(5)
Path
The destination path for the health check request.
public string? Path { get; set; }
Property Value
Remarks
Default: /
Timeout
The amount of time to wait when receiving a response from the health check.
public Duration? Timeout { get; set; }
Property Value
Remarks
Default: Duration.seconds(2)
UnhealthyThreshold
The number of consecutive failed health checks that must occur before declaring a listener unhealthy.
public double? UnhealthyThreshold { get; set; }
Property Value
Remarks
Default: - 2