-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
resource/aws_autoscaling_group: Batch ELB attachments and detachments by 10 to prevent API and rate limiting errors #10445
resource/aws_autoscaling_group: Batch ELB attachments and detachments by 10 to prevent API and rate limiting errors #10445
Conversation
… by 10 to prevent API and rate limiting errors Reference: #256 Reference: #10435 Reference: https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_AttachLoadBalancers.html Reference: https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DetachLoadBalancers.html This change is complementary to the target group batching. The AutoScaling API for `AttachLoadBalancers` and `DetachLoadBalancers` only allow 10 elements at a time. In addition to the batching to split the API requests, we must wait for the batch to fully complete before moving onto the next batch, otherwise the API returns a rate limiting error: ``` --- FAIL: TestAccAWSAutoScalingGroup_LoadBalancers (360.22s) testing.go:569: Step 2 error: errors during apply: Error: Error updating Load Balancers for AutoScaling Group (tf-asg-2019101000090127270000000d), error: ValidationError: Trying to update too many Load Balancers/Target Groups at once. The limit is 10 ``` Output from acceptance testing: ``` --- PASS: TestAccAWSAutoScalingGroup_LoadBalancers (443.84s) ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one question but otherwise LGTM 👍
--- PASS: TestAccAWSAutoScalingGroup_LoadBalancers (438.30s)
@@ -1493,3 +1527,75 @@ func flattenAutoScalingMixedInstancesPolicy(mixedInstancesPolicy *autoscaling.Mi | |||
|
|||
return []interface{}{m} | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there ever a case when we'd want to set a timeout on these functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great question and yes, there might be! Quickly scanning the recent issues, I don't see any complaints about the similar change to the target group handling (that also does not have timeouts), but for now this is dependent on the AWS side entering some sort of failure state rather than staying in the adding/deleting state forever in those cases. 🤞
}, | ||
{ | ||
ResourceName: resourceName, | ||
ImportState: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎊
This has been released in version 2.35.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 for triage. Thanks! |
The problem still happens here:
|
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. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Reference: #256 (being closed by #10435)
Reference: #10435
Reference: https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_AttachLoadBalancers.html
Reference: https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DetachLoadBalancers.html
Release note for CHANGELOG:
This change is complementary to the target group batching in #10435. The AutoScaling API for
AttachLoadBalancers
andDetachLoadBalancers
only allow 10 elements at a time. In addition to the batching to split the API requests, we must wait for the batch to fully complete before moving onto the next batch, otherwise the API returns a rate limiting error:Output from acceptance testing: