Azure / Enterprise-Scale

The Azure Landing Zones (Enterprise-Scale) architecture provides prescriptive guidance coupled with Azure best practices, and it follows design principles across the critical design areas for organizations to define their Azure architecture
https://aka.ms/alz
MIT License
1.73k stars 978 forks source link

fix: casing in referenced policy definitions #1660

Closed matt-FFFFFF closed 5 months ago

matt-FFFFFF commented 5 months ago

Overview/Summary

Terraform is case sensitive and it couldn't find the following referenced definitions because of casing errors. I have updated the reference to use the correct definition name, not visa-versa.

│ Error: reading Policy Definition "Deny-Subnet-Without-UDR": policy.DefinitionsClient#GetAtManagementGroup: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="PolicyDefinitionNotFound" Message="The policy definition 'Deny-Subnet-Without-UDR' could not be found."
│ 
│   with module.test_core.data.azurerm_policy_definition.external_lookup["/providers/Microsoft.Management/managementGroups/12345/providers/Microsoft.Authorization/policyDefinitions/Deny-Subnet-Without-UDR"],
│   on ../../../locals.policy_assignments.tf line 167, in data "azurerm_policy_definition" "external_lookup":
│  167: data "azurerm_policy_definition" "external_lookup" {
│ 
╵
╷
│ Error: reading Policy Definition "Deny-EH-MINTLS": policy.DefinitionsClient#GetAtManagementGroup: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="PolicyDefinitionNotFound" Message="The policy definition 'Deny-EH-MINTLS' could not be found."
│ 
│   with module.test_core.data.azurerm_policy_definition.external_lookup["/providers/Microsoft.Management/managementGroups/12345/providers/Microsoft.Authorization/policyDefinitions/Deny-EH-MINTLS"],
│   on ../../../locals.policy_assignments.tf line 167, in data "azurerm_policy_definition" "external_lookup":
│  167: data "azurerm_policy_definition" "external_lookup" {
│ 
╵
╷
│ Error: reading Policy Definition "Deny-Storage-Sftp": policy.DefinitionsClient#GetAtManagementGroup: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="PolicyDefinitionNotFound" Message="The policy definition 'Deny-Storage-Sftp' could not be found."
│ 
│   with module.test_core.data.azurerm_policy_definition.external_lookup["/providers/Microsoft.Management/managementGroups/12345/providers/Microsoft.Authorization/policyDefinitions/Deny-Storage-Sftp"],
│   on ../../../locals.policy_assignments.tf line 167, in data "azurerm_policy_definition" "external_lookup":
│  167: data "azurerm_policy_definition" "external_lookup" {
│ 

Breaking Changes

  1. Replace me
  2. Replace me

Testing Evidence

Please provide any testing evidence to show that your Pull Request works/fixes as described and planned (include screenshots, if appropriate).

Testing URLs

The below URLs can be updated where the placeholders are, look for {YOUR GITHUB BRANCH NAME HERE - Remove Curly Brackets Also} & {YOUR GITHUB BRANCH NAME HERE - Remove Curly Brackets Also}, to allow you to test your portal deployment experience.

Please also replace the curly brackets on the placeholders {}

Azure Public

[Deploy To Azure](https://portal.azure.com/#blade/Microsoft_Azure_CreateUIDef/CustomDeploymentBlade/uri/https%3A%2F%2Fraw.githubusercontent.com%2F{YOUR GITHUB ORG/ACCOUNT HERE - Remove Curly Brackets Also}%2FEnterprise-Scale%2F{YOUR GITHUB BRANCH NAME HERE - Remove Curly Brackets Also}%2FeslzArm%2FeslzArm.json/uiFormDefinitionUri/https%3A%2F%2Fraw.githubusercontent.com%2F{YOUR GITHUB ORG/ACCOUNT HERE - Remove Curly Brackets Also}%2FEnterprise-Scale%2F{YOUR GITHUB BRANCH NAME HERE - Remove Curly Brackets Also}%2FeslzArm%2Feslz-portal.json)

Azure US Gov (Fairfax)

[Deploy To Azure](https://portal.azure.us/#blade/Microsoft_Azure_CreateUIDef/CustomDeploymentBlade/uri/https%3A%2F%2Fraw.githubusercontent.com%2F{YOUR GITHUB ORG/ACCOUNT HERE - Remove Curly Brackets Also}%2FEnterprise-Scale%2F{YOUR GITHUB BRANCH NAME HERE - Remove Curly Brackets Also}%2FeslzArm%2FeslzArm.json/uiFormDefinitionUri/https%3A%2F%2Fraw.githubusercontent.com%2F{YOUR GITHUB ORG/ACCOUNT HERE - Remove Curly Brackets Also}%2FEnterprise-Scale%2F{YOUR GITHUB BRANCH NAME HERE - Remove Curly Brackets Also}%2FeslzArm%2Ffairfaxeslz-portal.json)

As part of this Pull Request I have