Skip to content

Adds key to TG name #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 9, 2023
Merged

Adds key to TG name #38

merged 3 commits into from
Feb 9, 2023

Conversation

JaredDarling
Copy link
Contributor

The purpose of this is to address an issue encountered when trying to configure an ELB for Blue/Green deployment configuration.

AWS CodeDeploy developer documentation describes this scenario in more detail. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-bluegreen.html

When attempting to configure a Fargate application using cn-terraform/ecs-fargate/aws module, the target_groups are configured as:

  lb_http_ports       = {
    blue = {
      listener_port     = local.production_port
      target_group_port = local.target_port
    },
    green = {
      listener_port     = local.target_port
      target_group_port = local.target_port
    }
  }

With the current naming scheme, it results in the terraform-aws-ecs-alb module throwing an error attempting to create two TGs with the same name. The only fix is to make the target_group names unique. The name property was being extract in the for loop, but was never used. This change simply uses the property value that was already available and it gives implementors more control over TG names.

@jnonino jnonino added the bug Something isn't working label Feb 7, 2023
jnonino
jnonino previously approved these changes Feb 7, 2023
@JaredDarling
Copy link
Contributor Author

Will need an assist w/ merging. Branch rules limit merging to main to only 'authorized' users.

@jnonino jnonino merged commit 40c814f into cn-terraform:main Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging this pull request may close these issues.

3 participants