aws_elasticache_replication_group: Remove unneeded waitReplicationGroupAvailable() call inside resourceReplicationGroupRead()
#44811
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the library.
Changes to Security Controls
No security-related changes.
Description
For
aws_elasticache_replication_group,resourceReplicationGroupRead()has a call towaitReplicationGroupAvailable()that I think is now unneeded, which makes the provider stall for up to 40 minutes waiting for the replication group to enter stateavailable, when that function's code doesn't require the replication group to be in that state.This makes the operation timeout at that level, rather than passing through to the generated AWS tag handling code. The The latter:
ListTagsForResource()when the ElastiCache replication group is in statesnapshotting(which is why my ElastiCache RGs are not in stateavailableduring the plan, which is how I noticed this entire situation)Please review #44787, specifically:
aws_elasticache_replication_groupstalls silently if resource is in statesnapshotting, for up to 40 minutes #44787 (comment)and
aws_elasticache_replication_groupstalls silently if resource is in statesnapshotting, for up to 40 minutes #44787 (comment)Relations
Relates #44787
References
With a stock v6.16.0 provider, Terraform waits for 40 minutes, produces no WARNING log entries, and only says it's waiting for the replication group to become available, but not why:
After this patch, Terraform waits for 15 minutes, produces no WARNING log entries, and the ERROR messages explain that it was failing to list tags, and returns the error message from the AWS API call:
InvalidReplicationGroupState: Cluster not in available state to perform tagging operationsOutput from Acceptance Testing