-
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
provider/azurerm: Terraform Plan errors when created resources disappear #8859
Conversation
9827bdf
to
465b4ea
Compare
I think these errors were introduced in #8607 |
It looks like #8607 introduced a bug into all the azurerm resources, which now prevents refreshing resources that are deleted/not present. This will need some additional work. |
Adding some acceptance tests that show the problem. |
ad3f2f1
to
dbc94ae
Compare
Regressions were introduced when fixing hashicorp#8607 . Specifically when resources in the statefile are deleted or missing in real life, then terraform plan would exit with an error when it recieved a 404 not found. The correct behaviour would be to show a plan with the offer to create the missing resources.
21b61cf
to
e5219ba
Compare
This is now ready for review. |
This LGTM! Thanks for the work here :) Ran a set of the tests and all look good!
|
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. |
Terraform can't plan correctly when a VM is manually removed from Azure. The vmClient() API call returns an error for 404 return.
This is different to subnetClient() which doesn't error for 404 returns.subnetClient() also errors the same way. This may be a consistent problem across the provider.To Reproduce:
Apply
a plan to create a VM (example is below)Plan
. Terraform shows the following errorTerraform HCL