Class HealthCheck
- Namespace
- Amazon.CDK.AWS.ElasticLoadBalancing
- Assembly
- Amazon.CDK.AWS.ElasticLoadBalancing.dll
Describe the health check to a load balancer.
public class HealthCheck : IHealthCheck
- Inheritance
-
HealthCheck
- Implements
- Inherited Members
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
});
Remarks
ExampleMetadata: infused
Constructors
HealthCheck()
public HealthCheck()
Properties
HealthyThreshold
After how many successful checks is an instance considered healthy.
public double? HealthyThreshold { get; set; }
Property Value
Remarks
Default: 2
Interval
Number of seconds between health checks.
public Duration? Interval { get; set; }
Property Value
- Duration
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
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
Protocol
What protocol to use for health checking.
public LoadBalancingProtocol? Protocol { get; set; }
Property Value
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
- Duration
Remarks
Default: Duration.seconds(5)
UnhealthyThreshold
After how many unsuccessful checks is an instance considered unhealthy.
public double? UnhealthyThreshold { get; set; }
Property Value
Remarks
Default: 5