1
votes

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

1 Answers

1
votes

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.