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

r/aws_elasticache_user_group_association: Handle concurrent updates (#28688) #28689

Conversation

petur
Copy link
Contributor

@petur petur commented Jan 5, 2023

If a group is in status "Modifying", attempts to create or destroy an association fail with an InvalidUserGroupState error. Retry the operation until the status changes back to "Active".

Description

Creating or destroying an aws_elasticache_user_group_association sets the user group in status "Modifying". When the group is in this status, no other changes can be made. If two association resources are created or destroyed at the same time (even in the same module), one will fail with an InvalidUserGroupState error.

To avoid this, retry create and destroy operations until the InvalidUserGroupState error goes away.

Relations

Closes #28688

References

Output from Acceptance Testing

$ make testacc TESTS=TestAccElastiCacheUserGroupAssociation PKG=elasticache
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elasticache/... -v -count 1 -parallel 20 -run='TestAccElastiCacheUserGroupAssociation'  -timeout 180m
=== RUN   TestAccElastiCacheUserGroupAssociation_basic
=== PAUSE TestAccElastiCacheUserGroupAssociation_basic
=== RUN   TestAccElastiCacheUserGroupAssociation_update
=== PAUSE TestAccElastiCacheUserGroupAssociation_update
=== RUN   TestAccElastiCacheUserGroupAssociation_disappears
=== PAUSE TestAccElastiCacheUserGroupAssociation_disappears
=== RUN   TestAccElastiCacheUserGroupAssociation_multiple
=== PAUSE TestAccElastiCacheUserGroupAssociation_multiple
=== CONT  TestAccElastiCacheUserGroupAssociation_basic
=== CONT  TestAccElastiCacheUserGroupAssociation_multiple
=== CONT  TestAccElastiCacheUserGroupAssociation_disappears
=== CONT  TestAccElastiCacheUserGroupAssociation_update
--- PASS: TestAccElastiCacheUserGroupAssociation_basic (304.78s)
--- PASS: TestAccElastiCacheUserGroupAssociation_disappears (311.67s)
--- PASS: TestAccElastiCacheUserGroupAssociation_multiple (426.97s)
--- PASS: TestAccElastiCacheUserGroupAssociation_update (436.34s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/elasticache        436.419s

@github-actions
Copy link

github-actions bot commented Jan 5, 2023

Community Note

Voting for Prioritization

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

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/elasticache Issues and PRs that pertain to the elasticache service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. needs-triage Waiting for first response or review from a maintainer. size/M Managed by automation to categorize the size of a PR. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 5, 2023
@github-actions
Copy link

github-actions bot commented Jan 5, 2023

Thank you for your contribution! 🚀

Please note that the CHANGELOG.md file contents are handled by the maintainers during merge. This is to prevent pull request merge conflicts, especially for contributions which may not be merged immediately. Please see the Contributing Guide for additional pull request review items.

Remove any changes to the CHANGELOG.md file and commit them in this pull request to prevent delays with reviewing and potentially merging this pull request.

…ashicorp#28688)

If a group is in status "Modifying", attempts to create or destroy
an association fail with an `InvalidUserGroupState` error. Retry
the operation until the status changes back to "Active".
@petur petur force-pushed the b-aws_elasticache_user_group_association-concurrent branch from 753345a to ba5805f Compare January 5, 2023 14:00
@github-actions github-actions bot removed provider Pertains to the provider itself, rather than any interaction with AWS. documentation Introduces or discusses updates to documentation. labels Jan 5, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @petur 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@ewbankkit ewbankkit added the bug Addresses a defect in current functionality. label Jan 5, 2023
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=TestAccElastiCacheUserGroupAssociation_' PKG=elasticache ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elasticache/... -v -count 1 -parallel 3  -run=TestAccElastiCacheUserGroupAssociation_ -timeout 180m
=== RUN   TestAccElastiCacheUserGroupAssociation_basic
=== PAUSE TestAccElastiCacheUserGroupAssociation_basic
=== RUN   TestAccElastiCacheUserGroupAssociation_update
=== PAUSE TestAccElastiCacheUserGroupAssociation_update
=== RUN   TestAccElastiCacheUserGroupAssociation_disappears
=== PAUSE TestAccElastiCacheUserGroupAssociation_disappears
=== RUN   TestAccElastiCacheUserGroupAssociation_multiple
=== PAUSE TestAccElastiCacheUserGroupAssociation_multiple
=== CONT  TestAccElastiCacheUserGroupAssociation_basic
=== CONT  TestAccElastiCacheUserGroupAssociation_disappears
=== CONT  TestAccElastiCacheUserGroupAssociation_update
--- PASS: TestAccElastiCacheUserGroupAssociation_disappears (272.60s)
=== CONT  TestAccElastiCacheUserGroupAssociation_multiple
--- PASS: TestAccElastiCacheUserGroupAssociation_basic (277.28s)
--- PASS: TestAccElastiCacheUserGroupAssociation_update (396.19s)
--- PASS: TestAccElastiCacheUserGroupAssociation_multiple (427.46s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/elasticache	705.057s

@ewbankkit
Copy link
Contributor

@petur Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 2380087 into hashicorp:main Jan 5, 2023
@github-actions github-actions bot added this to the v4.49.0 milestone Jan 5, 2023
@petur petur deleted the b-aws_elasticache_user_group_association-concurrent branch January 5, 2023 16:06
@github-actions
Copy link

github-actions bot commented Jan 5, 2023

This functionality has been released in v4.49.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

github-actions bot commented Feb 6, 2023

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 Feb 6, 2023
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/elasticache Issues and PRs that pertain to the elasticache service. size/M 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.

[Bug]: aws_elasticache_user_group_association fails on concurrent updates
2 participants