Skip to content

Commit

Permalink
Add prod device sync related secrets to tf configs (#8323)
Browse files Browse the repository at this point in the history
  • Loading branch information
emyl3 authored Dec 3, 2024
1 parent 00c7e06 commit a5afa4c
Show file tree
Hide file tree
Showing 25 changed files with 150 additions and 7 deletions.
3 changes: 3 additions & 0 deletions backend/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ simple-report:
fhir-reporting-enabled: true
support-escalation:
enabled: false
production:
backend-url: ${SR_PROD_BACKEND_URL:http://localhost:8080}
devices-token: ${SR_PROD_DEVICES_TOKEN:sr-prod-devices-fake-token}
twilio:
messaging-service-sid: ${TWILIO_MESSAGING_SID}
logging:
Expand Down
11 changes: 11 additions & 0 deletions ops/demo/_data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,14 @@ data "azurerm_key_vault_secret" "datahub_signing_key" {
name = "datahub-signing-key-test"
key_vault_id = data.azurerm_key_vault.global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_backend_url" {
name = "simple-report-prod-backend-url"
key_vault_id = data.azurerm_key_vault.global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_devices_token" {
name = "simple-report-prod-devices-token"
key_vault_id = data.azurerm_key_vault.global.id
}

2 changes: 2 additions & 0 deletions ops/demo/api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ module "simple_report_api" {
DATAHUB_API_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_api_key.id})"
DATAHUB_FHIR_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_fhir_key.id})"
DATAHUB_SIGNING_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_signing_key.id})"
SR_PROD_BACKEND_URL = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_backend_url.id})"
SR_PROD_DEVICES_TOKEN = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_devices_token.id})"
# true by default: can be disabled quickly here
# SPRING_LIQUIBASE_ENABLED = "true"
# this shadows (and overrides) an identical declaration in application.yaml
Expand Down
10 changes: 10 additions & 0 deletions ops/dev/_data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,13 @@ data "azurerm_key_vault_secret" "datahub_signing_key" {
name = "datahub-signing-key-test"
key_vault_id = data.azurerm_key_vault.sr_global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_backend_url" {
name = "simple-report-prod-backend-url"
key_vault_id = data.azurerm_key_vault.sr_global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_devices_token" {
name = "simple-report-prod-devices-token"
key_vault_id = data.azurerm_key_vault.sr_global.id
}
2 changes: 2 additions & 0 deletions ops/dev/api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ module "simple_report_api" {
DATAHUB_API_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_api_key.id})"
DATAHUB_FHIR_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_fhir_key.id})"
DATAHUB_SIGNING_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_signing_key.id})"
SR_PROD_BACKEND_URL = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_backend_url.id})"
SR_PROD_DEVICES_TOKEN = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_devices_token.id})"
# true by default: can be disabled quickly here
# SPRING_LIQUIBASE_ENABLED = "true"
# this shadows (and overrides) an identical declaration in application.yaml
Expand Down
10 changes: 10 additions & 0 deletions ops/dev2/_data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,13 @@ data "azurerm_key_vault_secret" "datahub_signing_key" {
name = "datahub-signing-key-test"
key_vault_id = data.azurerm_key_vault.sr_global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_backend_url" {
name = "simple-report-prod-backend-url"
key_vault_id = data.azurerm_key_vault.sr_global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_devices_token" {
name = "simple-report-prod-devices-token"
key_vault_id = data.azurerm_key_vault.sr_global.id
}
2 changes: 2 additions & 0 deletions ops/dev2/api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ module "simple_report_api" {
DATAHUB_API_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_api_key.id})"
DATAHUB_FHIR_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_fhir_key.id})"
DATAHUB_SIGNING_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_signing_key.id})"
SR_PROD_BACKEND_URL = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_backend_url.id})"
SR_PROD_DEVICES_TOKEN = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_devices_token.id})"
# true by default: can be disabled quickly here
# SPRING_LIQUIBASE_ENABLED = "true"
# this shadows (and overrides) an identical declaration in application.yaml
Expand Down
10 changes: 10 additions & 0 deletions ops/dev3/_data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,13 @@ data "azurerm_key_vault_secret" "datahub_signing_key" {
name = "datahub-signing-key-test"
key_vault_id = data.azurerm_key_vault.sr_global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_backend_url" {
name = "simple-report-prod-backend-url"
key_vault_id = data.azurerm_key_vault.sr_global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_devices_token" {
name = "simple-report-prod-devices-token"
key_vault_id = data.azurerm_key_vault.sr_global.id
}
2 changes: 2 additions & 0 deletions ops/dev3/api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ module "simple_report_api" {
DATAHUB_API_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_api_key.id})"
DATAHUB_FHIR_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_fhir_key.id})"
DATAHUB_SIGNING_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_signing_key.id})"
SR_PROD_BACKEND_URL = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_backend_url.id})"
SR_PROD_DEVICES_TOKEN = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_devices_token.id})"
# true by default: can be disabled quickly here
# SPRING_LIQUIBASE_ENABLED = "true"
# this shadows (and overrides) an identical declaration in application.yaml
Expand Down
10 changes: 10 additions & 0 deletions ops/dev4/_data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,13 @@ data "azurerm_key_vault_secret" "datahub_signing_key" {
name = "datahub-signing-key-test"
key_vault_id = data.azurerm_key_vault.sr_global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_backend_url" {
name = "simple-report-prod-backend-url"
key_vault_id = data.azurerm_key_vault.sr_global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_devices_token" {
name = "simple-report-prod-devices-token"
key_vault_id = data.azurerm_key_vault.sr_global.id
}
2 changes: 2 additions & 0 deletions ops/dev4/api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ module "simple_report_api" {
DATAHUB_API_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_api_key.id})"
DATAHUB_FHIR_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_fhir_key.id})"
DATAHUB_SIGNING_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_signing_key.id})"
SR_PROD_BACKEND_URL = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_backend_url.id})"
SR_PROD_DEVICES_TOKEN = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_devices_token.id})"
# true by default: can be disabled quickly here
# SPRING_LIQUIBASE_ENABLED = "true"
# this shadows (and overrides) an identical declaration in application.yaml
Expand Down
10 changes: 10 additions & 0 deletions ops/dev5/_data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,13 @@ data "azurerm_key_vault_secret" "datahub_signing_key" {
name = "datahub-signing-key-test"
key_vault_id = data.azurerm_key_vault.sr_global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_backend_url" {
name = "simple-report-prod-backend-url"
key_vault_id = data.azurerm_key_vault.sr_global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_devices_token" {
name = "simple-report-prod-devices-token"
key_vault_id = data.azurerm_key_vault.sr_global.id
}
3 changes: 2 additions & 1 deletion ops/dev5/api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ module "simple_report_api" {
DATAHUB_API_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_api_key.id})"
DATAHUB_FHIR_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_fhir_key.id})"
DATAHUB_SIGNING_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_signing_key.id})"

