Skip to content

Commit

Permalink
Merge pull request #1771 from DFE-Digital/paas/fix_db_connection
Browse files Browse the repository at this point in the history
Fix Database Connection
  • Loading branch information
sfawcett123 authored Jun 15, 2021
2 parents 2218c02 + 898884e commit ea6f4a4
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions terraform/paas/application.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
locals {
environment_map = { REDIS_URL = local.redis-credentials.uri,
DATABASE_URL = local.postgres-credentials.uri,
DB_DATABASE = "schools-experience",
DB_DATABASE = local.postgres-credentials.name
DB_HOST = local.postgres-credentials.host,
DB_USERNAME = local.postgres-credentials.username,
DB_PASSWORD = local.postgres-credentials.password,
Expand All @@ -27,22 +26,6 @@ resource "cloudfoundry_app" "application" {
route = cloudfoundry_route.route_internal.id
}

# For Review Apps find existing Resources
dynamic "service_binding" {
for_each = concat(data.cloudfoundry_service_instance.redis, data.cloudfoundry_service_instance.redis)
content {
service_instance = service_binding.value["id"]
}
}

# For Dev/Test/Production Apps use created Resources
dynamic "service_binding" {
for_each = concat(cloudfoundry_service_instance.redis, cloudfoundry_service_instance.postgres, cloudfoundry_user_provided_service.logging)
content {
service_instance = service_binding.value["id"]
}
}

environment = merge(local.application_secrets, local.environment_map)

}

0 comments on commit ea6f4a4

Please sign in to comment.