Use this data source to access information about a Policy Definition, both custom and built in. Retrieves Policy Definitions from your current subscription by default.
data "azurerm_policy_definition" "example" {
display_name = "Allowed resource types"
}
output "id" {
value = data.azurerm_policy_definition.example.id
}
name
- Specifies the name of the Policy Definition. Conflicts with display_name
.
display_name
- Specifies the display name of the Policy Definition. Conflicts with name
.
management_group_name
- (Optional) Only retrieve Policy Definitions from this Management Group.id
- The ID of the Policy Definition.
type
- The Type of Policy.
description
- The Description of the Policy.
policy_type
- The Type of the Policy. Possible values are BuiltIn
, Custom
and NotSpecified
.
policy_rule
- The Rule as defined (in JSON) in the Policy.
role_definition_ids
- A list of role definition id extracted from policy_rule
required for remediation.
parameters
- Any Parameters defined in the Policy.
metadata
- Any Metadata defined in the Policy.
mode
- The Mode of the Policy.
The timeouts
block allows you to specify timeouts for certain actions:
read
- (Defaults to 5 minutes) Used when retrieving the Policy Definition.