Skip to content

Commit

Permalink
web: add digitransit subscription key to next web app env
Browse files Browse the repository at this point in the history
  • Loading branch information
kahlstrm committed Jun 15, 2024
1 parent 70c38c8 commit 0f0c087
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
27 changes: 14 additions & 13 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,20 @@ resource "azurerm_key_vault_secret" "mongo_db_connection_string" {
}

module "web" {
source = "./modules/web"
resource_group_location = local.resource_group_location
resource_group_name = module.common.resource_group_name
app_service_plan_id = module.common.tikweb_app_plan_id
acme_account_key = module.common.acme_account_key
root_zone_name = module.dns_prod.root_zone_name
dns_resource_group_name = module.dns_prod.resource_group_name
subdomain = "@"
mongo_connection_string = module.mongodb.db_connection_string
google_oauth_client_id = module.keyvault.google_oauth_client_id
google_oauth_client_secret = module.keyvault.google_oauth_client_secret
public_ilmo_url = "https://${module.ilmo.fqdn}"
public_legacy_url = "https://tietokilta.fi"
source = "./modules/web"
resource_group_location = local.resource_group_location
resource_group_name = module.common.resource_group_name
app_service_plan_id = module.common.tikweb_app_plan_id
acme_account_key = module.common.acme_account_key
root_zone_name = module.dns_prod.root_zone_name
dns_resource_group_name = module.dns_prod.resource_group_name
subdomain = "@"
mongo_connection_string = module.mongodb.db_connection_string
google_oauth_client_id = module.keyvault.google_oauth_client_id
google_oauth_client_secret = module.keyvault.google_oauth_client_secret
public_ilmo_url = "https://${module.ilmo.fqdn}"
public_legacy_url = "https://tietokilta.fi"
digitransit_subscription_key = module.keyvault.digitransit_subscription_key
}
resource "azurerm_key_vault_secret" "cms_password" {
name = "cms-password"
Expand Down
15 changes: 8 additions & 7 deletions modules/web/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@ resource "azurerm_linux_web_app" "web" {
}
https_only = true
app_settings = {
NODE_ENVIRONMENT = "production"
PUBLIC_ILMOMASIINA_URL = var.public_ilmo_url
WEBSITES_PORT = 3000
PORT = 3000
NEXT_REVALIDATION_KEY = random_password.revalidation_key.result
PUBLIC_SERVER_URL = "https://${azurerm_linux_web_app.cms.default_hostname}"
PUBLIC_LEGACY_URL = var.public_legacy_url
NODE_ENVIRONMENT = "production"
PUBLIC_ILMOMASIINA_URL = var.public_ilmo_url
WEBSITES_PORT = 3000
PORT = 3000
NEXT_REVALIDATION_KEY = random_password.revalidation_key.result
PUBLIC_SERVER_URL = "https://${azurerm_linux_web_app.cms.default_hostname}"
PUBLIC_LEGACY_URL = var.public_legacy_url
DIGITRANSIT_SUBSCRIPTION_KEY = var.digitransit_subscription_key
}
}
resource "random_password" "payload_secret" {
Expand Down
4 changes: 4 additions & 0 deletions modules/web/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ variable "public_legacy_url" {
type = string
}

variable "digitransit_subscription_key" {
type = string
sensitive = true
}

0 comments on commit 0f0c087

Please sign in to comment.