SR_PROD_BACKEND_URL = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_backend_url.id})"
SR_PROD_DEVICES_TOKEN = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_devices_token.id})"
# true by default: can be disabled quickly here
# SPRING_LIQUIBASE_ENABLED = "true"
# this shadows (and overrides) an identical declaration in application.yaml
Expand Down
10 changes: 10 additions & 0 deletions ops/dev6/_data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,13 @@ data "azurerm_key_vault_secret" "datahub_signing_key" {
name = "datahub-signing-key-test"
key_vault_id = data.azurerm_key_vault.sr_global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_backend_url" {
name = "simple-report-prod-backend-url"
key_vault_id = data.azurerm_key_vault.sr_global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_devices_token" {
name = "simple-report-prod-devices-token"
key_vault_id = data.azurerm_key_vault.sr_global.id
}
2 changes: 2 additions & 0 deletions ops/dev6/api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ module "simple_report_api" {
DATAHUB_API_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_api_key.id})"
DATAHUB_FHIR_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_fhir_key.id})"
DATAHUB_SIGNING_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_signing_key.id})"
SR_PROD_BACKEND_URL = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_backend_url.id})"
SR_PROD_DEVICES_TOKEN = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_devices_token.id})"
# true by default: can be disabled quickly here
# SPRING_LIQUIBASE_ENABLED = "true"
# this shadows (and overrides) an identical declaration in application.yaml
Expand Down
10 changes: 10 additions & 0 deletions ops/pentest/_data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,13 @@ data "azurerm_key_vault_secret" "datahub_signing_key" {
name = "datahub-signing-key-test"
key_vault_id = data.azurerm_key_vault.global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_backend_url" {
name = "simple-report-prod-backend-url"
key_vault_id = data.azurerm_key_vault.global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_devices_token" {
name = "simple-report-prod-devices-token"
key_vault_id = data.azurerm_key_vault.global.id
}
2 changes: 2 additions & 0 deletions ops/pentest/api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ module "simple_report_api" {
DATAHUB_API_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_api_key.id})"
DATAHUB_FHIR_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_fhir_key.id})"
DATAHUB_SIGNING_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_signing_key.id})"
SR_PROD_BACKEND_URL = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_backend_url.id})"
SR_PROD_DEVICES_TOKEN = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_devices_token.id})"
# true by default: can be disabled quickly here
# SPRING_LIQUIBASE_ENABLED = "true"
# this shadows (and overrides) an identical declaration in application.yaml
Expand Down
12 changes: 11 additions & 1 deletion ops/prod/_data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,14 @@ data "azurerm_key_vault_secret" "datahub_signing_key" {
data "azurerm_key_vault_secret" "slack_hook_token" {
name = "slack-hook-token-prod"
key_vault_id = data.azurerm_key_vault.global.id
}
}

