This is my terraform file. When i try to create it with terrafrom i am getting below error. but I can create it manually. Also this is a free resource i should be able to create it.
I am trying to create this Azure+terraform playground.
MessageResource ‘faslanahmadfaz’ was disallowed by policy. Policy identifiers: ‘[{“policyAssignment”:{“name”:“Azure_playground_TF_main-4ffb1a085fb94c09”,“id”:“/subscriptions/a2b28c85-1948-4263-90ca-bade2bac4df4/resourceGroups/kml_rg_main-4ffb1a085fb94c09/providers/Microsoft.Authorization/policyAssignments/Azure_playground_TF_main-4ffb1a085fb94c09”},“policyDefinition”:{“name”:“core_policy_main-4ffb1a085fb94c09”,“id”:“/subscriptions/a2b28c85-1948-4263-90ca-bade2bac4df4/providers/Microsoft.Authorization/policyDefinitions/core_policy_main-4ffb1a085fb94c09”},“policySetDefinition”:{“name”:“Azure_playground_TF_main-4ffb1a085fb94c09”,“id”:“/subscriptions/a2b28c85-1948-4263-90ca-bade2bac4df4/providers/Microsoft.Authorization/policySetDefinitions/Azure_playground_TF_main-4ffb1a085fb94c09”}}]’.
It would be helpful if you save your terraform code in a code block
type or paste code here
This will:
1. Preserve indentation
2. Prevent corrupting your code via changing quotes into "smart quotes"
Use the </> key to create a new block
The resource “faslanahmadfaz” which you are trying to create using terrafrom with resource azurerm_service_plan is denied by some policy applied in azuree playground.
The policy name is “Azure_playground_TF_main-4ffb1a085fb94c09” . This is the policy definition id “/subscriptions/a2b28c85-1948-4263-90ca-bade2bac4df4/providers/Microsoft.Authorization/policyDefinitions/core_policy_main-4ffb1a085fb94c09”
I do not have access to play grounds. you might need to have a look at the policy or any restrictions on the resource type on play grounds.
I guess this policy error shared is in complete ideally it should throw you why it failed as well
I tried it; TBH, I don’t know if this is a resource type you should have access to or not. I’ve tried it in the playground, and get a similar access error on terraform apply. I’ve asked our engineers what they think .