-
Notifications
You must be signed in to change notification settings - Fork 1.8k
google_project resource in DELETE_REQUESTED state causes terraform plan error #451
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
Comments
Hi Kit, I am curious about what behavior you expect when the project is in DELETE_REQUESTED state? A) Delete from tf.state (that's what calling B) Call undelete on the project making it |
If the project is deleted via However, a case can be made for A) also 😄. BTW, it looks like folders can also be undeleted and that resource has I can think of no prior art here for other resources/cloud providers I know except for some similarity to re-creating the AWS default VPC for a region - hashicorp/terraform-provider-aws#1400. |
Agreed, folders and projects should behave the same way for this. I am also leaning towards B). @danawillow @paddycarver @selmanj Any thoughts before I update our project and folder resources to handle this case? |
Yup, same. I think we should handle DELETE_REQUESTED as if it were actually deleted- so a plan would show it as being created, and apply would un-delete it. It's a bit tricky because if it has any properties (I guess just billing account right now) that change, they'd have to be updated as well alongside the undelete. |
I am hesitant about using an undelete; from the docs:
As a user, it would be surprising to me if I deleted a project, recreated it, and then all the previous state was restored (more specifically, all the resources associated with the project get revived). That works different from every other resource in terraform. |
@selmanj you convinced me. undelete cloud be quite surprising. If they deleted it from the console by mistake, they can undelete it from there. I will handle the not found error properly and this will trigger a new project creation. |
(Chiming in late that support for undelete would be very cool in certain situations, but I too believe it would lead to confusing and unexpected edge cases and it would probably be better to delete from state. So what y'all said, just agreeing. :) ) |
…rp#451) <!-- This change is generated by MagicModules. --> /cc @rileykarson
Thanks to @ewbankkit . |
Hi @AbhinayGupta741, this issue has been closed for over two years so I think most of us have lost context as this point. If you're experiencing problems still, could you please open a new one in the tracker and fill out the template completely? Thanks! |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
I successfully create a project via Terraform:
and then shut down the project in the GCP console. The project transitions to
DELETE_REQUESTED
state.I then run
terraform plan
and get an error:Running with logging on:
The text was updated successfully, but these errors were encountered: