-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
aws_elasticache_cluster does not correctly handle deleted clusters #3689
Comments
@apparentlymart you are indeed correct , PR is on it's way. I just ran the following test:
I then went to the AWS UI and destroyed it. When running terraform refresh, I got the following:
I changed the code of the Read method as follows:
I was then able to refresh the state as required |
Fixed in #3767! |
I'm going to lock this issue 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 similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
If the cluster associated with an
aws_elasticache_cluster
resource is deleted outside of Terraform, a subsequentterraform refresh
will fail:The expected behavior is that it would call
d.SetId("")
to tell Terraform that the resource no longer exists, so thatplan
can know to create a fresh instance of the resource.In the code we can see that it doesn't have any special handling for the 404 case, and it looks like it was instead expecting to get a 200 OK response with an empty set of
CacheClusters
. However, even if an empty set had been returned I think this would have still behaved improperly since it doesn't calld.SetId("")
even in that case.The text was updated successfully, but these errors were encountered: