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

New Data Source for built in policies #2757

Closed
lawrenae opened this issue Jan 24, 2019 · 1 comment
Closed

New Data Source for built in policies #2757

lawrenae opened this issue Jan 24, 2019 · 1 comment

Comments

@lawrenae
Copy link
Contributor

lawrenae commented Jan 24, 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

Azure comes with a variety of built-in policies both at the subscription and management group levels (at least according to the APIs: https://docs.microsoft.com/en-us/rest/api/resources/policydefinitions/listbuiltin and
https://docs.microsoft.com/en-us/rest/api/resources/policydefinitions/listbymanagementgroup)

I'd like to see something similar to https://www.terraform.io/docs/providers/azurerm/d/builtin_role_definition.html but for policies

New or Affected Resource(s)

Something along the lines of a datasource called azurerm_builtin_policy_definition

Potential Terraform Configuration

# default to subscription
data "azurerm_builtin_policy_definition" "allowed_resource_types" {
  name = "Allowed resource types"
}

output "policy_id" {
   value = "${data.azurerm_builtin_policy_definition.allowed_resource_types.id}"
}

# for management groups
data "azurerm_builtin_policy_definition" "allowed_resource_types" {
  name = "Allowed resource types"
  management_group_id = "${data.azurerm_management_group.tenant_root_group.group_id}"
}

output "policy_id" {
   value = "${data.azurerm_builtin_policy_definition.allowed_resource_types.id}"
}
@ghost
Copy link

ghost commented Mar 30, 2020

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 👉 [email protected]. Thanks!

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

No branches or pull requests

2 participants