Skip to content

6.0.0: Add support for multiple target groups

Compare
Choose a tag to compare
@Ohid25 Ohid25 released this 09 Feb 15:02
· 20 commits to master since this release
0f07028

BREAKING CHANGES:

  • The variable lb_arn is no longer used as it was made redundant in a previous release.
  • target_group_name variable has been replaced with target_groups.
  • The module now requires you to define the name of the target group(s) in the form of:
target_groups = [
  {
    target_group_name = "example"
    container_port = 80
  }
]
  • A list of target_group_arns needs to be referenced with an index number. Example:
  load_balancer_arn = module.alb.arn
  port              = "80"
  protocol          = "HTTP"

  default_action {
    type = "forward"
    
    # Version 5.1.0 - previous
    target_group_arn = module.fargate.target_group_arn
    
    # Version 6.0.0 - current
    target_group_arn = module.fargate.target_group_arn[0]
  }
}
  • ECS Service resources will be replaced to replace the load_balancer attribute.
  • target_group resources will be destroyed and recreated.

ENHANCEMENTS:

  • Added a new example to demonstrate the setup of multiple target groups.
  • Utilise default VPC and subnet resources in examples.

MIGRATION PROCEDURE:

In your terraform code follow the above changes that need to be made. In the UI, these steps need to be taken:

  1. Delete any listener rules associated with a target group created by this module.
  2. Delete the target groups

Once done, run your terraform plan and apply to have a clean migration.

What you will see in your terraform plan and apply are the following:

  1. Target groups and listener rules being recreated
  2. ECS Services being destroyed and then recreated