Open igoratencompass opened 3 years ago
I was just hit by the same issue.
Same issue with version Terraform v1.1.7 on darwin_arm64
and Terraform v1.1.8 on darwin_arm64
Same issue
up ingress Failed deploy model due to failed to create listener rule: TargetGroupAssociationLimit: The following target groups cannot be associated with more than one load balancer: arn:aws:elasticloadbalancing:eu-central-1:1111111:targetgroup/k8s-default-monorepo-bafd567687/add252b99f892cc7 status code: 400, request id: 4aff53e2-9c52-4dc9-85d0-a8dbd84e5e21
up. same issue
up, it hit me too v1.1.9
@justinretzolk how many up votes does this 1.5 years old bug need in order to get some attention?
Same issue with the latest version of Terraform
same issue
Experiencing the same issue using CDK. Any workaround?
this helped me: https://repost.aws/questions/QUY2sMSJyDTL-vNbR4Agm0Yw/error-targetgroup-cannot-be-associated-with-more-than-one-load-balancer
there was an already existing target group that i needed to delete
Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Expected Behavior
When changing the type of an existing ALB
aws_lb
resource frominternal
toexternal
and vice-versa I expect terraform to seamlessly replace the resource -- since the TragetGroup(s) attached to the Listener(s) do not change I expect for terraform to replace the ALB in correct order without causing a conflict, i.e. destroy the old ALB and it's listeners first (or at least remove the TargetGroups) before it tries to attach them to the new ALB Listener(s). This is not happening from what I can see, I end up with the error given further down in the description.Actual Behavior
The plan stage correctly recognizes that the ALB and the Listener need replacement:
but it fails to get replaced failing with an error during the
apply
stage:which is not surprising since the Listener change is marked as
+/-
instead of-/+
which I would expect in this situation.Steps to Reproduce
Create an ALB
aws_lb
andaws_lb_target_group
resource in a VPC, createaws_lb_listener
resource and associate it to the ALB and the TargetGroup. The ALB type can beinternal
(internal = true) orexternal
(internal = false) doesn't matter. Runplan
andapply
and wait for resources to get created. Then change theinternal
in theaws_lb
resource to the opposite value and repeat the process. I have chosen theinternal
parameter but can be any change that forces a resource replacement.Important Factoids
Note that none of the resources created use
create_before_destroy
lifecycle.