Giter Site home page Giter Site logo

Comments (6)

matt-FFFFFF avatar matt-FFFFFF commented on August 31, 2024

Can you replace the policy definition id in the assignment with the correct one?

from terraform-azurerm-caf-enterprise-scale.

praveenambati1233 avatar praveenambati1233 commented on August 31, 2024

It is as below
"policyDefinitionId": "${root_scope_resource_id}/providers/Microsoft.Authorization/policyDefinitions/Enforce-RG-Tags",

@matt-FFFFFF

from terraform-azurerm-caf-enterprise-scale.

matt-FFFFFF avatar matt-FFFFFF commented on August 31, 2024

So replace that with the correct resource id for the definition that you want to apply

from terraform-azurerm-caf-enterprise-scale.

praveenambati1233 avatar praveenambati1233 commented on August 31, 2024

Below is my project setup, I am not sure what exactly the resource id should be that policy assigns to all the custom landing zones ?

image

actually, it is able to create in all levels of the MGs but it is failing at the root MG , ideally, I don't want to create at root MG level.

Plan: 9 to add, 1 to change, 1 to destroy.
╷
│ Error: reading Policy Definition "Enforce-RG-Tags": 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 'Enforce-RG-Tags' could not be found."
│ 
│   with module.core.module.alz.data.azurerm_policy_definition.external_lookup["/providers/Microsoft.Management/managementGroups/ROOT/providers/Microsoft.Authorization/policyDefinitions/Enforce-RG-Tags"],
│   on .terraform/modules/core.alz/locals.policy_assignments.tf line 167, in data "azurerm_policy_definition" "external_lookup":
│  167: data "azurerm_policy_definition" "external_lookup" {

from terraform-azurerm-caf-enterprise-scale.

matt-FFFFFF avatar matt-FFFFFF commented on August 31, 2024

Hi,

Is there a common parent management group in which you can place the policy definition?

You'll need an archetype that just contains the definition.

Then you'll need another archetype that contains the assignment that references said definition.

from terraform-azurerm-caf-enterprise-scale.

praveenambati1233 avatar praveenambati1233 commented on August 31, 2024

I have refactored everything and post the issue at #998

from terraform-azurerm-caf-enterprise-scale.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.