-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.bicep
79 lines (74 loc) · 2.97 KB
/
main.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
targetScope = 'subscription'
// PARAMETERS
param resourceGroupName string = 'BicepExampleRG'
param resourceGrouplocation string = 'australiaeast'
param actionGroupName string = 'BicepExampleAG'
param actionGroupEnabled bool = true
param actionGroupShortName string = 'bicepag'
param actionGroupEmailName string = 'jloudon'
param actionGroupEmail string = '[email protected]'
param actionGroupAlertSchema bool = true
param metricAlertResourceNamespace string = 'Microsoft.Network/loadBalancers'
param metricAlertName string = 'DipAvailability'
param metricAlertDimension1 string = 'ProtocolType'
param metricAlertDimension2 string = 'FrontendIPAddress'
param metricAlertDimension3 string = 'BackendIPAddress'
param metricAlertDescription string = 'Average Load Balancer health probe status per time duration'
param metricAlertSeverity string = '2'
param metricAlertEnabled string = 'true'
param metricAlertEvaluationFrequency string = 'PT15M'
param metricAlertWindowSize string = 'PT1H'
param metricAlertSensitivity string = 'Medium'
param metricAlertOperator string = 'LessThan'
param metricAlertTimeAggregation string = 'Average'
param metricAlertCriterionType string = 'DynamicThresholdCriterion'
param metricAlertAutoMitigate string = 'true'
param assignmentEnforcementMode string = 'Default'
// RESOURCES
resource rg 'Microsoft.Resources/resourceGroups@2020-06-01' = {
name: resourceGroupName
location: resourceGrouplocation
}
module ag './actionGroup.bicep' = {
scope: rg
name: 'actionGroup'
params: {
actionGroupName: actionGroupName
actionGroupEnabled: actionGroupEnabled
actionGroupShortName: actionGroupShortName
actionGroupEmailName: actionGroupEmailName
actionGroupEmail: actionGroupEmail
actionGroupAlertSchema: actionGroupAlertSchema
}
}
module policy './policyDefinition.bicep' = {
name: 'policy'
params: {
actionGroupName: ag.outputs.actionGroupName
actionGroupRG: resourceGroupName
actionGroupId: ag.outputs.actionGroupId
metricAlertResourceNamespace: metricAlertResourceNamespace
metricAlertName: metricAlertName
metricAlertDimension1: metricAlertDimension1
metricAlertDimension2: metricAlertDimension2
metricAlertDimension3: metricAlertDimension3
metricAlertDescription: metricAlertDescription
metricAlertSeverity: metricAlertSeverity
metricAlertEnabled: metricAlertEnabled
metricAlertEvaluationFrequency: metricAlertEvaluationFrequency
metricAlertWindowSize: metricAlertWindowSize
metricAlertSensitivity: metricAlertSensitivity
metricAlertOperator: metricAlertOperator
metricAlertTimeAggregation: metricAlertTimeAggregation
metricAlertCriterionType: metricAlertCriterionType
metricAlertAutoMitigate: metricAlertAutoMitigate
}
}
module assignment './policyAssignment.bicep' = {
name: 'assignment'
params: {
bicepExampleInitiativeId: policy.outputs.bicepExampleInitiativeId
assignmentIdentityLocation: resourceGrouplocation
assignmentEnforcementMode: assignmentEnforcementMode
}
}