# Auto-scaling attachment to load balancer behavior

**URL:** <https://discuss.hashicorp.com/t/auto-scaling-attachment-to-load-balancer-behavior/18396>\
**Category:** Terraform\
**Created:** [December 2, 2020, 10:48pm UTC](https://discuss.hashicorp.com/t/auto-scaling-attachment-to-load-balancer-behavior/18396 "2020-12-02T22:48:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![juanjam247](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/juanjam247/32/15338_2.png) [@juanjam247](https://discuss.hashicorp.com/u/juanjam247)\
**Post date:** [December 2, 2020, 10:48pm UTC](https://discuss.hashicorp.com/t/auto-scaling-attachment-to-load-balancer-behavior/18396/1 "2020-12-02T22:48:17Z")

</div>

Hi, we are using version 12.29 and we are seeing a rather unusual behavior. We have the below auto scaling attachment resource however when applying the plan, the targets in the target groups are being wiped out.

May I know if it should be done in a different way?

resource “aws\_autoscaling\_attachment” “lb-autoscaling-attachment” {  
alb\_target\_group\_arn = aws\_lb\_target\_group.lb-target-group-80.arn  
autoscaling\_group\_name = module.eks.autoscaling\_group\_name  
}

resource “aws\_autoscaling\_attachment” “lb-ssl-autoscaling-attachment” {  
alb\_target\_group\_arn = aws\_lb\_target\_group.lb-target-group-443.arn  
autoscaling\_group\_name = module.eks.autoscaling\_group\_name  
}

Thanks and regards,  
Juan
