Closed alfonsozamorac closed 3 months ago
@alfonsozamorac Thanks for filing the ticket. Yes, that's known issue and it should be fixed by https://github.com/GoogleCloudPlatform/magic-modules/pull/10046 which is released v5.19.0. Would mind upgrading to a 5.19.0+ version and see if this issue still occurs
Thank you very much for the response @shuyama1. We will try to upgrade the version to see if it solves the problem. For projects that have a 'tainted' state, what would be the solution? Should we untaint the resource using terraform untaint google_project.my_project
, or will upgrading the version fix the status? We cannot destroy and create the projects because our policy prevents recreation for 30 days.
Upgrading the version wouldn't resolve the issue for existing resources, unless you let Terraform delete and recreate them. Given the fact that you cannot destroy and create the projects because the policy prevents recreation for 30 days, I think you can run terraform untaint
to bring the project resource out of the taint
state and you'll probably also need to manually delete the default network as I believe the network deletion failed during the initial creation of the project and Terraform wouldn't able to perform that action in any following runs.
I executed terraform untaint
on the project resource and verified that the default network was not created. After this change, the remaining resources were successfully created without needing to destroy the project. Thank you very much @shuyama1
Great! Glad it worked. Closing this issue now. Feel free to reopen or file a new one if the issue happens again. 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 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.
Community Note
Terraform Version & Provider Version(s)
Terraform v1.2.9 provider registry.terraform.io/hashicorp/google v5.10.0 provider registry.terraform.io/hashicorp/google-beta v5.10.0
Affected Resource(s)
google_project
Terraform Configuration
Debug Output
Expected Behavior
Successful project creation
Actual Behavior
It fails because the Compute Engine API is not enabled and cannot delete default networks because I have the variable
auto_create_network = false
. When you try to do a second apply the project appears in 'tainted' state and needs to be destroyed and recreated. It doesn't always happen, making it difficult to reproduce the error.Steps to reproduce
terraform apply
terraform apply
Important Factoids
No response
References
No response