Skip to content

Commit

Permalink
build(uee): [IOPID-1259] add environment variables for fn-app and fn-…
Browse files Browse the repository at this point in the history
…public (#801)

Co-authored-by: gquadrati <[email protected]>
  • Loading branch information
lucacavallaro and gquadrati authored Dec 18, 2023
1 parent 4b779f7 commit 03434ed
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@
| [azurerm_redis_cache.redis_cgn](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/redis_cache) | data source |
| [azurerm_resource_group.notifications_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/resource_group) | data source |
| [azurerm_resource_group.rg_cgn](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/resource_group) | data source |
| [azurerm_storage_account.citizen_auth_common](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/storage_account) | data source |
| [azurerm_storage_account.iopstapp](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/storage_account) | data source |
| [azurerm_storage_account.iopstcgn](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/storage_account) | data source |
| [azurerm_storage_account.logs](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/storage_account) | data source |
Expand Down
9 changes: 9 additions & 0 deletions src/core/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -289,4 +289,13 @@ data "azurerm_subnet" "services_cms_backoffice_snet" {
name = format("%s-services-cms-backoffice-snet", local.project)
virtual_network_name = module.vnet_common.name
resource_group_name = azurerm_resource_group.rg_common.name
}

#
# UNIQUE EMAIL ENFORCEMENT
#

data "azurerm_storage_account" "citizen_auth_common" {
name = "iopweucitizenauthst"
resource_group_name = "io-p-citizen-auth-data-rg"
}
7 changes: 6 additions & 1 deletion src/core/function_app.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ locals {
app_settings_common = {
FUNCTIONS_WORKER_RUNTIME = "node"
WEBSITE_RUN_FROM_PACKAGE = "1"
WEBSITE_VNET_ROUTE_ALL = "1"
WEBSITE_DNS_SERVER = "168.63.129.16"
FUNCTIONS_WORKER_PROCESS_COUNT = 4
NODE_ENV = "production"
Expand Down Expand Up @@ -119,6 +118,12 @@ locals {
IOWEB_ACCESS_REF = "https://ioapp.it"
#

# UNIQUE EMAIL ENFORCEMENT
FF_UNIQUE_EMAIL_ENFORCEMENT = "BETA"
UNIQUE_EMAIL_ENFORCEMENT_USERS = jsonencode(split(",", data.azurerm_key_vault_secret.app_backend_UNIQUE_EMAIL_ENFORCEMENT_USER.value))
PROFILE_EMAIL_STORAGE_CONNECTION_STRING = data.azurerm_storage_account.citizen_auth_common.primary_connection_string
PROFILE_EMAIL_STORAGE_TABLE_NAME = "profileEmails"

MAILUP_USERNAME = data.azurerm_key_vault_secret.common_MAILUP_USERNAME.value
MAILUP_SECRET = data.azurerm_key_vault_secret.common_MAILUP_SECRET.value
PUBLIC_API_KEY = trimspace(data.azurerm_key_vault_secret.fn_app_PUBLIC_API_KEY.value)
Expand Down
7 changes: 6 additions & 1 deletion src/core/function_public.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ locals {
app_settings_common = {
FUNCTIONS_WORKER_RUNTIME = "node"
WEBSITE_RUN_FROM_PACKAGE = "1"
WEBSITE_VNET_ROUTE_ALL = "1"
WEBSITE_DNS_SERVER = "168.63.129.16"
FUNCTIONS_WORKER_PROCESS_COUNT = 4
NODE_ENV = "production"
Expand All @@ -20,6 +19,12 @@ locals {
FETCH_KEEPALIVE_FREE_SOCKET_TIMEOUT = "30000"
FETCH_KEEPALIVE_TIMEOUT = "60000"

# UNIQUE EMAIL ENFORCEMENT
FF_UNIQUE_EMAIL_ENFORCEMENT = "BETA"
UNIQUE_EMAIL_ENFORCEMENT_USERS = jsonencode(split(",", data.azurerm_key_vault_secret.app_backend_UNIQUE_EMAIL_ENFORCEMENT_USER.value))
PROFILE_EMAIL_STORAGE_CONNECTION_STRING = data.azurerm_storage_account.citizen_auth_common.primary_connection_string
PROFILE_EMAIL_STORAGE_TABLE_NAME = "profileEmails"

COSMOSDB_URI = data.azurerm_cosmosdb_account.cosmos_api.endpoint
COSMOSDB_KEY = data.azurerm_cosmosdb_account.cosmos_api.primary_key
COSMOSDB_NAME = "db"
Expand Down

0 comments on commit 03434ed

Please sign in to comment.