-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaca-replica-count.json
64 lines (64 loc) · 1.81 KB
/
aca-replica-count.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
{
"properties": {
"displayName": "Azure Container Apps container replica count limits",
"policyType": "Custom",
"mode": "Indexed",
"description": "This policy enforces limits for the minimum and maximum number of replicas for Azure Container Apps.",
"metadata": {
"version": "1.0.0",
"category": "Azure Container Apps"
},
"parameters": {
"minReplicas": {
"type": "integer",
"metadata": {
"displayName": "Min allowed replicas",
"description": "Specifies the minimum number of container replicas for the Azure Container App"
},
"defaultValue": 0
},
"maxReplicas": {
"type": "integer",
"metadata": {
"displayName": "Max allowed replicas",
"description": "Specifies the maximum number of container replicas for the Azure Container App"
},
"defaultValue": 30
},
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [{
"field": "type",
"equals": "Microsoft.App/containerApps"
},
{
"anyOf": [{
"field": "Microsoft.App/containerApps/template.scale.minReplicas",
"less": "[parameters('MinReplicas')]"
}, {
"field": "Microsoft.App/containerApps/template.scale.maxReplicas",
"greater": "[parameters('MaxReplicas')]"
}]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
}
}