data "azurerm_key_vault_secret" "simple_report_prod_backend_url" {
name = "simple-report-prod-backend-url"
key_vault_id = data.azurerm_key_vault.global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_devices_token" {
name = "simple-report-prod-devices-token"
key_vault_id = data.azurerm_key_vault.global.id
}
3 changes: 2 additions & 1 deletion ops/prod/api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ module "simple_report_api" {
DATAHUB_FHIR_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_fhir_key.id})"
DATAHUB_SIGNING_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_signing_key.id})"
SLACK_HOOK_TOKEN = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.slack_hook_token.id})"

SR_PROD_BACKEND_URL = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_backend_url.id})"
SR_PROD_DEVICES_TOKEN = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_devices_token.id})"
# true by default: can be disabled quickly here
# SPRING_LIQUIBASE_ENABLED = "true"
# this shadows (and overrides) an identical declaration in application.yaml
Expand Down
10 changes: 10 additions & 0 deletions ops/stg/_data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,13 @@ data "azurerm_key_vault_secret" "report_stream_exception_callback_token" {
name = "report-stream-exception-callback-test"
key_vault_id = data.azurerm_key_vault.global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_backend_url" {
name = "simple-report-prod-backend-url"
key_vault_id = data.azurerm_key_vault.global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_devices_token" {
name = "simple-report-prod-devices-token"
key_vault_id = data.azurerm_key_vault.global.id
}
3 changes: 2 additions & 1 deletion ops/stg/api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ module "simple_report_api" {
DATAHUB_SIGNING_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_signing_key.id})"
AZ_REPORTING_QUEUE_CXN_STRING = data.azurerm_storage_account.app.primary_connection_string
RS_QUEUE_CALLBACK_TOKEN = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.report_stream_exception_callback_token.id})"

SR_PROD_BACKEND_URL = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_backend_url.id})"
SR_PROD_DEVICES_TOKEN = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_devices_token.id})"
# true by default: can be disabled quickly here
# SPRING_LIQUIBASE_ENABLED = "true"
# this shadows (and overrides) an identical declaration in application.yaml
Expand Down
12 changes: 11 additions & 1 deletion ops/test/_data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,14 @@ data "azurerm_key_vault_secret" "datahub_signing_key" {
data "azurerm_key_vault_secret" "slack_hook_token" {
name = "slack-hook-token-test"
key_vault_id = data.azurerm_key_vault.sr_global.id
}
}

data "azurerm_key_vault_secret" "simple_report_prod_backend_url" {
name = "simple-report-prod-backend-url"
key_vault_id = data.azurerm_key_vault.sr_global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_devices_token" {
name = "simple-report-prod-devices-token"
key_vault_id = data.azurerm_key_vault.sr_global.id
}
3 changes: 2 additions & 1 deletion ops/test/api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ module "simple_report_api" {
DATAHUB_FHIR_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_fhir_key.id})"
DATAHUB_SIGNING_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_signing_key.id})"
SLACK_HOOK_TOKEN = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.slack_hook_token.id})"

SR_PROD_BACKEND_URL = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_backend_url.id})"
SR_PROD_DEVICES_TOKEN = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_devices_token.id})"
# true by default, can be disabled quickly here
# SPRING_LIQUIBASE_ENABLED = "true"
# this shadows/overrides an identical declaration in application.yaml
Expand Down
10 changes: 10 additions & 0 deletions ops/training/_data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,13 @@ data "azurerm_key_vault_secret" "datahub_signing_key" {
name = "datahub-signing-key-test"
key_vault_id = data.azurerm_key_vault.global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_backend_url" {
name = "simple-report-prod-backend-url"
key_vault_id = data.azurerm_key_vault.global.id
}

data "azurerm_key_vault_secret" "simple_report_prod_devices_token" {
name = "simple-report-prod-devices-token"
key_vault_id = data.azurerm_key_vault.global.id
}
3 changes: 2 additions & 1 deletion ops/training/api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ module "simple_report_api" {
DATAHUB_API_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_api_key.id})"
DATAHUB_FHIR_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_fhir_key.id})"
DATAHUB_SIGNING_KEY = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.datahub_signing_key.id})"

SR_PROD_BACKEND_URL = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_backend_url.id})"
SR_PROD_DEVICES_TOKEN = "@Microsoft.KeyVault(SecretUri=${data.azurerm_key_vault_secret.simple_report_prod_devices_token.id})"
# true by default: can be disabled quickly here
# SPRING_LIQUIBASE_ENABLED = "true"
# this shadows (and overrides) an identical declaration in application.yaml
Expand Down

0 comments on commit a5afa4c

Please sign in to comment.