This repository has been archived by the owner on Jun 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21f7bc8
commit f40fc72
Showing
10 changed files
with
425 additions
and
451 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 53 additions & 48 deletions
101
deployifnotexists-policy-with-initiative-and-assignment/main.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,79 @@ | ||
// DEPLOYMENT SCOPE | ||
targetScope = 'subscription' | ||
|
||
// PARAMETERS | ||
param resourceGroupName string = 'BicepExampleRG' | ||
param location string = 'australiaeast' | ||
param resourceGrouplocation string = 'australiaeast' | ||
param actionGroupName string = 'BicepExampleAG' | ||
|
||
// VARIABLES | ||
|
||
// OUTPUTS | ||
param actionGroupEnabled bool = true | ||
param actionGroupShortName string = 'bicepag' | ||
param actionGroupEmailName string = 'jloudon' | ||
param actionGroupEmail string = 'jesse.loudon@lab3.com.au' | ||
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 | ||
module rg './resourceGroup.bicep' = { | ||
scope: subscription() | ||
name: 'resourceGroup' | ||
params: { | ||
resourceGroupName: resourceGroupName | ||
location: location | ||
} | ||
resource rg 'Microsoft.Resources/resourceGroups@2020-06-01' = { | ||
name: resourceGroupName | ||
location: resourceGrouplocation | ||
} | ||
|
||
module ag './actionGroup.bicep' = { | ||
scope: resourceGroup(resourceGroupName) | ||
scope: rg | ||
name: 'actionGroup' | ||
params: { | ||
actionGroupName: actionGroupName | ||
actionGroupEnabled: true | ||
actionGroupShortName: 'azspgcln' | ||
actionGroupEmailName: 'jloudon' | ||
actionGroupEmail: 'jesse.loudon@lab3.com.au' | ||
actionGroupAlertSchema: true | ||
actionGroupName: actionGroupName | ||
actionGroupEnabled: actionGroupEnabled | ||
actionGroupShortName: actionGroupShortName | ||
actionGroupEmailName: actionGroupEmailName | ||
actionGroupEmail: actionGroupEmail | ||
actionGroupAlertSchema: actionGroupAlertSchema | ||
} | ||
dependsOn:[ | ||
rg | ||
] | ||
} | ||
|
||
module policy './policyDefinition.bicep' = { | ||
scope: subscription() | ||
name: 'policy' | ||
params: { | ||
actionGroupName: ag.outputs.actionGroupName | ||
actionGroupRG: resourceGroupName | ||
actionGroupId: ag.outputs.actionGroupId | ||
metricAlertResourceNamespace: 'Microsoft.Network/loadBalancers' | ||
metricAlertName: 'DipAvailability' | ||
metricAlertDimension1: 'ProtocolType' | ||
metricAlertDimension2: 'FrontendIPAddress' | ||
metricAlertDimension3: 'BackendIPAddress' | ||
metricAlertDescription: 'Average Load Balancer health probe status per time duration' | ||
metricAlertSeverity: '2' | ||
metricAlertEnabled: 'true' | ||
metricAlertEvaluationFrequency: 'PT15M' | ||
metricAlertWindowSize: 'PT1H' | ||
metricAlertSensitivity: 'Medium' | ||
metricAlertOperator: 'LessThan' | ||
metricAlertTimeAggregation: 'Average' | ||
metricAlertCriterionType: 'DynamicThresholdCriterion' | ||
metricAlertAutoMitigate: 'true' | ||
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' = { | ||
scope: subscription() | ||
name: 'assignment' | ||
params: { | ||
location: location | ||
bicepExampleInitiativeId: policy.outputs.bicepExampleInitiativeId | ||
bicepExampleInitiativeId: policy.outputs.bicepExampleInitiativeId | ||
assignmentIdentityLocation: resourceGrouplocation | ||
assignmentEnforcementMode: assignmentEnforcementMode | ||
} | ||
dependsOn: [ | ||
policy | ||
] | ||
} |
Oops, something went wrong.