-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
ValidationError: Trying to update too many Load Balancers/Target Groups at once. The limit is 10 #11301
Comments
Hello n3ph My problem is start +10 times attach (autoscaling group in target group) in small período |
I wanted to state that this is a restriction of the AWS API backend. |
I'm sorry but I don't understand GO language very much. This function says that for each call you can only attach a maximum of 10 target groups in 1 scalable group. Am I right? The error here is that I can't call the aws_autoscaling_attachment function multiple times in a short time. The end result must be the same. If I use the following syntax it works:
Passing all target-group ARNs (over 10) works. |
Hey y'all 👋 Thank you for taking the time to file this issue and for the additional discussion around it. Given that there's been a number of AWS provider releases since the last update, can anyone confirm whether you're still experiencing this issue? |
Still occurring with |
Still happening 0.15 |
And still happening with v4.12.1 |
Was able to avoid the issue by placing |
The solution suggested by @chernetskyi seems to be a functional workaround (thanks for the tip!), but it's made doubly ugly by the fact that |
Still happening in v4.18.0. |
@chernetskyi can you please share your solution in more detail? Currently I am blocked by the same issue |
You need In case you have 12 resource "time_sleep" "first10attachments" {
depends_on = [
aws_autoscaling_attachment.first,
aws_autoscaling_attachment.second,
aws_autoscaling_attachment.third,
aws_autoscaling_attachment.fourth,
aws_autoscaling_attachment.fifth,
aws_autoscaling_attachment.sixth,
aws_autoscaling_attachment.seventh,
aws_autoscaling_attachment.eighth,
aws_autoscaling_attachment.ninth,
aws_autoscaling_attachment.tenth,
]
create_duration = "30s"
destroy_duration = "30s"
}
resource "time_sleep" "second10attachments" {
depends_on = [
aws_autoscaling_attachment.eleventh,
aws_autoscaling_attachment.twelfth,
]
create_duration = "30s"
destroy_duration = "30s"
} |
@chernetskyi thanks for sharing 👍.. what if I have |
Then you should limit your resources with |
I attempted to do that and I ended up with multiple dependencies and really ugly code. I think the only reasonable path forward is to fix this from the provider side and add internal batching! |
For me what worked was adding a count-dependent wait for creation / destruction (I know that the solution looks ugly but at least I didn't split the list into chunks nor I had to add the resource "aws_autoscaling_attachment" "my_asg_attachment" {
count = length(local.my_local_list)
autoscaling_group_name = var.workers_asg_name
lb_target_group_arn = aws_lb_target_group.my_nlb_tg[count.index].arn
provisioner "local-exec" {
interpreter = ["bash", "-c"]
command = "echo \"waiting for $(( 30 + 2 * ${count.index} )) seconds .. \" && sleep $(( 30 + 2 * ${count.index} ))"
}
provisioner "local-exec" {
when = destroy
interpreter = ["bash", "-c"]
command = "echo \"waiting for $(( 30 + 2 * ${count.index} )) seconds .. \" && sleep $(( 30 + 2 * ${count.index} ))"
}
} Note that I have a list creating / may destroy ~21 attachments. It might be the case that for bigger lists, the values of the wait / sleep need to be tweaked. |
I encountered this too. I couldn't see a nice way to batch requests, but I have a PR (#26654) to add retries when creating or deleting |
This functionality has been released in v4.31.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
still not working for me
|
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Terraform Version
terraform -v
Terraform v0.12.18
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Terraform should create the NLB, listerners[20], targets groups[20], autoscaling_group, launch configuration and autoscaling_attachment[20]
Actual Behavior
Terraform no completeSteps to Reproduce
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: