Need to present or allow for state import if something changes in the portal
Opened this issue · 0 comments
Right, so I decided (because I'm testing) to delete a tag from the portal I'd previously provisioned via terraform, and then run terraform apply
.
I get an error:
Getting an error is not entirely unreasonable given the circumstance (I deleted a resource that I'd created via terraform, so, fair), but what's the recommended recovery model here?
I managed to fix it by manually recreating the tag in the portal, then manually updating the tfstate file (🤮) with the ref from the new tag. On reflection, this was not the correct way to do it, I should probably run terraform state rm
(docs).
Perhaps if one of our resources gives back a 404, the error message we throw can include information about running terraform state rm
to forget about the object?
Originally posted by @enclave-alistair in #2 (comment)