You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/governance/policy/assign-policy-terraform.md
+38-40Lines changed: 38 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,57 +37,55 @@ for Azure Policy use the
37
37
38
38
1. Create a new folder named `policy-assignment` and change directories into it.
39
39
40
-
1. Create `main.tf` with the following code:
40
+
2. Create `main.tf` with the following code:
41
41
42
-
> [!NOTE]
43
-
> To create a Policy Assignment at a Management Group use the [azurerm_management_group_policy_assignment](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/management_group_policy_assignment) resource, for a Resource Group use the [azurerm_resource_group_policy_assignment](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group_policy_assignment) and for a Subscription use the [azurerm_subscription_policy_assignment](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subscription_policy_assignment) resource.
42
+
> [!NOTE]
43
+
> To create a Policy Assignment at a Management Group use the [azurerm_management_group_policy_assignment](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/management_group_policy_assignment) resource, for a Resource Group use the [azurerm_resource_group_policy_assignment](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group_policy_assignment) and for a Subscription use the [azurerm_subscription_policy_assignment](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subscription_policy_assignment) resource.
description = "Shows all virtual machines not using managed disks"
65
-
display_name = "Audit VMs without managed disks assignment"
66
-
}
67
-
```
68
-
1. Create `variables.tf` with the following code:
69
-
70
-
```terraform
71
-
variable "cust_scope" {
72
-
default = "{scope}"
73
-
}
74
-
```
75
-
76
-
A scope determines what resources or grouping of resources the policy assignment gets enforced
77
-
on. It could range from a management group to an individual resource. Be sure to replace
78
-
`{scope}` with one of the following patterns based on the declared resource:
76
+
A scope determines what resources or grouping of resources the policy assignment gets enforced on. It could range from a management group to an individual resource. Be sure to replace `{scope}` with one of the following patterns based on the declared resource:
0 commit comments