-
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
[Bug]: aws_elasticache must be in available state before modifying tags #35952
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
I'm also running into this issue; nothing is changing on the resource for us but the tagging, and it's failing with this error. It looks like it might be an intermittent problem though; I can re-run the plan/apply and get it work sometimes. I'm not using TFE (we use Atlantis instead), so I am pretty sure this is just a provider issue. |
@cblkwell Thanks for pointing out that it's intermittent (random) issue. I also retried and suddenly it worked with no issues |
Confirmed intermittent issue. Rerunning the terraform managed to apply on second try. |
Terraform Core Version
1.5.1
AWS Provider Version
5.0
Affected Resource(s)
aws_elasticache_subnet_group
aws_elasticache_replication_group
Expected Behavior
Update tag successfully.
Actual Behavior
This scenario occurred due to a discrepancy in the tagging conventions between the old and new configurations, compounded by the behaviour of Terraform Enterprise (TFE) during resource updates.
Initially, when the resource was created the tag
environment
was set to "production
", with the new configuration the tags that were applied were changed toEnvironment
with the valuePRODUCTION
When TFE executed, it recognized it needs to update existing resources based on the new tag configuration. Consequently, it attempted to update the
aws_elasticache_subnet_group
resource by modifying its tags. Specifically, it changed the environment tag toEnvironment
and adjusted its value to "PRODUCTION
", reflecting the updated tagging on the resource.However, during the execution of the second step, which involved the
aws_elasticache_replication_group
resource, an error occurred. This error stemmed from the fact that the Elasticache cluster associated with this resource was not available at that moment to perform tagging update operations.To fix this we had to re-run the TFE in order to update the tag
Relevant Error/Panic Output Snippet
InvalidReplicationGroupState: Cluster not in available state to perform tagging operations. status code: 400
Terraform Configuration Files
Steps to Reproduce
Set a tags
environment = production
apply , then change the tag configuration toEnvironment = PRODUCTION
and re applyDebug Output
"@Level":"error","@message":"Error: updating tags for ElastiCache Replication Group (arn:XXXX): tagging resource (arnXXX): InvalidReplicationGroupState: Cluster not in available state to perform tagging operations.\n\tstatus code: 400, request id: XXXXX","@module":"terraform.ui","@timestamp":"2023-11-29T18:15:03.252125Z","diagnostic":{"severity":"error","summary":"updating tags for ElastiCache Replication Group (arn:XXXXX): tagging resource (arn:XXX): InvalidReplicationGroupState: Cluster not in available state to perform tagging operations.\n\tstatus code: 400, request id: XXXX","detail":"","address":"module.redis-cache.aws_elasticache_replication_group.default","range":{"filename":".terraform/modules/redis-cache/modules/redis-cache/main.tf","start":{"line":41,"column":56,"byte":1614},"end":
Panic Output
No response
Important Factoids
In this case the depends_on meta-argument to handle this situations would not help, because it waits for the resource to be created but not ready
References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: