Skip to content

Commit 09bffa5

Browse files
feat: add Application Insights and Azure Monitor Private Link Scope integration
- Add Application Insights module for web application monitoring - Configure private link scoped services for Log Analytics Workspace - Configure private link scoped services for Application Insights - Integrate monitoring services with hub-based private endpoint architecture - Enable secure monitoring data flow through Azure Monitor Private Link Scope (AMPLS)
1 parent 24085ea commit 09bffa5

File tree

4 files changed

+45
-8
lines changed

4 files changed

+45
-8
lines changed

infrastructure/modules/container-apps/jobs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,5 @@ module "scheduled_jobs" {
136136
module.queue_storage_role_assignment
137137
]
138138

139-
cron_expression = each.value.cron_expression
139+
cron_expression = each.value.cron_expression
140140
}

infrastructure/modules/container-apps/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ module "webapp" {
1717
azurerm = azurerm
1818
azurerm.hub = azurerm.hub
1919
}
20-
source = "../dtos-devops-templates/infrastructure/modules/container-app"
21-
name = "${var.app_short_name}-web-${var.environment}"
22-
container_app_environment_id = var.container_app_environment_id
20+
source = "../dtos-devops-templates/infrastructure/modules/container-app"
21+
name = "${var.app_short_name}-web-${var.environment}"
22+
container_app_environment_id = var.container_app_environment_id
2323

2424
# alerts
2525
action_group_id = var.action_group_id

infrastructure/modules/container-apps/postgres.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ module "database_container" {
9999
}
100100

101101
# alerts
102-
action_group_id = var.action_group_id
103-
enable_alerting = var.enable_alerting
104-
alert_memory_threshold = 60
105-
alert_cpu_threshold = 90
102+
action_group_id = var.action_group_id
103+
enable_alerting = var.enable_alerting
104+
alert_memory_threshold = 60
105+
alert_cpu_threshold = 90
106106

107107
resource_group_name = azurerm_resource_group.main.name
108108
is_tcp_app = true

infrastructure/modules/infra/main.tf

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,40 @@ module "container-app-environment" {
6767
vnet_integration_subnet_id = module.container_app_subnet.id
6868
private_dns_zone_rg_name = "rg-hub-${var.hub}-uks-private-dns-zones"
6969
}
70+
71+
module "app_insights_audit" {
72+
source = "../dtos-devops-templates/infrastructure/modules/app-insights"
73+
74+
name = module.shared_config.names.app-insights
75+
location = var.region
76+
resource_group_name = azurerm_resource_group.main.name
77+
appinsights_type = "web"
78+
79+
log_analytics_workspace_id = module.log_analytics_workspace_audit.id
80+
}
81+
82+
module "private_link_scoped_service_law" {
83+
source = "../dtos-devops-templates/infrastructure/modules/private-link-scoped-service"
84+
85+
providers = {
86+
azurerm = azurerm.hub
87+
}
88+
89+
name = "pls-${var.app_short_name}-${var.environment}-law"
90+
resource_group_name = "rg-hub-${var.hub}-uks-hub-private-endpoints"
91+
linked_resource_id = module.log_analytics_workspace_audit.id
92+
scope_name = "ampls-${var.hub}hub"
93+
}
94+
95+
module "private_link_scoped_service_app_insights" {
96+
source = "../dtos-devops-templates/infrastructure/modules/private-link-scoped-service"
97+
98+
providers = {
99+
azurerm = azurerm.hub
100+
}
101+
102+
name = "pls-${var.app_short_name}-${var.environment}-appinsights"
103+
resource_group_name = "rg-hub-${var.hub}-uks-hub-private-endpoints"
104+
linked_resource_id = module.app_insights_audit.id
105+
scope_name = "ampls-${var.hub}hub"
106+
}

0 commit comments

Comments
 (0)