Skip to content

Commit

Permalink
Update gcp-postgresql.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
twerthi authored Jul 27, 2023
1 parent 146f54b commit d7faad7
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,27 @@ resource "google_sql_user" "postgres" {
type = "BUILT_IN"
}

########################################################################################
## Workaround for https://github.com/hashicorp/terraform-provider-google/issues/14233 ##
########################################################################################

resource "time_sleep" "wait" {
depends_on = [google_sql_database_instance.postgresql]

create_duration = "20s"
}

########################################################################################
## End workaround ##
########################################################################################

resource "google_sql_user" "postgresql_service_account" {
name = "${var.database_service_account_name}@${var.octopus_gcp_project}.iam" # Service account created in shared workers for GCP
instance = google_sql_database_instance.postgresql.name
type = "CLOUD_IAM_SERVICE_ACCOUNT"

depends_on = [
google_sql_database_instance.postgresql
time_sleep.wait # Implementation of workaround
]
}

Expand Down

0 comments on commit d7faad7

Please sign in to comment.