diff --git a/octopus-samples-instances/gcp-base-infrastructure-terraform/gcp-postgresql.tf b/octopus-samples-instances/gcp-base-infrastructure-terraform/gcp-postgresql.tf index fdf3ca7..6ef0f2d 100644 --- a/octopus-samples-instances/gcp-base-infrastructure-terraform/gcp-postgresql.tf +++ b/octopus-samples-instances/gcp-base-infrastructure-terraform/gcp-postgresql.tf @@ -26,6 +26,10 @@ 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 + ] } resource "google_compute_firewall" "allow-postgresql" { @@ -38,4 +42,4 @@ resource "google_compute_firewall" "allow-postgresql" { source_service_accounts = [ "${var.database_service_account_name}@${var.octopus_gcp_project}.iam.gserviceaccount.com" ] -} \ No newline at end of file +}