Terraform trying to read the SQL user after database is deleted

Viewed 2688

Our terraform state went to a broken state after we accidentally executed a out of date branch.

Two of the database got deleted, and as GCP doesn't let you use the same name for database after deletion, terraform couldn't recreate the databases, and bailed out.

The problem is, terraform thinks the databases are their, and trying to read its users:

Error when reading or editing SQL User "xxx" in instance "xxx": googleapi: Error 400: Invalid request: Invalid request since instance is not running., invalid

The instance is simply not there!

I tried to taint the database, and the user, but I still get this exact same error.

Does anyone know how to fix this? I cannot afford to destroy and recreate the environment.

1 Answers
Related