terraform-provider-google icon indicating copy to clipboard operation
terraform-provider-google copied to clipboard

Error 409: The resource "projects/..." already exists

Open aymanelbacha opened this issue 9 months ago • 2 comments

Question

Dear Hachicorp support team, Appreciate to assist me in this, as I am using terraform import to create state of resources that has been created manually, in this case we have a drift, https://cloud.google.com/docs/terraform/resource-management/import Yet, when using "terraform apply" I am getting the "Error 409: The resource "projects/..." already exists" what are the possible solutions in this case, do we need to recreate with new naming then destroying the new one. Note, I have tried multiple workarounds as we don't need to risk deleting and creating new ressource

I have tried adding the below

lifecycle { ignore_changes = all }

Didn't work, then tried https://developer.hashicorp.com/terraform/cli/state/taint

terraform apply -replace 'projects/gcp../zones/europe-west1-b/disks/gitlab-sv'

│ Expected an attribute access or an index operator.

aymanelbacha avatar May 10 '24 17:05 aymanelbacha

Ill take this over

hassannmoussaa avatar May 10 '24 19:05 hassannmoussaa

Admin, plz remove Hassan

aymanelbacha avatar May 10 '24 19:05 aymanelbacha