Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: casing in referenced policy definitions #1660

Closed
wants to merge 0 commits into from
Closed

Conversation

matt-FFFFFF
Copy link
Member

@matt-FFFFFF matt-FFFFFF commented Jun 5, 2024

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

  • Checked for duplicate Pull Requests
  • Associated it with relevant issues, for tracking and closure.
  • Ensured my code/branch is up-to-date with the latest changes in the main branch
  • Performed testing and provided evidence.
  • Ensured contribution guidance is followed.
  • Updated relevant and associated documentation.
  • Updated the "What's New?" wiki page (located: /docs/wiki/whats-new.md)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant