Show / Hide Table of Contents

Interface IHealthCheck

Properties for configuring a health check.

Namespace: Amazon.CDK.AWS.ElasticLoadBalancingV2
Assembly: Amazon.CDK.AWS.ElasticLoadBalancingV2.dll
Syntax (csharp)
public interface IHealthCheck
Syntax (vb)
Public Interface IHealthCheck
Remarks

ExampleMetadata: infused

Examples
Cluster cluster;

var loadBalancedFargateService = new ApplicationLoadBalancedFargateService(this, "Service", new ApplicationLoadBalancedFargateServiceProps {
    Cluster = cluster,
    MemoryLimitMiB = 1024,
    Cpu = 512,
    TaskImageOptions = new ApplicationLoadBalancedTaskImageOptions {
        Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample")
    }
});

loadBalancedFargateService.TargetGroup.ConfigureHealthCheck(new HealthCheck {
    Path = "/custom-health-path"
});

Synopsis

Properties

Enabled

Indicates whether health checks are enabled.

HealthyGrpcCodes

GRPC code to use when checking for a successful response from a target.

HealthyHttpCodes

HTTP code to use when checking for a successful response from a target.

HealthyThresholdCount

The number of consecutive health checks successes required before considering an unhealthy target healthy.

Interval

The approximate number of seconds between health checks for an individual target.

Path

The ping path destination where Elastic Load Balancing sends health check requests.

Port

The port that the load balancer uses when performing health checks on the targets.

Protocol

The protocol the load balancer uses when performing health checks on targets.

Timeout

The amount of time, in seconds, during which no response from a target means a failed health check.

UnhealthyThresholdCount

The number of consecutive health check failures required before considering a target unhealthy.

Properties

Enabled

Indicates whether health checks are enabled.

virtual Nullable<bool> Enabled { get; }
Property Value

System.Nullable<System.Boolean>

Remarks

If the target type is lambda, health checks are disabled by default but can be enabled. If the target type is instance or ip, health checks are always enabled and cannot be disabled.

Default: - Determined automatically.

HealthyGrpcCodes

GRPC code to use when checking for a successful response from a target.

virtual string HealthyGrpcCodes { get; }
Property Value

System.String

Remarks

You can specify values between 0 and 99. You can specify multiple values (for example, "0,1") or a range of values (for example, "0-5").

Default: - 12

HealthyHttpCodes

HTTP code to use when checking for a successful response from a target.

virtual string HealthyHttpCodes { get; }
Property Value

System.String

Remarks

For Application Load Balancers, you can specify values between 200 and 499, and the default value is 200. You can specify multiple values (for example, "200,202") or a range of values (for example, "200-299").

HealthyThresholdCount

The number of consecutive health checks successes required before considering an unhealthy target healthy.

virtual Nullable<double> HealthyThresholdCount { get; }
Property Value

System.Nullable<System.Double>

Remarks

For Application Load Balancers, the default is 5. For Network Load Balancers, the default is 3.

Default: 5 for ALBs, 3 for NLBs

Interval

The approximate number of seconds between health checks for an individual target.

virtual Duration Interval { get; }
Property Value

Duration

Remarks

Default: Duration.seconds(30)

Path

The ping path destination where Elastic Load Balancing sends health check requests.

virtual string Path { get; }
Property Value

System.String

Remarks

Default: /

Port

The port that the load balancer uses when performing health checks on the targets.

virtual string Port { get; }
Property Value

System.String

Remarks

Default: 'traffic-port'

Protocol

The protocol the load balancer uses when performing health checks on targets.

virtual Nullable<Protocol> Protocol { get; }
Property Value

System.Nullable<Protocol>

Remarks

The TCP protocol is supported for health checks only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP. The TLS, UDP, and TCP_UDP protocols are not supported for health checks.

Default: HTTP for ALBs, TCP for NLBs

Timeout

The amount of time, in seconds, during which no response from a target means a failed health check.

virtual Duration Timeout { get; }
Property Value

Duration

Remarks

For Application Load Balancers, the range is 2-60 seconds and the default is 5 seconds. For Network Load Balancers, this is 10 seconds for TCP and HTTPS health checks and 6 seconds for HTTP health checks.

Default: Duration.seconds(5) for ALBs, Duration.seconds(10) or Duration.seconds(6) for NLBs

UnhealthyThresholdCount

The number of consecutive health check failures required before considering a target unhealthy.

virtual Nullable<double> UnhealthyThresholdCount { get; }
Property Value

System.Nullable<System.Double>

Remarks

For Application Load Balancers, the default is 2. For Network Load Balancers, this value must be the same as the healthy threshold count.

Default: 2

Back to top Generated by DocFX