From c3d4f9d0b02a1c46e81f0ec2c79675d644597f73 Mon Sep 17 00:00:00 2001 From: Florin Andrei <901867+FlorinAndrei@users.noreply.github.com> Date: Fri, 31 Oct 2025 16:43:12 -0700 Subject: [PATCH 1/3] allow setting evaluate_target_health for Route53 records --- examples/complete-alb/main.tf | 2 ++ examples/mutual-auth-alb/main.tf | 2 ++ main.tf | 2 +- variables.tf | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/complete-alb/main.tf b/examples/complete-alb/main.tf index 392862a..80bcb00 100644 --- a/examples/complete-alb/main.tf +++ b/examples/complete-alb/main.tf @@ -447,11 +447,13 @@ module "alb" { name = local.name type = "A" zone_id = data.aws_route53_zone.this.id + evaluate_target_health = true } AAAA = { name = local.name type = "AAAA" zone_id = data.aws_route53_zone.this.id + evaluate_target_health = true } } diff --git a/examples/mutual-auth-alb/main.tf b/examples/mutual-auth-alb/main.tf index 261073c..453fb29 100644 --- a/examples/mutual-auth-alb/main.tf +++ b/examples/mutual-auth-alb/main.tf @@ -150,11 +150,13 @@ module "alb" { name = local.name type = "A" zone_id = data.aws_route53_zone.this.id + evaluate_target_health = true } AAAA = { name = local.name type = "AAAA" zone_id = data.aws_route53_zone.this.id + evaluate_target_health = true } } } diff --git a/main.tf b/main.tf index 45d7938..a941bf2 100644 --- a/main.tf +++ b/main.tf @@ -795,7 +795,7 @@ resource "aws_route53_record" "this" { alias { name = aws_lb.this[0].dns_name zone_id = aws_lb.this[0].zone_id - evaluate_target_health = true + evaluate_target_health = coalesce(each.value.evaluate_target_health, true) } } diff --git a/variables.tf b/variables.tf index e5b0b11..38e5b42 100644 --- a/variables.tf +++ b/variables.tf @@ -581,6 +581,7 @@ variable "route53_records" { zone_id = string name = optional(string) type = string + evaluate_target_health = optional(bool) })) default = null } From 4e5f227e6210a000aed52074aa6a15486a35d2ad Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Mon, 3 Nov 2025 08:36:12 -0600 Subject: [PATCH 2/3] fix: Run `pre-commit run -a ` --- README.md | 2 +- examples/complete-alb/main.tf | 12 ++++++------ examples/mutual-auth-alb/main.tf | 12 ++++++------ variables.tf | 6 +++--- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 92ecc6d..0e19c7b 100644 --- a/README.md +++ b/README.md @@ -425,7 +425,7 @@ No modules. | [preserve\_host\_header](#input\_preserve\_host\_header) | Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to `false` | `bool` | `null` | no | | [putin\_khuylo](#input\_putin\_khuylo) | Do you agree that Putin doesn't respect Ukrainian sovereignty and territorial integrity? More info: https://en.wikipedia.org/wiki/Putin_khuylo! | `bool` | `true` | no | | [region](#input\_region) | Region where the resource(s) will be managed. Defaults to the Region set in the provider configuration | `string` | `null` | no | -| [route53\_records](#input\_route53\_records) | Map of Route53 records to create. Each record map should contain `zone_id`, `name`, and `type` |
map(object({
zone_id = string
name = optional(string)
type = string
}))
| `null` | no | +| [route53\_records](#input\_route53\_records) | Map of Route53 records to create. Each record map should contain `zone_id`, `name`, and `type` |
map(object({
zone_id = string
name = optional(string)
type = string
evaluate_target_health = optional(bool)
}))
| `null` | no | | [security\_group\_description](#input\_security\_group\_description) | Description of the security group created | `string` | `null` | no | | [security\_group\_egress\_rules](#input\_security\_group\_egress\_rules) | Security group egress rules to add to the security group created |
map(object({
name = optional(string)

cidr_ipv4 = optional(string)
cidr_ipv6 = optional(string)
description = optional(string)
from_port = optional(string)
ip_protocol = optional(string, "tcp")
prefix_list_id = optional(string)
referenced_security_group_id = optional(string)
tags = optional(map(string), {})
to_port = optional(string)
}))
| `null` | no | | [security\_group\_ingress\_rules](#input\_security\_group\_ingress\_rules) | Security group ingress rules to add to the security group created |
map(object({
name = optional(string)

cidr_ipv4 = optional(string)
cidr_ipv6 = optional(string)
description = optional(string)
from_port = optional(string)
ip_protocol = optional(string, "tcp")
prefix_list_id = optional(string)
referenced_security_group_id = optional(string)
tags = optional(map(string), {})
to_port = optional(string)
}))
| `null` | no | diff --git a/examples/complete-alb/main.tf b/examples/complete-alb/main.tf index 999d2ab..9de94f1 100644 --- a/examples/complete-alb/main.tf +++ b/examples/complete-alb/main.tf @@ -464,15 +464,15 @@ module "alb" { # Route53 Record(s) route53_records = { A = { - name = local.name - type = "A" - zone_id = data.aws_route53_zone.this.id + name = local.name + type = "A" + zone_id = data.aws_route53_zone.this.id evaluate_target_health = true } AAAA = { - name = local.name - type = "AAAA" - zone_id = data.aws_route53_zone.this.id + name = local.name + type = "AAAA" + zone_id = data.aws_route53_zone.this.id evaluate_target_health = true } } diff --git a/examples/mutual-auth-alb/main.tf b/examples/mutual-auth-alb/main.tf index 453fb29..be62eb1 100644 --- a/examples/mutual-auth-alb/main.tf +++ b/examples/mutual-auth-alb/main.tf @@ -147,15 +147,15 @@ module "alb" { # Route53 Record(s) route53_records = { A = { - name = local.name - type = "A" - zone_id = data.aws_route53_zone.this.id + name = local.name + type = "A" + zone_id = data.aws_route53_zone.this.id evaluate_target_health = true } AAAA = { - name = local.name - type = "AAAA" - zone_id = data.aws_route53_zone.this.id + name = local.name + type = "AAAA" + zone_id = data.aws_route53_zone.this.id evaluate_target_health = true } } diff --git a/variables.tf b/variables.tf index aff7043..ff1a955 100644 --- a/variables.tf +++ b/variables.tf @@ -596,9 +596,9 @@ variable "security_group_tags" { variable "route53_records" { description = "Map of Route53 records to create. Each record map should contain `zone_id`, `name`, and `type`" type = map(object({ - zone_id = string - name = optional(string) - type = string + zone_id = string + name = optional(string) + type = string evaluate_target_health = optional(bool) })) default = null From 6df1b3f86075d07e562382fd2f1f83ff4719e95f Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Mon, 3 Nov 2025 08:39:11 -0600 Subject: [PATCH 3/3] fix: Update variable default type and examples --- README.md | 2 +- examples/complete-alb/main.tf | 14 ++++++-------- examples/mutual-auth-alb/main.tf | 14 ++++++-------- main.tf | 2 +- variables.tf | 2 +- 5 files changed, 15 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 0e19c7b..c93a9a1 100644 --- a/README.md +++ b/README.md @@ -425,7 +425,7 @@ No modules. | [preserve\_host\_header](#input\_preserve\_host\_header) | Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to `false` | `bool` | `null` | no | | [putin\_khuylo](#input\_putin\_khuylo) | Do you agree that Putin doesn't respect Ukrainian sovereignty and territorial integrity? More info: https://en.wikipedia.org/wiki/Putin_khuylo! | `bool` | `true` | no | | [region](#input\_region) | Region where the resource(s) will be managed. Defaults to the Region set in the provider configuration | `string` | `null` | no | -| [route53\_records](#input\_route53\_records) | Map of Route53 records to create. Each record map should contain `zone_id`, `name`, and `type` |
map(object({
zone_id = string
name = optional(string)
type = string
evaluate_target_health = optional(bool)
}))
| `null` | no | +| [route53\_records](#input\_route53\_records) | Map of Route53 records to create. Each record map should contain `zone_id`, `name`, and `type` |
map(object({
zone_id = string
name = optional(string)
type = string
evaluate_target_health = optional(bool, true)
}))
| `null` | no | | [security\_group\_description](#input\_security\_group\_description) | Description of the security group created | `string` | `null` | no | | [security\_group\_egress\_rules](#input\_security\_group\_egress\_rules) | Security group egress rules to add to the security group created |
map(object({
name = optional(string)

cidr_ipv4 = optional(string)
cidr_ipv6 = optional(string)
description = optional(string)
from_port = optional(string)
ip_protocol = optional(string, "tcp")
prefix_list_id = optional(string)
referenced_security_group_id = optional(string)
tags = optional(map(string), {})
to_port = optional(string)
}))
| `null` | no | | [security\_group\_ingress\_rules](#input\_security\_group\_ingress\_rules) | Security group ingress rules to add to the security group created |
map(object({
name = optional(string)

cidr_ipv4 = optional(string)
cidr_ipv6 = optional(string)
description = optional(string)
from_port = optional(string)
ip_protocol = optional(string, "tcp")
prefix_list_id = optional(string)
referenced_security_group_id = optional(string)
tags = optional(map(string), {})
to_port = optional(string)
}))
| `null` | no | diff --git a/examples/complete-alb/main.tf b/examples/complete-alb/main.tf index 9de94f1..29f1a12 100644 --- a/examples/complete-alb/main.tf +++ b/examples/complete-alb/main.tf @@ -464,16 +464,14 @@ module "alb" { # Route53 Record(s) route53_records = { A = { - name = local.name - type = "A" - zone_id = data.aws_route53_zone.this.id - evaluate_target_health = true + name = local.name + type = "A" + zone_id = data.aws_route53_zone.this.id } AAAA = { - name = local.name - type = "AAAA" - zone_id = data.aws_route53_zone.this.id - evaluate_target_health = true + name = local.name + type = "AAAA" + zone_id = data.aws_route53_zone.this.id } } diff --git a/examples/mutual-auth-alb/main.tf b/examples/mutual-auth-alb/main.tf index be62eb1..261073c 100644 --- a/examples/mutual-auth-alb/main.tf +++ b/examples/mutual-auth-alb/main.tf @@ -147,16 +147,14 @@ module "alb" { # Route53 Record(s) route53_records = { A = { - name = local.name - type = "A" - zone_id = data.aws_route53_zone.this.id - evaluate_target_health = true + name = local.name + type = "A" + zone_id = data.aws_route53_zone.this.id } AAAA = { - name = local.name - type = "AAAA" - zone_id = data.aws_route53_zone.this.id - evaluate_target_health = true + name = local.name + type = "AAAA" + zone_id = data.aws_route53_zone.this.id } } } diff --git a/main.tf b/main.tf index 371ebc4..2593cec 100644 --- a/main.tf +++ b/main.tf @@ -837,7 +837,7 @@ resource "aws_route53_record" "this" { alias { name = aws_lb.this[0].dns_name zone_id = aws_lb.this[0].zone_id - evaluate_target_health = coalesce(each.value.evaluate_target_health, true) + evaluate_target_health = each.value.evaluate_target_health } } diff --git a/variables.tf b/variables.tf index ff1a955..5d5401b 100644 --- a/variables.tf +++ b/variables.tf @@ -599,7 +599,7 @@ variable "route53_records" { zone_id = string name = optional(string) type = string - evaluate_target_health = optional(bool) + evaluate_target_health = optional(bool, true) })) default = null }