-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
EnforceAutoShutdown.json
102 lines (102 loc) · 3.08 KB
/
EnforceAutoShutdown.json
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
{
"properties": {
"displayName": "Lab Services should enable all options for auto shutdown",
"description": "This policy provides helps with cost management by enforcing all automatic shutdown options are enabled for a lab.",
"mode": "Indexed",
"policyType": "BuiltIn",
"metadata": {
"version": "1.1.0",
"category": "Lab Services"
},
"version": "1.1.0",
"parameters": {
"effect": {
"type": "String",
"defaultValue": "Audit",
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
},
"excludeLabPlanId": {
"type": "String",
"metadata": {
"displayName": "Lab Plan Id to exclude",
"description": "Optionally enter the lab Plan Id to exclude for this policy assignment."
},
"defaultValue": ""
}
},
"policyRule": {
"if": {
"anyOf": [
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.LabServices/labs"
},
{
"field": "Microsoft.LabServices/labs/labPlanId",
"notEquals": "[parameters('excludeLabPlanId')]"
},
{
"anyOf": [
{
"field": "Microsoft.LabServices/labs/autoShutdownProfile.shutdownOnDisconnect",
"equals": "Disabled"
},
{
"field": "Microsoft.LabServices/labs/autoShutdownProfile.shutdownWhenNotConnected",
"equals": "Disabled"
},
{
"field": "Microsoft.LabServices/labs/autoShutdownProfile.shutdownOnIdle",
"equals": "None"
}
]
}
]
},
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.LabServices/labplans"
},
{
"anyOf": [
{
"field": "Microsoft.LabServices/labPlans/defaultAutoShutdownProfile.shutdownOnDisconnect",
"equals": "Disabled"
},
{
"field": "Microsoft.LabServices/labPlans/defaultAutoShutdownProfile.shutdownWhenNotConnected",
"equals": "Disabled"
},
{
"field": "Microsoft.LabServices/labPlans/defaultAutoShutdownProfile.shutdownOnIdle",
"equals": "None"
}
]
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.1.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/a6e9cf2d-7d76-440e-b795-8da246bd3aab",
"name": "a6e9cf2d-7d76-440e-b795-8da246bd3aab"
}