HealthCheck¶
-
class
aws_cdk.aws_elasticloadbalancing.
HealthCheck
(*, port, healthy_threshold=None, interval=None, path=None, protocol=None, timeout=None, unhealthy_threshold=None)¶ Bases:
object
Describe the health check to a load balancer.
- Parameters
port (
Union
[int
,float
]) – What port number to health check on.healthy_threshold (
Union
[int
,float
,None
]) – After how many successful checks is an instance considered healthy. Default: 2interval (
Optional
[Duration
]) – Number of seconds between health checks. Default: Duration.seconds(30)path (
Optional
[str
]) – 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. Default: “/”protocol (
Optional
[LoadBalancingProtocol
]) – What protocol to use for health checking. The protocol is automatically determined from the port if it’s not supplied. Default: Automatictimeout (
Optional
[Duration
]) – Health check timeout. Default: Duration.seconds(5)unhealthy_threshold (
Union
[int
,float
,None
]) – After how many unsuccessful checks is an instance considered unhealthy. Default: 5
- ExampleMetadata
infused
Example:
# vpc: ec2.IVpc # my_auto_scaling_group: autoscaling.AutoScalingGroup lb = elb.LoadBalancer(self, "LB", vpc=vpc, internet_facing=True, health_check=elb.HealthCheck( port=80 ) ) lb.add_target(my_auto_scaling_group) lb.add_listener( external_port=80 )
Attributes
-
healthy_threshold
¶ After how many successful checks is an instance considered healthy.
- Default
2
- Return type
Union
[int
,float
,None
]
-
interval
¶ Number of seconds between health checks.
- Default
Duration.seconds(30)
- Return type
Optional
[Duration
]
-
path
¶ 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.
- Default
“/”
- Return type
Optional
[str
]
-
port
¶ What port number to health check on.
- Return type
Union
[int
,float
]
-
protocol
¶ What protocol to use for health checking.
The protocol is automatically determined from the port if it’s not supplied.
- Default
Automatic
- Return type
Optional
[LoadBalancingProtocol
]
-
unhealthy_threshold
¶ After how many unsuccessful checks is an instance considered unhealthy.
- Default
5
- Return type
Union
[int
,float
,None
]