-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for ALB routing with specific application health checks
Update the original `lb_listener_rules` module, that hasn't been used so far, to support a more specific case, where we want to add a target group and listener rule for that target based on host headers. Each target group has its own health check, so we can ensure traffic is only routing when the application is up and healthy. We are testing this module with the backend LB. We can choose when to use the application healthchecks and target groups with the `enable_lb_app_healthchecks` variable. By default the LBs continue using the default target group. When we set `enable_lb_app_healthchecks` to true, we are creating the LB forward rules from the service cnames variable. This expression: ``` rules_host = ["${compact(split(",", var.enable_lb_app_healthchecks ? join(",", var.backend_public_service_cnames) : ""))}"] ``` is required because we can't use a conditional with list variables: hashicorp/terraform#12453 This is fixed in Terraform 0.12, until then we need to implement a workaround.
- Loading branch information
Showing
4 changed files
with
96 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters