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

Support for Management Groups in azurerm_policy_set_definition #2617

Closed
olohmann opened this issue Jan 8, 2019 · 2 comments · Fixed by #2618
Closed

Support for Management Groups in azurerm_policy_set_definition #2617

olohmann opened this issue Jan 8, 2019 · 2 comments · Fixed by #2618

Comments

@olohmann
Copy link
Contributor

olohmann commented Jan 8, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Support an attribute management_group_id at the azurerm_policy_set_definition, see REST reference https://docs.microsoft.com/en-us/rest/api/resources/policysetdefinitions/createorupdateatmanagementgroup.

New or Affected Resource(s)

  • azurerm_policy_set_definition

Potential Terraform Configuration

resource "azurerm_management_group" "test" {
	display_name = "test-mgmt-group"
}

resource "azurerm_policy_set_definition" "test" {
  name                = "test-policy-set-definition"
  policy_type         = "Custom"
  display_name        = "test policy set definition"
  management_group_id = "${azurerm_management_group.test.group_id}"

  parameters = <<PARAMETERS
    {
        "allowedLocations": {
            "type": "Array",
            "metadata": {
                "description": "The list of allowed locations for resources.",
                "displayName": "Allowed locations",
                "strongType": "location"
            }
        }
    }
PARAMETERS

  policy_definitions = <<POLICY_DEFINITIONS
    [
        {
            "parameters": {
                "listOfAllowedLocations": {
                    "value": "[parameters('allowedLocations')]"
                }
            },
            "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988"
        }
    ]
POLICY_DEFINITIONS
}

References

@katbyte
Copy link
Collaborator

katbyte commented Jan 8, 2019

tangentially related to #2490

@ghost
Copy link

ghost commented Mar 5, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants