Hi,
I’m going round in circles with this one.
I have an azurerm_policy_set_definition which accepts a boolean parameter.
"bringYourOwnUserAssignedManagedIdentity": {
"type": "Boolean",
"metadata": {
"displayName": "Bring Your Own User-Assigned Identity",
"description": "Enable this to use your pre-created user-assigned managed identity. The pre-created identity MUST exist within the subscription otherwise the policy deployment will fail. If enabled, ensure that the User-Assigned Identity Name and Identity Resource Group Name parameters match the pre-created identity. If not enabled, the policy will create per subscription, per resource user-assigned managed identities in a new resource group named 'Built-In-Identity-RG'."
},
"allowedValues": [
true,
false
]
}
I then have a policy_definition block which references the parameter above
parameter_values = <<VALUE
{
"bringYourOwnUserAssignedManagedIdentity": {
"value": parameters('bringYourOwnUserAssignedManagedIdentity')
},
...
If I reference it as above then I get an error in the plan saying
“policy_definition_reference.0.parameter_values” contains an invalid JSON: invalid character ‘p’ looking for beginning of value"
If I change the reference to this
parameter_values = <<VALUE
{
"bringYourOwnUserAssignedManagedIdentity": {
"value": "parameters('bringYourOwnUserAssignedManagedIdentity')"
},
Then my plan complains that the parameter is a bool not a string i.e it recieves “true” not true
I’ve looked everywhere and I can’t find any examples of how to pass a bool parameter correctly.
Any help much appreciated.
Phill