Skip to content

Parameterize Health Checks on Target Groups #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions modules/nlb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module "target_pgwire" {
port = 6875
service_name = "mz${var.mz_resource_id}-balancerd"
health_check_path = "/api/readyz"
health_check_protocol = "HTTP"
}

module "target_http" {
Expand All @@ -28,6 +29,7 @@ module "target_http" {
port = 6876
service_name = "mz${var.mz_resource_id}-balancerd"
health_check_path = "/api/readyz"
health_check_protocol = "HTTP"
}

module "target_console" {
Expand All @@ -40,4 +42,5 @@ module "target_console" {
port = 8080
service_name = "mz${var.mz_resource_id}-console"
health_check_path = "/"
health_check_protocol = "HTTPS"
}
2 changes: 1 addition & 1 deletion modules/nlb/target/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ resource "aws_lb_target_group" "target_group" {
healthy_threshold = 2
unhealthy_threshold = 2
interval = 10
protocol = "HTTP"
protocol = var.health_check_protocol
port = 8080
path = var.health_check_path
matcher = "200"
Expand Down
5 changes: 5 additions & 0 deletions modules/nlb/target/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ variable "port" {
type = number
}

variable "health_check_protocol" {
description = "The protocol to use for the health check"
type = string
}

variable "health_check_path" {
description = "The URL path for target group health checks"
type = string
Expand Down