-
Notifications
You must be signed in to change notification settings - Fork 990
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Policy/Assignment: Resource Group and Resource locations should m…
…atch (#1507) Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
bf3f093
commit 317081f
Showing
8 changed files
with
92 additions
and
6 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
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
Binary file not shown.
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
54 changes: 54 additions & 0 deletions
54
.../managementGroupTemplates/policyAssignments/AUDIT-ResourceRGLocationPolicyAssignment.json
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-08-01/managementGroupDeploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"enforcementMode": { | ||
"type": "string", | ||
"allowedValues": [ | ||
"Default", | ||
"DoNotEnforce" | ||
], | ||
"defaultValue": "Default" | ||
}, | ||
"nonComplianceMessagePlaceholder": { | ||
"type": "string", | ||
"defaultValue": "{enforcementMode}" | ||
} | ||
}, | ||
"variables": { | ||
"policyDefinitions": { | ||
"auditRGL": "/providers/Microsoft.Authorization/policyDefinitions/0a914e76-4921-4c19-b460-a2d36003525a" | ||
}, | ||
"policyAssignmentNames": { | ||
"auditRGL": "Audit-ResourceRGLocation", | ||
"description": "Resource Group and Resource locations should match.", | ||
"displayName": "Resource Group and Resource locations should match" | ||
}, | ||
"nonComplianceMessage": { | ||
"message": "Resources {enforcementMode} be deployed in the same region as the Resource Group.", | ||
"Default": "must", | ||
"DoNotEnforce": "should" | ||
} | ||
}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Authorization/policyAssignments", | ||
"apiVersion": "2022-06-01", | ||
"name": "[variables('policyAssignmentNames').auditRGL]", | ||
"properties": { | ||
"description": "[variables('policyAssignmentNames').description]", | ||
"displayName": "[variables('policyAssignmentNames').displayName]", | ||
"policyDefinitionId": "[variables('policyDefinitions').auditRGL]", | ||
"enforcementMode": "[parameters('enforcementMode')]", | ||
"nonComplianceMessages": [ | ||
{ | ||
"message": "[replace(variables('nonComplianceMessage').message, parameters('nonComplianceMessagePlaceholder'), variables('nonComplianceMessage')[parameters('enforcementMode')])]" | ||
} | ||
], | ||
"parameters": { | ||
} | ||
} | ||
} | ||
], | ||
"outputs": {} | ||
} |
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