Cloud SQL - Cannot recreate DB instance if it was deleted outside Terraform and users/db's were defined in terraform #20934
Labels
bug
forward/review
In review; remove label to forward
service/sqladmin-cp
service/sqladmin-infra
waiting-response
Community Note
Terraform Version & Provider Version(s)
Terraform v1.9.8
on linux_amd64
Affected Resource(s)
google_sql_database_instance
google_sql_database
google_sql_user
Terraform Configuration
Debug Output
No response
Expected Behavior
After removing the cloud sql instance from GCP using the console, terraform should recreate the instance and the associated user & DB.
Actual Behavior
terraform plan
fails because of an error retrieving info about the cloud sql instance that was deleted.Output:
Steps to reproduce
terraform apply
terraform plan
Important Factoids
The workaround is to remove the user and db via
terraform state rm
.References
No response
The text was updated successfully, but these errors were encountered: