-
Notifications
You must be signed in to change notification settings - Fork 5
/
policy.bicep
154 lines (145 loc) · 3.64 KB
/
policy.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
//Scope
targetScope = 'managementGroup'
//Variables
//Parameters
param loganalyticsregion string
param azmanagedidentity string
param mgmtresourcegroup string
param muasminame string
param commondcrid string
param linuxdcrid string
param vmiid string
//Resources
//Azure Policy Assignments (built-in)
resource Policy1 'Microsoft.Authorization/policyAssignments@2023-04-01' = {
name: 'AMA_Windows'
location: loganalyticsregion
identity: {
type: 'UserAssigned'
userAssignedIdentities: {
'${azmanagedidentity}': {}
}
}
properties: {
displayName: 'AMA_Windows'
parameters: {
bringYourOwnUserAssignedManagedIdentity:{
value: true
}
userAssignedManagedIdentityName:{
value: muasminame
}
userAssignedManagedIdentityResourceGroup:{
value: mgmtresourcegroup
}
scopeToSupportedImages:{
value: true
}
}
policyDefinitionId: '/providers/Microsoft.Authorization/policyDefinitions/637125fd-7c39-4b94-bb0a-d331faf333a9'
}
}
resource Policy2 'Microsoft.Authorization/policyAssignments@2023-04-01' = {
name: 'AMA_Linux'
location: loganalyticsregion
identity: {
type: 'UserAssigned'
userAssignedIdentities: {
'${azmanagedidentity}': {}
}
}
properties: {
displayName: 'AMA_Linux'
parameters: {
bringYourOwnUserAssignedManagedIdentity:{
value: true
}
userAssignedManagedIdentityName:{
value: muasminame
}
userAssignedManagedIdentityResourceGroup:{
value: mgmtresourcegroup
}
scopeToSupportedImages:{
value: true
}
}
policyDefinitionId: '/providers/Microsoft.Authorization/policyDefinitions/ae8a10e6-19d6-44a3-a02d-a2bdfc707742'
}
}
resource Policy3 'Microsoft.Authorization/policyAssignments@2023-04-01' = {
name: 'DCR_Windows'
location: loganalyticsregion
identity: {
type: 'UserAssigned'
userAssignedIdentities: {
'${azmanagedidentity}': {}
}
}
properties: {
displayName: 'DCR_Windows'
parameters: {
dcrResourceId:{
value: commondcrid
}
}
policyDefinitionId: '/providers/Microsoft.Authorization/policyDefinitions/244efd75-0d92-453c-b9a3-7d73ca36ed52'
}
}
resource Policy4 'Microsoft.Authorization/policyAssignments@2023-04-01' = {
name: 'DCR_Linux'
location: loganalyticsregion
identity: {
type: 'UserAssigned'
userAssignedIdentities: {
'${azmanagedidentity}': {}
}
}
properties: {
displayName: 'DCR_Linux'
parameters: {
dcrResourceId:{
value: linuxdcrid
}
}
policyDefinitionId: '/providers/Microsoft.Authorization/policyDefinitions/58e891b9-ce13-4ac3-86e4-ac3e1f20cb07'
}
}
resource Policy5 'Microsoft.Authorization/policyAssignments@2023-04-01' = {
name: 'VMI_DCR_Linux'
location: loganalyticsregion
identity: {
type: 'UserAssigned'
userAssignedIdentities: {
'${azmanagedidentity}': {}
}
}
properties: {
displayName: 'VMI_DCR_Linux'
parameters: {
dcrResourceId:{
value: vmiid
}
}
policyDefinitionId: '/providers/Microsoft.Authorization/policyDefinitions/58e891b9-ce13-4ac3-86e4-ac3e1f20cb07'
}
}
resource Policy6 'Microsoft.Authorization/policyAssignments@2023-04-01' = {
name: 'VMI_DCR_Windows'
location: loganalyticsregion
identity: {
type: 'UserAssigned'
userAssignedIdentities: {
'${azmanagedidentity}': {}
}
}
properties: {
displayName: 'VMI_DCR_Windows'
parameters: {
dcrResourceId:{
value: vmiid
}
}
policyDefinitionId: '/providers/Microsoft.Authorization/policyDefinitions/244efd75-0d92-453c-b9a3-7d73ca36ed52'
}
}