PaloAltoNetworks / terraform-provider-prismacloud

Terraform PrismaCloud provider
https://www.terraform.io/docs/providers/prismacloud/
Mozilla Public License 2.0
54 stars 65 forks source link

Alert Rule Policy Filter #277

Closed lvets closed 1 month ago

lvets commented 8 months ago

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?

bryonwinger commented 2 months ago

Attention to this would be great. We really need this fixed for our use cases.

AnushreeHS commented 1 month ago

Hi @bryonwinger @lvets This feature is implemented in the latest release (v1.5.7).