When ever I am running a terraform plan using the following:

resource "google_sql_user" "users" { name = "me" instance = "${google_sql_database_instance.master.name}" host = "me.com" password = "changeme" } 

This only happens when I am running this a Postgres instance on Google Cloud SQL. Terraform always outputs that the plan will create a user, even though it's already created. I'm using terraform version 0.11.1. Is there something that i'm missing? I tried setting the id value, however there it still recretes itself.

1 Answer

It turns out that the terraform state of the user was not being added, the cause seemed to be that when using postgres, the value host = "me.com" is not required, but causes problems if it's left there.

Once that was removed, then the terraform state will be correct.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.