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_replication_group: retry InvalidReplicationGroupStateFault errors in tag operations #41954

Merged
merged 3 commits into from
Mar 25, 2025

Conversation

jar-b
Copy link
Member

@jar-b jar-b commented Mar 21, 2025

Description

This fixes a regression introduced during the AWS SDK for Go V2 migration of Elasticache. Previously, the generated tagging logic for AWS SDK for Go V1 included retry logic around the list, tag, and untag operations. These were inadvertently dropped during the SDK migration, and have been added back here using the AWS SDK V2 form of retry handling which accepts error types as an argument. As with the previous implementation tagging operations will have a retry timeout of 15 minutes.

Relations

Closes #35952
Closes #40948
Relates #36310 (Initial implementation of tag operation retries, v5.41.0)
Relates #38046 (AWS SDK migration which removed retries and caused the regression, v5.59.0)

Output from Acceptance Testing

% make testacc PKG=elasticache TESTS="TestAccElastiCacheReplicationGroup_tag|TestAccElastiCacheReplicationGroup_Tag"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.7 test ./internal/service/elasticache/... -v -count 1 -parallel 20 -run='TestAccElastiCacheReplicationGroup_tag|TestAccElastiCacheReplicationGroup_Tag'  -timeout 360m -vet=off
2025/03/21 16:34:22 Initializing Terraform AWS Provider...

--- PASS: TestAccElastiCacheReplicationGroup_tags (914.17s)
--- PASS: TestAccElastiCacheReplicationGroup_TagWithOtherModification_numCacheClusters (1375.71s)
--- PASS: TestAccElastiCacheReplicationGroup_TagWithOtherModification_version (2089.74s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/elasticache        2096.440s

Copy link

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • 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 service/elasticache Issues and PRs that pertain to the elasticache service. tags Pertains to resource tagging. generators Relates to code generators. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. size/M Managed by automation to categorize the size of a PR. labels Mar 21, 2025
@jar-b jar-b force-pushed the b-elasticache-tags-retry branch from a73e24f to b08d680 Compare March 21, 2025 20:31
@jar-b jar-b added the regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. label Mar 21, 2025
jar-b added 3 commits March 24, 2025 10:02
This function is a generic version of `RetryWhenIsAErrorMessageContains` which eliminates the need to perform a type assertion on the returned result.
These options will allow for wrapping list, tag, and untag operations in retry logic for services which may need to for certain resource types.
…ateFault` errors in tag operations

This fixes a regression introduced during the AWS SDK for Go V2 migration of Elasticache. Previously the generated tagging logic for AWS SDK for Go V1 included retry logic around the list, tag, and untag operations. These were inadvertently dropped during the SDK migration, and have been added back here using the AWS SDK V2 form of retry handling which accepts error types as an argument. As with the previous implementation tagging operations will have a retry timeout of 15 minutes.
@jar-b jar-b force-pushed the b-elasticache-tags-retry branch from b08d680 to a3adf5f Compare March 24, 2025 14:02
@jar-b jar-b marked this pull request as ready for review March 24, 2025 14:41
@jar-b jar-b requested a review from a team as a code owner March 24, 2025 14:41
@ewbankkit ewbankkit added the bug Addresses a defect in current functionality. label Mar 24, 2025
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=TestAccElastiCacheReplicationGroup_tag\|TestAccElastiCacheReplicationGroup_Tag' PKG=elasticache ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.7 test ./internal/service/elasticache/... -v -count 1 -parallel 3  -run=TestAccElastiCacheReplicationGroup_tag\|TestAccElastiCacheReplicationGroup_Tag -timeout 360m -vet=off
2025/03/24 16:40:28 Initializing Terraform AWS Provider...
=== RUN   TestAccElastiCacheReplicationGroup_tags
=== PAUSE TestAccElastiCacheReplicationGroup_tags
=== RUN   TestAccElastiCacheReplicationGroup_TagWithOtherModification_version
=== PAUSE TestAccElastiCacheReplicationGroup_TagWithOtherModification_version
=== RUN   TestAccElastiCacheReplicationGroup_TagWithOtherModification_numCacheClusters
=== PAUSE TestAccElastiCacheReplicationGroup_TagWithOtherModification_numCacheClusters
=== CONT  TestAccElastiCacheReplicationGroup_tags
=== CONT  TestAccElastiCacheReplicationGroup_TagWithOtherModification_numCacheClusters
=== CONT  TestAccElastiCacheReplicationGroup_TagWithOtherModification_version
--- PASS: TestAccElastiCacheReplicationGroup_tags (959.06s)
--- PASS: TestAccElastiCacheReplicationGroup_TagWithOtherModification_numCacheClusters (1265.09s)
--- PASS: TestAccElastiCacheReplicationGroup_TagWithOtherModification_version (1416.03s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/elasticache	1421.887s

@jar-b jar-b merged commit 26a22ee into main Mar 25, 2025
36 checks passed
@jar-b jar-b deleted the b-elasticache-tags-retry branch March 25, 2025 13:53
Copy link

Warning

This Issue has been closed, meaning that any additional comments are much easier for the maintainers to miss. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v5.93.0 milestone Mar 25, 2025
terraform-aws-provider bot pushed a commit that referenced this pull request Mar 25, 2025
Copy link

This functionality has been released in v5.93.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 github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. generators Relates to code generators. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/elasticache Issues and PRs that pertain to the elasticache service. size/M Managed by automation to categorize the size of a PR. tags Pertains to resource tagging.
Projects
None yet
2 participants