Ensure HTTP HTTPS Target group defines Healthcheck
Description
This policy checks whether an HTTP/HTTPS target group in a load balancer defines a health check. Health checks are crucial for ensuring the availability and responsiveness of backend instances. Without a health check, the load balancer may continue to route traffic to unhealthy instances, leading to service disruptions. By defining a health check, you can ensure that only healthy instances receive traffic, maintaining the overall health and reliability of your application.
Code Example
terraform
resource "ncloud_lb_target_group" "example" {
protocol = "HTTP"
health_check {
url_path = "/healthcheck"
# other health check properties...
}
}Remediation
Define a health check for the target group with a valid URL path.
Rule Details
| Field | Value |
|---|---|
| ID | IAC-1204 |
| Severity | MEDIUM |
| IaC Type | Terraform |
| Frameworks | ncloud_lb_target_group |
| Checkov ID | CKV_NCP_1 |