Skip to content

Commit 0c80589

Browse files
authored
Merge pull request #70 from DNXLabs/feature/alb-internal-custom-target-group
feat: add alb_internal_default_target_group_arn variable
2 parents 09bdc54 + 50c6aa0 commit 0c80589

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ module "ecs_apps" {
7575
| alb\_enable\_deletion\_protection | Enable deletion protection for ALBs | `bool` | `false` | no |
7676
| alb\_http\_listener | Whether to enable HTTP listeners | `bool` | `true` | no |
7777
| alb\_internal | Deploys a second internal ALB for private APIs. | `bool` | `false` | no |
78+
| alb\_internal\_default\_target\_group\_arn | 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. | `string` | `""` | no |
7879
| alb\_internal\_ssl\_policy | The name of the SSL Policy for the listener. Required if protocol is HTTPS or TLS. | `string` | `"ELBSecurityPolicy-TLS-1-2-Ext-2018-06"` | no |
7980
| alb\_only | Whether to deploy only an alb and no cloudFront or not with the cluster. | `bool` | `false` | no |
8081
| alb\_sg\_allow\_alb\_test\_listener | Whether to allow world access to the test listeners | `bool` | `true` | no |

_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)