Skip to content

Commit 59a128d

Browse files
committed
toggle features
1 parent 3005be3 commit 59a128d

File tree

5 files changed

+24
-12
lines changed

5 files changed

+24
-12
lines changed

main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,10 @@ module "health_check" {
156156
alb_dns_name = module.alb.alb_dns_name
157157
alb_zone_id = module.alb.alb_zone_id
158158

159+
externally_managed_route_53_record = var.externally_managed_route_53_record
160+
159161
## for internal records on health check
160-
route_53_zone_name = var.route_53_zone
162+
route_53_zone_id = var.route_53_zone_id
161163
health_check_route_53_records = var.health_check_route_53_records
162164
route_53_private_zone = var.health_check_route_53_private_zone
163165

modules/health-check/data.tf

Lines changed: 0 additions & 7 deletions
This file was deleted.

modules/health-check/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ resource "aws_ecs_task_definition" "this" {
146146
## route 53
147147
################################################################################
148148
resource "aws_route53_record" "this" {
149-
for_each = toset(var.health_check_route_53_records)
149+
for_each = var.externally_managed_route_53_record != true ? toset(var.health_check_route_53_records) : []
150150

151-
zone_id = data.aws_route53_zone.this.id
151+
zone_id = var.route_53_zone_id
152152
name = each.value
153153
type = var.health_check_route_53_record_type
154154

modules/health-check/variables.tf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ variable "alb_zone_id" {
9696
description = "ALB Route53 zone ID to create A record for health check service"
9797
}
9898

99-
variable "route_53_zone_name" {
99+
variable "route_53_zone_id" {
100100
type = string
101-
description = "Route53 zone name used for looking up and creating an `A` record for the health check service"
101+
description = "Route53 zone ID used for looking up and creating an `A` record for the health check service"
102102
}
103103

104104
################################################################################
@@ -122,3 +122,9 @@ variable "route_53_private_zone" {
122122
description = "Used with `name` field to get a private Hosted Zone"
123123
default = false
124124
}
125+
126+
variable "externally_managed_route_53_record" {
127+
type = bool
128+
description = "If there is a Route 53 Zone externally managed from the account you are running in. If `true`, you will have to manage your DNS yourself."
129+
default = false
130+
}

variables.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ variable "health_check_subnet_ids" {
7575
default = []
7676
}
7777

78+
variable "route_53_zone_id" {
79+
type = string
80+
description = "Route 53 zone ID"
81+
}
82+
7883
variable "route_53_zone" {
7984
type = string
8085
description = "Route 53 domain to generate an ACM request for and to create A records against, i.e. sfrefarch.com. A wildcard subject alternative name is generated with the certificate."
@@ -91,6 +96,12 @@ variable "health_check_route_53_private_zone" {
9196
default = false
9297
}
9398

99+
variable "externally_managed_route_53_record" {
100+
type = bool
101+
description = "If there is a Route 53 Zone externally managed from the account you are running in. If `true`, you will have to manage your DNS yourself."
102+
default = false
103+
}
104+
94105
################################################################################
95106
## acm
96107
################################################################################

0 commit comments

Comments
 (0)