Skip to content
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

Retry when creating or deleting asg_autoscaling_attachment resources #26654

Merged
merged 7 commits into from
Sep 9, 2022

Conversation

lurcio
Copy link
Contributor

@lurcio lurcio commented Sep 5, 2022

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #11301.
Relates #10435.
Relates #10445.

Output from acceptance testing:

$ make testacc TESTS='TestAccAutoScalingAttachment_' PKG=autoscaling

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/autoscaling/... -v -count 1 -parallel 20 -run='TestAccAutoScalingAttachment_'  -timeout 180m
=== RUN   TestAccAutoScalingAttachment_elb
=== PAUSE TestAccAutoScalingAttachment_elb
=== RUN   TestAccAutoScalingAttachment_albTargetGroup
=== PAUSE TestAccAutoScalingAttachment_albTargetGroup
=== CONT  TestAccAutoScalingAttachment_elb
=== CONT  TestAccAutoScalingAttachment_albTargetGroup
--- PASS: TestAccAutoScalingAttachment_elb (85.62s)
--- PASS: TestAccAutoScalingAttachment_albTargetGroup (94.50s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling	96.230s

@github-actions github-actions bot added size/S Managed by automation to categorize the size of a PR. service/autoscaling Issues and PRs that pertain to the autoscaling service. needs-triage Waiting for first response or review from a maintainer. labels Sep 5, 2022
@lurcio
Copy link
Contributor Author

lurcio commented Sep 5, 2022

This PR adds retries to the resourceAttachmentCreate and resourceAttachmentDelete functions for the aws_autoscaling_attachment resource. I ran into issues when attaching more than 10 Target Groups to an Auto Scaling Group at once. I found this problem also mentioned in #11301.

I'm aware that resource.Retry is deprecated in favour of resource.RetryContext, but did not want to figure out how to refactor the code to use the new function for my first contribution 😄

@lurcio lurcio marked this pull request as ready for review September 5, 2022 15:28
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 6, 2022
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccAutoScalingAttachment_' PKG=autoscaling ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/autoscaling/... -v -count 1 -parallel 2  -run=TestAccAutoScalingAttachment_ -timeout 180m
=== RUN   TestAccAutoScalingAttachment_elb
=== PAUSE TestAccAutoScalingAttachment_elb
=== RUN   TestAccAutoScalingAttachment_albTargetGroup
=== PAUSE TestAccAutoScalingAttachment_albTargetGroup
=== RUN   TestAccAutoScalingAttachment_multipleELBs
=== PAUSE TestAccAutoScalingAttachment_multipleELBs
=== RUN   TestAccAutoScalingAttachment_multipleALBTargetGroups
=== PAUSE TestAccAutoScalingAttachment_multipleALBTargetGroups
=== CONT  TestAccAutoScalingAttachment_elb
=== CONT  TestAccAutoScalingAttachment_multipleELBs
--- PASS: TestAccAutoScalingAttachment_elb (94.19s)
=== CONT  TestAccAutoScalingAttachment_albTargetGroup
--- PASS: TestAccAutoScalingAttachment_albTargetGroup (50.07s)
=== CONT  TestAccAutoScalingAttachment_multipleALBTargetGroups
--- PASS: TestAccAutoScalingAttachment_multipleELBs (248.75s)
--- PASS: TestAccAutoScalingAttachment_multipleALBTargetGroups (116.86s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling	265.149s

@github-actions github-actions bot added size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. and removed size/S Managed by automation to categorize the size of a PR. labels Sep 9, 2022
@ewbankkit
Copy link
Contributor

@lurcio Thanks for the contribution 🎉 👏.
I went ahead and added some test cases for creating and deleting 11 attachments at once.

@ewbankkit ewbankkit merged commit d4aae92 into hashicorp:main Sep 9, 2022
@github-actions github-actions bot added this to the v4.31.0 milestone Sep 9, 2022
@lurcio
Copy link
Contributor Author

lurcio commented Sep 9, 2022

@ewbankkit Wooo, thank you! I'm doing a little dance right now.

@github-actions
Copy link

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!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/autoscaling Issues and PRs that pertain to the autoscaling service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ValidationError: Trying to update too many Load Balancers/Target Groups at once. The limit is 10
3 participants