Show / Hide Table of Contents

Class HealthCheck

Describe the health check to a load balancer.

Inheritance
object
HealthCheck
Implements
IHealthCheck
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.ElasticLoadBalancing
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class HealthCheck : IHealthCheck
Syntax (vb)
Public Class HealthCheck 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

HealthCheck()

Describe the health check to a load balancer.

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.

Constructors

HealthCheck()

Describe the health check to a load balancer.

public HealthCheck()
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
            });

Properties

HealthyThreshold

After how many successful checks is an instance considered healthy.

public double? HealthyThreshold { get; set; }
Property Value

double?

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

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.

public double Port { get; set; }
Property Value

double

Remarks

ExampleMetadata: infused

Protocol

What protocol to use for health checking.

public LoadBalancingProtocol? Protocol { get; set; }
Property Value

LoadBalancingProtocol?

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

double?

Remarks

Default: 5

Implements

IHealthCheck
Back to top Generated by DocFX