terraform-provider-prismacloud icon indicating copy to clipboard operation
terraform-provider-prismacloud copied to clipboard

Alert Rule Policy Filter

Open lvets opened this issue 1 year ago • 0 comments

Describe the bug

It's unclear from the documentation how to use the alertRulePolicyFilter part in the Terraform alert rule resource.

Let's say the API returns the following (removed some fields from the snippet for clearity):

{
  "policyScanConfigId": "xxx",
  "name": "Prisma Default Alert Rule",
  "description": "Prisma Default alert rule to scan all policies associated with label Prisma_Cloud  and all account added to 'Default Account Group'",
...
  "target": {
    "accountGroups": [
      "xxx"
    ],
    "excludedAccounts": [],
    "regions": [],
    "tags": [],
    "alertRulePolicyFilter": {
      "policy.severity": [],
      "policy.label": [
        "Prisma_Cloud"
      ],
      "cloud.type": [],
      "policy.complianceStandard": []
    }
  },
...
}

How can I use the alertRulePolicyFilter parameters in the Terraform prismacloud_alert_rule resource:

    "alertRulePolicyFilter": {
      "policy.severity": [],
      "policy.label": [
        "Prisma_Cloud"
      ],
      "cloud.type": [],
      "policy.complianceStandard": []
    }

Or do I need to first filter the prismacloud_policies data resource and then use those policies in a policies argument in the prismacloud_alert_rule resource?

lvets avatar Jan 05 '24 15:01 lvets