-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathampls.bicep
87 lines (75 loc) · 1.82 KB
/
ampls.bicep
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//This bicep deploys the AMPLS.
//Scope
targetScope = 'resourceGroup'
//Variables
//Parameters
param location string
param snetmainid string
param amplsid string
param vnetid string
param zones array = [
'agentsvc.azure-automation.net'
'monitor.azure.com'
'ods.opinsights.azure.com'
'oms.opinsights.azure.com'
]
//Resources
//This deploys the Azure Monitor Private Endpoint.
resource amplsscopeprivatendpoint 'Microsoft.Network/privateEndpoints@2023-04-01' = {
name: 'pe-ampls'
location: location
properties: {
subnet: {
id: snetmainid
}
privateLinkServiceConnections: [
{
name: 'psc-ampls'
properties: {
privateLinkServiceId: amplsid
groupIds: [
'azuremonitor'
]
}
}
]
}
dependsOn: [
privatednszoneforampls
privatednszonelink
]
}
// Create Private DNS Zone for "pe-ampls"
resource privatednszoneforampls 'Microsoft.Network/privateDnsZones@2024-06-01' = [for zone in zones: {
name: 'privatelink.${zone}'
location: 'global'
properties: {
}
}]
//This deploys the DNS Zone Link.
resource privatednszonelink 'Microsoft.Network/privateDnsZones/virtualNetworkLinks@2024-06-01' = [for (zone,i) in zones: {
parent: privatednszoneforampls[i]
name: '${zone}-link'
location: 'global'
properties: {
registrationEnabled: false
virtualNetwork: {
id: vnetid
}
}
}]
// Create Private DNS Zone Group.
resource pednsgroupforampls 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups@2023-06-01' = {
parent: amplsscopeprivatendpoint
name: 'pvtendpointdnsgroupforampls'
properties: {
privateDnsZoneConfigs: [
for (zone,i) in zones: {
name: privatednszoneforampls[i].name
properties: {
privateDnsZoneId: privatednszoneforampls[i].id
}
}
]
}
}