interface HealthCheck
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.ElasticLoadBalancing.HealthCheck |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awselasticloadbalancing#HealthCheck |
![]() | software.amazon.awscdk.services.elasticloadbalancing.HealthCheck |
![]() | aws_cdk.aws_elasticloadbalancing.HealthCheck |
![]() | aws-cdk-lib » aws_elasticloadbalancing » HealthCheck |
Describe the health check to a load balancer.
Example
declare const vpc: ec2.IVpc;
const lb = new elb.LoadBalancer(this, 'LB', {
vpc,
internetFacing: true,
healthCheck: {
port: 80,
},
});
declare const myAutoScalingGroup: autoscaling.AutoScalingGroup;
lb.addTarget(myAutoScalingGroup);
lb.addListener({
externalPort: 80,
});
Properties
Name | Type | Description |
---|---|---|
port | number | What port number to health check on. |
healthy | number | After how many successful checks is an instance considered healthy. |
interval? | Duration | Number of seconds between health checks. |
path? | string | What path to use for HTTP or HTTPS health check (must return 200). |
protocol? | Load | What protocol to use for health checking. |
timeout? | Duration | Health check timeout. |
unhealthy | number | After how many unsuccessful checks is an instance considered unhealthy. |
port
Type:
number
What port number to health check on.
healthyThreshold?
Type:
number
(optional, default: 2)
After how many successful checks is an instance considered healthy.
interval?
Type:
Duration
(optional, default: Duration.seconds(30))
Number of seconds between health checks.
path?
Type:
string
(optional, default: "/")
What path to use for HTTP or HTTPS health check (must return 200).
For SSL and TCP health checks, accepting connections is enough to be considered healthy.
protocol?
Type:
Load
(optional, default: Automatic)
What protocol to use for health checking.
The protocol is automatically determined from the port if it's not supplied.
timeout?
Type:
Duration
(optional, default: Duration.seconds(5))
Health check timeout.
unhealthyThreshold?
Type:
number
(optional, default: 5)
After how many unsuccessful checks is an instance considered unhealthy.