Class HealthCheck
Describe the health check to a load balancer.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.ElasticLoadBalancing
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class HealthCheck : Object, IHealthCheck
Syntax (vb)
Public Class HealthCheck
Inherits Object
Implements IHealthCheck
Remarks
ExampleMetadata: infused
Examples
IVpc vpc;
AutoScalingGroup myAutoScalingGroup;
var lb = new LoadBalancer(this, "LB", new LoadBalancerProps {
Vpc = vpc,
InternetFacing = true,
HealthCheck = new HealthCheck {
Port = 80
}
});
lb.AddTarget(myAutoScalingGroup);
lb.AddListener(new LoadBalancerListener {
ExternalPort = 80
});
Synopsis
Constructors
Health |
Properties
Healthy |
After how many successful checks is an instance considered healthy. |
Interval | Number of seconds between health checks. |
Path | What path to use for HTTP or HTTPS health check (must return 200). |
Port | What port number to health check on. |
Protocol | What protocol to use for health checking. |
Timeout | Health check timeout. |
Unhealthy |
After how many unsuccessful checks is an instance considered unhealthy. |
Constructors
HealthCheck()
public HealthCheck()
Properties
HealthyThreshold
After how many successful checks is an instance considered healthy.
public Nullable<double> HealthyThreshold { get; set; }
Property Value
System.
Remarks
Default: 2
Interval
Number of seconds between health checks.
public Duration Interval { get; set; }
Property Value
Remarks
Default: Duration.seconds(30)
Path
What path to use for HTTP or HTTPS health check (must return 200).
public string Path { get; set; }
Property Value
System.
Remarks
For SSL and TCP health checks, accepting connections is enough to be considered healthy.
Default: "/"
Port
What port number to health check on.
public double Port { get; set; }
Property Value
System.
Protocol
What protocol to use for health checking.
public Nullable<LoadBalancingProtocol> Protocol { get; set; }
Property Value
System.
Remarks
The protocol is automatically determined from the port if it's not supplied.
Default: Automatic
Timeout
Health check timeout.
public Duration Timeout { get; set; }
Property Value
Remarks
Default: Duration.seconds(5)
UnhealthyThreshold
After how many unsuccessful checks is an instance considered unhealthy.
public Nullable<double> UnhealthyThreshold { get; set; }
Property Value
System.
Remarks
Default: 5