-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi_server.tf
38 lines (32 loc) · 1.17 KB
/
api_server.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
resource "azurerm_service_plan" "api_server_service_plan" {
name = "${local.resource_prefix}-api-server-serviceplan"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
os_type = "Linux"
sku_name = var.api_app_service_sku
}
resource "azurerm_linux_web_app" "api_server_web_app" {
name = "${local.resource_prefix}-api-server-web-app"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_service_plan.api_server_service_plan.location
service_plan_id = azurerm_service_plan.api_server_service_plan.id
site_config {
application_stack {
dotnet_version = "8.0"
}
always_on = var.api_always_on
}
connection_string {
name = "PocketDDDContext"
type = "SQLAzure"
value = local.db_connection_string
}
app_settings = {
"AdminKey" = random_password.admin_api_key.result
}
}
resource "azurerm_key_vault_secret" "api_admin_key" {
name = "${local.resource_prefix}-admin-api-key"
value = random_password.admin_api_key.result
key_vault_id = azurerm_key_vault.key_vault.id
}