Open praneetloke opened 2 years ago
I have policies created using Azure Policy. I'd like to convert them to Pulumi policies by importing them.
That would be really cool to reuse existing policy definitions and import them as cross guards.
Hello!
Issue details
I have policies created using Azure Policy. I'd like to convert them to Pulumi policies by importing them.
Expand to see an example of a policy definition
```json { "properties": { "displayName": "Vulnerability Assessment settings for SQL server should contain an email address to receive scan reports", "policyType": "BuiltIn", "mode": "Indexed", "description": "Ensure that an email address is provided for the 'Send scan reports to' field in the Vulnerability Assessment settings. This email address receives scan result summary after a periodic scan runs on SQL servers.", "metadata": { "version": "2.0.0", "category": "SQL" }, "parameters": { "effect": { "type": "String", "metadata": { "displayName": "Effect", "description": "Enable or disable the execution of the policy" }, "allowedValues": [ "AuditIfNotExists", "Disabled" ], "defaultValue": "AuditIfNotExists" } }, "policyRule": { "if": { "field": "type", "equals": "Microsoft.Sql/servers" }, "then": { "effect": "[parameters('effect')]", "details": { "type": "Microsoft.Sql/servers/vulnerabilityAssessments", "name": "default", "existenceCondition": { "allOf": [ { "field": "Microsoft.Sql/servers/vulnerabilityAssessments/default.recurringScans.emails[*]", "notEquals": "" }, { "count": { "field": "Microsoft.Sql/servers/vulnerabilityAssessments/default.recurringScans.emails[*]" }, "notEquals": 0 } ] } } } } }, ... } ```Affected area/feature