PaloAltoNetworks / terraform-provider-prismacloudcompute

Terraform provider for Prisma Cloud Compute
https://registry.terraform.io/providers/PaloAltoNetworks/prismacloudcompute/latest
Mozilla Public License 2.0
24 stars 28 forks source link

Allow multiple rules per policy #13

Closed hi-artem closed 3 years ago

hi-artem commented 3 years ago

Description

As mentioned in #12, there is certain limitations in the current policy resources - they can only be created with 1 rule per policy.

The following PR adds logic to allow multiple rules per policy, by iterating over the rules as the policies are getting parsed. I didn't change core logic of how policies are getting parsed, and all the changes are scoped to adding the iteration element.

I updated one of the examples to showcase the policy with multiple rules.

Motivation and Context

Need to have multiple rules per policy.

How Has This Been Tested?

Manually tested on self-hosted Prisma Cloud Compute 21.04 running Terraform with various combination of rules.

Types of changes

Checklist

welcome-to-palo-alto-networks[bot] commented 3 years ago

:tada: Thanks for opening this pull request! We really appreciate contributors like you! :raised_hands:

wfg commented 3 years ago

@hi-artem I also tested your changes, and it does what it says on the tin. Thanks for taking the time to contribute to this project.

welcome-to-palo-alto-networks[bot] commented 3 years ago

:tada: Congrats on getting your first pull request merged! We here at Palo Alto Networks are so grateful! :heart: