Interface IHealthCheck
Describe the health check to a load balancer.
Namespace: Amazon.CDK.AWS.ElasticLoadBalancing
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IHealthCheck
Syntax (vb)
Public Interface 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
Properties
HealthyThreshold | 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. |
UnhealthyThreshold | After how many unsuccessful checks is an instance considered unhealthy. |
Properties
HealthyThreshold
After how many successful checks is an instance considered healthy.
virtual Nullable<double> HealthyThreshold { get; }
Property Value
System.Nullable<System.Double>
Remarks
Default: 2
Interval
Number of seconds between health checks.
virtual Duration Interval { get; }
Property Value
Remarks
Default: Duration.seconds(30)
Path
What path to use for HTTP or HTTPS health check (must return 200).
virtual string Path { get; }
Property Value
System.String
Remarks
For SSL and TCP health checks, accepting connections is enough to be considered healthy.
Default: "/"
Port
What port number to health check on.
double Port { get; }
Property Value
System.Double
Protocol
What protocol to use for health checking.
virtual Nullable<LoadBalancingProtocol> Protocol { get; }
Property Value
System.Nullable<LoadBalancingProtocol>
Remarks
The protocol is automatically determined from the port if it's not supplied.
Default: Automatic
Timeout
Health check timeout.
virtual Duration Timeout { get; }
Property Value
Remarks
Default: Duration.seconds(5)
UnhealthyThreshold
After how many unsuccessful checks is an instance considered unhealthy.
virtual Nullable<double> UnhealthyThreshold { get; }
Property Value
System.Nullable<System.Double>
Remarks
Default: 5