Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Terraform is using wrong google project

I deleted the project projects/project1-301106 and then created a new which ends with 301108. But terraform always try to use the old project.

Error: Error creating Network: googleapi: Error 404: The resource 'projects/project1-301106' was not found, notFound

I deleted .terraform directory and files, ran terraform init. Also cleared gcould and reauth but still the same error.

like image 922
user630702 Avatar asked Sep 15 '25 14:09

user630702


1 Answers

Try this solution.

Remove these files and folders:

sudo rm -r .terraform .terraform.lock.hcl terraform.tfstate terraform.tfstate.backup

Then:

terraform init

Finally:

terraform apply -auto-approve
like image 67
Kai - Kazuya Ito Avatar answered Sep 18 '25 08:09

Kai - Kazuya Ito