{
    "properties": {
        "displayName": "Resources of type X should have tag",
        "policyType": "Custom",
        "mode": "All",
        "metadata": {
            "category": "Effectory Custom Policies"
        },
        "parameters": {
            "tagName": {
                "type": "String",
                "metadata": {
                    "displayName": "tagName",
                    "description": "Tag name"
                }
            },
            "allowedTags": {
                "type": "Array",
                "metadata": {
                    "displayName": "Allowed tags",
                    "description": "The list of allowed tags for resources."
                }
            },
            "listOfResourceTypesAllowed": {
                "type": "Array",
                "metadata": {
                    "description": "The list of resource types to apply this policy to.",
                    "displayName": "Allowed resource types",
                    "strongType": "resourceTypes"
                }
            }
        },
        "policyRule": {
            "if": {
                "allOf": [
                    {
                        "field": "type",
                        "in": "[parameters('listOfResourceTypesAllowed')]"
                    },
                    {
                        "not": {
                            "field": "[concat('tags[', parameters('tagName'), ']')]",
                            "in": "[parameters('allowedTags')]"
                        }
                    }
                ]
            },
            "then": {
                "effect": "audit"
            }
        }
    }
}