Skip to content

Commit fc4eded

Browse files
authored
PPHA-686: Adding Diagnostic settings into cae (#409)
# What is the change? Two changes here 1.) logs_destination is now "azure-monitor" which is needed to enable diagnostic settings on container app environment. 2.) Set what diagnotic logs to monitor. <!-- Describe the intended changes. --> # Why are we making this change? As part of the Pen Test improvements to make to the environment. <!-- Why is this change required? What problem does it solve? -->
2 parents 141f692 + e5f7ff2 commit fc4eded

4 files changed

Lines changed: 13 additions & 11 deletions

File tree

infrastructure/environments/live/variables.tfvars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ projects = {
2727
}
2828

2929
infra_key_vault_name = "kv-lungcs-live-inf"
30-
infra_key_vault_rg = "rg-hub-live-uks-bootstrap"
30+
infra_key_vault_rg = "rg-hub-live-uks-bootstrap"
3131

3232
diagnostic_settings = {
3333
metric_enabled = true

infrastructure/environments/nonlive/variables.tfvars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ projects = {
2525
}
2626

2727
infra_key_vault_name = "kv-lungcs-nonlive-inf"
28-
infra_key_vault_rg = "rg-hub-nonlive-uks-bootstrap"
28+
infra_key_vault_rg = "rg-hub-nonlive-uks-bootstrap"
2929

3030
diagnostic_settings = {
3131
metric_enabled = true

infrastructure/modules/container-apps/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ module "webapp" {
1111
azurerm.hub = azurerm.hub
1212
}
1313

14-
name = "${var.app_short_name}-web-${var.environment}"
15-
container_app_environment_id = var.container_app_environment_id
14+
name = "${var.app_short_name}-web-${var.environment}"
15+
container_app_environment_id = var.container_app_environment_id
1616

1717
# alerts
1818
action_group_id = var.action_group_id

infrastructure/modules/infra/main.tf

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@ module "container-app-environment" {
6262
azurerm.dns = azurerm.hub
6363
}
6464

65-
name = "cae-${var.environment}-uks-${var.app_short_name}"
66-
resource_group_name = azurerm_resource_group.main.name
67-
internal_load_balancer_enabled = var.features.private_networking
68-
log_analytics_workspace_id = module.log_analytics_workspace_audit.id
69-
vnet_integration_subnet_id = module.container_app_subnet.id
70-
private_dns_zone_rg_name = var.features.private_networking ? "rg-hub-${var.hub}-uks-private-dns-zones" : null
71-
zone_redundancy_enabled = var.cae_zone_redundancy_enabled
65+
name = "cae-${var.environment}-uks-${var.app_short_name}"
66+
resource_group_name = azurerm_resource_group.main.name
67+
internal_load_balancer_enabled = var.features.private_networking
68+
log_analytics_workspace_id = module.log_analytics_workspace_audit.id
69+
vnet_integration_subnet_id = module.container_app_subnet.id
70+
private_dns_zone_rg_name = var.features.private_networking ? "rg-hub-${var.hub}-uks-private-dns-zones" : null
71+
zone_redundancy_enabled = var.cae_zone_redundancy_enabled
72+
logs_destination = "azure-monitor"
73+
monitor_diagnostic_setting_cae_enabled_logs = ["ContainerAppConsoleLogs", "ContainerAppSystemLogs"]
7274
}
7375

7476
module "app_insights_audit" {

0 commit comments

Comments
 (0)