-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcae.tf
More file actions
69 lines (57 loc) · 1.75 KB
/
Copy pathcae.tf
File metadata and controls
69 lines (57 loc) · 1.75 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
locals {
zonal = var.region == "canadaeast" || var.region == "northcentralus" ? false : true
}
resource "azapi_resource" "azurerm_container_app_environment" {
depends_on = [
azapi_update_resource.nodes_delegation
]
type = "Microsoft.App/managedEnvironments@2023-05-01"
name = local.aca_name
location = azurerm_resource_group.this["aca"].location
parent_id = azurerm_resource_group.this["aca"].id
body = {
properties = {
appLogsConfiguration = {
destination = "azure-monitor"
}
daprAIConnectionString = azurerm_application_insights.this.connection_string
infrastructureResourceGroup = "${local.resource_name}_aca_nodes_rg"
zoneRedundant = local.zonal
vnetConfiguration = {
infrastructureSubnetId = azurerm_subnet.nodes.id
internal = true
}
peerAuthentication = {
mtls = {
enabled = true
}
}
workloadProfiles = [
{
workloadProfileType = local.workload_profile_name
name = local.workload_profile_name
}]
}
}
}
data "azurerm_container_app_environment" "this" {
depends_on = [
azapi_resource.azurerm_container_app_environment
]
name = local.aca_name
resource_group_name = azurerm_resource_group.this["aca"].name
}
resource "azurerm_monitor_diagnostic_setting" "cae" {
name = "diag"
target_resource_id = azapi_resource.azurerm_container_app_environment.id
log_analytics_workspace_id = azurerm_log_analytics_workspace.this.id
enabled_log {
category_group = "audit"
}
enabled_log {
category_group = "allLogs"
}
metric {
category = "AllMetrics"
}
}