Skip to content

Commit bce5776

Browse files
committed
feat: add alb_internal_default_target_group_arn variable
Allow users to specify a custom target group ARN for the internal ALB HTTPS listener default action. If not specified, falls back to the default target group created by the module. This enables external deployment tools (e.g., GitHub Actions) to manage the listener default action without Terraform reverting changes.
1 parent 09bdc54 commit bce5776

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

_variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ variable "alb_internal_ssl_policy" {
132132
description = "The name of the SSL Policy for the listener. Required if protocol is HTTPS or TLS."
133133
}
134134

135+
variable "alb_internal_default_target_group_arn" {
136+
default = ""
137+
type = string
138+
description = "ARN of target group to use as default action for internal ALB HTTPS listener. If empty, uses the default target group created by the module."
139+
}
140+
135141
variable "alb_drop_invalid_header_fields" {
136142
default = true
137143
type = bool

alb-internal.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ resource "aws_lb_listener" "ecs_https_internal" {
4444

4545
default_action {
4646
type = "forward"
47-
target_group_arn = aws_lb_target_group.ecs_default_https_internal[0].arn
47+
target_group_arn = var.alb_internal_default_target_group_arn != "" ? var.alb_internal_default_target_group_arn : aws_lb_target_group.ecs_default_https_internal[0].arn
4848
}
4949

5050
tags = merge(

0 commit comments

Comments
 (0)