Skip to content

Commit

Permalink
Merge pull request #693 from alphagov/PP-6127_bind_to_creds_service
Browse files Browse the repository at this point in the history
PP-6127: Add env-map bindings to creds provided by secrets service
  • Loading branch information
rjbaker authored Feb 13, 2020
2 parents f0813f3 + d7370d1 commit 127b825
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
13 changes: 7 additions & 6 deletions manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ applications:
services:
- app-catalog
- adminusers-db
- adminusers-secret-service
env:
ENV_MAP_BP_USE_APP_PROFILE_DIR: true
ADMIN_PORT: '9301'
Expand All @@ -25,20 +26,20 @@ applications:
JPA_SQL_LOG_LEVEL: 'INFO'
LOGIN_ATTEMPT_CAP: '10'
RUN_APP: 'true'
RUN_MIGRATION: ((run_migration))

SUPPORT_URL: ((support_url))

METRICS_HOST: ((metrics_host))
METRICS_PORT: ((metrics_port))

NOTIFY_API_KEY: ((notify_api_key))
NOTIFY_BASE_URL: ((notify_base_url))
NOTIFY_DIRECT_DEBIT_API_KEY: ((notify_api_key))

# Provided via adminusers-secret-service
NOTIFY_API_KEY: ""
NOTIFY_DIRECT_DEBIT_API_KEY: ""
SENTRY_DSN: ""

# Provided via app-catalog bound service, see env-map.yml
BASE_URL: ""
SELFSERVICE_URL: ""
SUPPORT_URL: ""

# Provide via adminusers-db service, see env-map.yml
DB_HOST: ""
Expand Down
18 changes: 11 additions & 7 deletions src/main/resources/env-map.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
env_vars:
BASE_URL: '.[][] | select(.name == "app-catalog") | .credentials.adminusers_url '
SELFSERVICE_URL: '.[][] | select(.name == "app-catalog") | .credentials.selfservice_url '
DB_HOST: '.[][] | select(.name == "adminusers-db") | .credentials.host '
DB_NAME: '.[][] | select(.name == "adminusers-db") | .credentials.name '
DB_PASSWORD: '.[][] | select(.name == "adminusers-db") | .credentials.password '
DB_USER: '.[][] | select(.name == "adminusers-db") | .credentials.username '
DB_SSL_OPTION: '.[][] | select(.name == "adminusers-db") | .credentials.ssl_option // "ssl=true"'
BASE_URL: '.[][] | select(.name == "app-catalog") | .credentials.adminusers_url'
SELFSERVICE_URL: '.[][] | select(.name == "app-catalog") | .credentials.selfservice_url'
SUPPORT_URL: '.[][] | select(.name == "app-catalog") | .credentials.card_frontend_support_url'
DB_HOST: '.[][] | select(.name == "adminusers-db") | .credentials.host'
DB_NAME: '.[][] | select(.name == "adminusers-db") | .credentials.name'
DB_PASSWORD: '.[][] | select(.name == "adminusers-db") | .credentials.password'
DB_USER: '.[][] | select(.name == "adminusers-db") | .credentials.username'
DB_SSL_OPTION: '.[][] | select(.name == "adminusers-db") | .credentials.ssl_option // "ssl=true"'
NOTIFY_API_KEY: '.[][] | select(.name == "adminusers-secret-service") | .credentials.notify_api_key'
NOTIFY_DIRECT_DEBIT_API_KEY: '.[][] | select(.name == "adminusers-secret-service") | .credentials.notify_direct_debit_api_key'
SENTRY_DSN: '.[][] | select(.name == "adminusers-secret-service") | .credentials.sentry_dsn'

0 comments on commit 127b825

Please sign in to comment.