Skip to content

Commit

Permalink
Translation service
Browse files Browse the repository at this point in the history
  • Loading branch information
harryy94 committed Jan 28, 2025
1 parent 3e19d73 commit 40e99f1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/infrastructure/terraform/locals.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
locals {
common_tags = {
"Environment" = var.cip_environment
"Product" = "Design operations"
"Service" = "Newly onboarded"
"Service offering" = "Design operations"
"Product" = "Design Operations"
"Service" = "Newly Onboarded"
"Service Offering" = "Design Operations"
}
service_prefix = "s186${var.environment_prefix}-cl"
location = "westeurope"
Expand Down
14 changes: 14 additions & 0 deletions src/infrastructure/terraform/translation.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
resource "azurerm_cognitive_account" "translation-cognitive-account" {
name = "${local.service_prefix}-translation"
location = azurerm_resource_group.core-rg.location
resource_group_name = azurerm_resource_group.core-rg.name
sku_name = "S0"
kind = "TextTranslation"
tags = local.common_tags
}

resource "azurerm_key_vault_secret" "translation-access-key" {
key_vault_id = azurerm_key_vault.key-vault.id
name = "translation-access-key"
value = azurerm_cognitive_account.translation-cognitive-account.primary_access_key
}
3 changes: 3 additions & 0 deletions src/infrastructure/terraform/web.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ locals {
"ApplicationInsights__ConnectionString" = "@Microsoft.KeyVault(SecretUri=${azurerm_key_vault_secret.application-insights-connection-string.versionless_id})"
"Caching__Type" = "Redis"
"Caching__ConnectionString" = "@Microsoft.KeyVault(SecretUri=${azurerm_key_vault_secret.redis-cache-connection-string.versionless_id})"
"Translation__AzureApiKey" = "@Microsoft.KeyVault(SecretUri=${azurerm_key_vault_secret.translation-access-key.versionless_id})"
}
}

Expand Down Expand Up @@ -53,6 +54,8 @@ resource "azurerm_linux_web_app_slot" "web-app-service-staging" {
}

app_settings = local.web_app_settings

tags = local.common_tags
}

resource "azurerm_linux_web_app" "web-app-service" {
Expand Down
4 changes: 4 additions & 0 deletions src/web/CareLeavers.Web/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@
},
"ApplicationInsights": {
"ConnectionString": ""
},
"Translation":{
"Method": "None",
"AzureApiKey": ""
}
}

0 comments on commit 40e99f1

Please sign in to comment.