Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
- If an issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to "hashibot", a community member has claimed the issue already.
Terraform Version
Terraform v0.12.5
- provider.google v2.11.0
- provider.google-beta v2.11.0
Affected Resource(s)
Terraform Configuration Files
resource "google_project" "project" {
name = "dzr-test-dev"
project_id = "dzr-test-dev"
folder_id = "01234567890"
billing_account = "01234567890"
auto_create_network = true
skip_delete = true
}
Debug Output
Panic Output
Expected Behavior
After destroying a project with the skip_delete = true argument, I wanted it to be kept in the state file like this:
"resources": [
{
"module": "module.project",
"mode": "managed",
"type": "google_project",
"name": "project",
"provider": "provider.google",
"instances": [
{
"schema_version": 1,
"attributes": {
"app_engine": [],
"auto_create_network": true,
"billing_account": "012345-123456-123456",
"folder_id": "01234567890",
"id": "dzr-test-dev",
"name": "dzr-test-dev",
"number": "01234567890",
"org_id": "01234567890",
"policy_data": null,
"policy_etag": null,
"project_id": "dzr-test-dev",
"skip_delete": true
},
"private": "eblublurandom"
}
]
}
Actual Behavior
The project is deleted in the terraform.tfstate file, but it's not deleted in Gcloud thanks to skip_delete = true argument.
I can't add new resources with terraform because the project is already created but the tfstate file is updated as if the project is deleted.
I need to re-import it manually if I want to bypass this behavior.
I suppose that the google_project part of the tfstate file don't need to be updated with the command terraform destroy and the skip_delete = true argument in the google_project resource.
Steps to Reproduce
terraform apply
terraform destroy
Important Factoids
References
Community Note
Terraform Version
Terraform v0.12.5
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
After destroying a project with the
skip_delete = trueargument, I wanted it to be kept in the state file like this:Actual Behavior
The project is deleted in the terraform.tfstate file, but it's not deleted in Gcloud thanks to
skip_delete = trueargument.I can't add new resources with terraform because the project is already created but the tfstate file is updated as if the project is deleted.
I need to re-import it manually if I want to bypass this behavior.
I suppose that the google_project part of the tfstate file don't need to be updated with the command
terraform destroyand theskip_delete = trueargument in the google_project resource.Steps to Reproduce
terraform applyterraform destroyImportant Factoids
References