generated from Azure/terraform-azurerm-avm-template
-
Notifications
You must be signed in to change notification settings - Fork 15
/
main.privatelinkscope.tf
49 lines (43 loc) · 1.63 KB
/
main.privatelinkscope.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
39
40
41
42
43
44
45
46
47
48
resource "azapi_resource" "amplscope" {
for_each = var.monitor_private_link_scope
type = "microsoft.insights/privateLinkScopes@2021-07-01-preview"
body = {
properties = {
accessModeSettings = {
exclusions = [
{
ingestionAccessMode = "PrivateOnly"
privateEndpointConnectionName = "azurerm_private_endpoint.this.private_service_connection.name"
queryAccessMode = "PrivateOnly"
}
]
ingestionAccessMode = "PrivateOnly"
queryAccessMode = "PrivateOnly"
}
}
}
location = "global"
name = each.value.name != null ? each.value.name : "law_pl_scope"
parent_id = each.value.resource_id
schema_validation_enabled = false
tags = var.tags
}
resource "azurerm_monitor_private_link_scoped_service" "this" {
for_each = var.monitor_private_link_scope
linked_resource_id = azurerm_log_analytics_workspace.this.id
name = var.monitor_private_link_scoped_service_name
resource_group_name = var.resource_group_name
scope_name = azapi_resource.amplscope[each.key].name
}
resource "azapi_resource" "ampls" {
for_each = var.monitor_private_link_scoped_resource
type = "Microsoft.Insights/privateLinkScopes/scopedResources@2021-07-01-preview"
body = {
properties = {
linkedResourceId = azurerm_log_analytics_workspace.this.id
}
}
ignore_casing = true
name = each.value.name != null ? each.value.name : azurerm_log_analytics_workspace.this.name
parent_id = each.value.resource_id
}