Skip to content
This repository has been archived by the owner on Feb 11, 2020. It is now read-only.

Commit

Permalink
Set a default healthcheck path based on path pattern (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwlchan authored and kenoir committed Dec 5, 2017
1 parent 90ec1e5 commit 547ddfb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion services/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
locals {
default_healthcheck_path = "/management/healthcheck"
fallback_healthcheck_path = "${replace(var.path_pattern, "/*", local.default_healthcheck_path)}"
healthcheck_path = "${var.healthcheck_path == "" ? local.fallback_healthcheck_path : var.healthcheck_path}"
}

module "service" {
source = "./ecs_service"
service_name = "${var.name}"
Expand All @@ -11,7 +17,7 @@ module "service" {
path_pattern = "${var.path_pattern}"
alb_priority = "${var.alb_priority}"
desired_count = "${var.desired_count}"
healthcheck_path = "${var.healthcheck_path}"
healthcheck_path = "${local.healthcheck_path}"
infra_bucket = "${var.infra_bucket}"
host_name = "${var.host_name}"

Expand Down
4 changes: 2 additions & 2 deletions services/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ variable "path_pattern" {
}

variable "healthcheck_path" {
description = "path for ECS healthcheck endpoint"
default = "/management/healthcheck"
description = "Path for ECS healthcheck endpoint. Defaults to /management/healthcheck."
default = ""
}

variable "infra_bucket" {
Expand Down

0 comments on commit 547ddfb

Please sign in to comment.