Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use com-citizen-func instead app-messages-xl #1428

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/common/_modules/app_backend/app_settings.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ locals {
CGN_OPERATOR_SEARCH_API_KEY = data.azurerm_key_vault_secret.app_backend_CGN_OPERATOR_SEARCH_API_KEY_PROD.value
EUCOVIDCERT_API_URL = "https://${var.backend_hostnames.eucovidcert}/api/v1"
EUCOVIDCERT_API_KEY = data.azurerm_key_vault_secret.fn_eucovidcert_API_KEY_APPBACKEND.value
APP_MESSAGES_API_URL = "https://${var.backend_hostnames.app_messages[(var.index - 1) % local.app_messages_count]}/api/v1"
APP_MESSAGES_API_KEY = data.azurerm_key_vault_secret.app_backend_APP_MESSAGES_API_KEY[(var.index - 1) % local.app_messages_count].value
APP_MESSAGES_API_URL = "https://${var.backend_hostnames.com_citizen_func}/api/v1"
APP_MESSAGES_API_KEY = data.azurerm_key_vault_secret.app_backend_COM_CITIZEN_FUNC_API_KEY.value
LOLLIPOP_API_URL = "https://${var.backend_hostnames.lollipop}"
LOLLIPOP_API_KEY = data.azurerm_key_vault_secret.app_backend_LOLLIPOP_ITN_API_KEY.value
TRIAL_SYSTEM_API_URL = "https://ts-p-itn-api-func-01.azurewebsites.net" # not working anymore
Expand Down
5 changes: 2 additions & 3 deletions src/common/_modules/app_backend/data_kv.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ data "azurerm_key_vault_secret" "app_backend_PECSERVER_ARUBA_TOKEN_SECRET" {
key_vault_id = var.key_vault_common.id
}

data "azurerm_key_vault_secret" "app_backend_APP_MESSAGES_API_KEY" {
count = local.app_messages_count
name = count.index % local.app_messages_count == 0 ? "appbackend-APP-MESSAGES-API-KEY" : format("appbackend-APP-MESSAGES-API-KEY-%02d", (count.index % local.app_messages_count) + 1)
data "azurerm_key_vault_secret" "app_backend_COM_CITIZEN_FUNC_API_KEY" {
name = "appbackend-COM-CITIZEN-FUNC-API-KEY"
key_vault_id = var.key_vault_common.id
}

Expand Down
1 change: 0 additions & 1 deletion src/common/_modules/app_backend/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ locals {
citizen_auth_revoke_queue_name = "pubkeys-revoke-v2"

function_app_count = length(var.backend_hostnames.app)
app_messages_count = length(var.backend_hostnames.app_messages)

nonstandard = {
weu = {
Expand Down
2 changes: 1 addition & 1 deletion src/common/_modules/app_backend/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ variable "app_settings_override" {
variable "backend_hostnames" {
type = object({
app = list(string)
app_messages = list(string)
com_citizen_func = string
assets_cdn = string
services_app_backend = string
lollipop = string
Expand Down
2 changes: 1 addition & 1 deletion src/common/prod/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
| [azuread_service_principal.apim_client_svc](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/data-sources/service_principal) | data source |
| [azuread_service_principal.dev_portal_svc](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/data-sources/service_principal) | data source |
| [azurerm_client_config.current](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/client_config) | data source |
| [azurerm_linux_function_app.app_messages_xl](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/linux_function_app) | data source |
| [azurerm_linux_function_app.com_citizen_func](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/linux_function_app) | data source |
| [azurerm_linux_function_app.eucovidcert](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/linux_function_app) | data source |
| [azurerm_linux_function_app.function_assets_cdn](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/linux_function_app) | data source |
| [azurerm_linux_function_app.function_profile](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/linux_function_app) | data source |
Expand Down
7 changes: 3 additions & 4 deletions src/common/prod/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,9 @@ data "azurerm_linux_function_app" "function_profile" {
resource_group_name = "${local.project_itn}-profile-rg-01"
}

data "azurerm_linux_function_app" "app_messages_xl" {
count = local.app_messages_count
name = "${local.project_weu_legacy}-weu-com-citizen-func-0${count.index + 1}"
resource_group_name = "${local.project_weu_legacy}-weu-com-rg-01"
data "azurerm_linux_function_app" "com_citizen_func" {
name = "${local.project_itn}-com-citizen-func-01"
resource_group_name = "${local.project_itn}-com-rg-01"
}

data "azurerm_linux_function_app" "services_app_backend_function_app" {
Expand Down
2 changes: 1 addition & 1 deletion src/common/prod/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ locals {

backend_hostnames = {
app = [data.azurerm_linux_function_app.function_profile.default_hostname]
app_messages = [for key, value in data.azurerm_linux_function_app.app_messages_xl : value.default_hostname]
com_citizen_func = data.azurerm_linux_function_app.com_citizen_func.default_hostname
assets_cdn = data.azurerm_linux_function_app.function_assets_cdn.default_hostname
services_app_backend = data.azurerm_linux_function_app.services_app_backend_function_app.default_hostname
lollipop = data.azurerm_linux_function_app.lollipop_function.default_hostname
Expand Down
Loading