Skip to content

6.21.0

Latest

Choose a tag to compare

@dnx-solutions dnx-solutions released this 22 Oct 23:59
0c80589

What’s Changed

feat: add alb_internal_default_target_group_arn variable @thiago4go (#70) ## Add support for custom target group in internal ALB listener

Summary

Adds alb_internal_default_target_group_arn variable to allow users to specify a custom target group ARN for the internal ALB HTTPS listener default action.

Motivation

When using external deployment tools (e.g., GitHub Actions, CodeDeploy) that manage ALB listener routing, Terraform would revert the listener's default action back to the module-created default target group on subsequent runs. This change allows users to align Terraform configuration with externally managed listener configurations.

Changes

  • Added alb_internal_default_target_group_arn variable to _variables.tf
  • Modified alb-internal.tf to use the custom target group ARN when provided
  • Falls back to module-created default target group when variable is empty (backward compatible)

Usage Example

hcl
module "ecs_cluster" {
source = "git::https://github.com/DNXLabs/terraform-aws-ecs.git?ref=6.20.1"

name = "my-cluster"
alb_internal = true
alb_internal_default_target_group_arn = "arn:aws:elasticloadbalancing:region:account:targetgroup/my-app/abc123"

... other variables

}

Backward Compatibility

Fully backward compatible. When alb_internal_default_target_group_arn is not set or empty, behavior remains unchanged.

Testing

  • Verified variable defaults to empty string
  • Confirmed ternary operator correctly selects custom ARN when provided
  • Validated fallback to default target group when variable is empty

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

Types of changes

What types of changes does your code introduce to <repo_name>?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING.md doc.
  • I have added necessary documentation (if appropriate).
  • Any dependent changes have been merged and published in downstream modules.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...