Skip to content

Commit

Permalink
fix(specs): Make security policy destination zones a list (#417)
Browse files Browse the repository at this point in the history
Co-authored-by: Migara Ekanayake <[email protected]>
  • Loading branch information
kklimonda-cl and migara authored Jan 24, 2025
1 parent 128617a commit cdd5af3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resource "panos_security_policy" "name" {
source_zones = ["any"],
source_addresses = ["1.1.1.1"],
destination_zones = ["any"],
destination_addresses = ["172.16.0.0/8"],
destination_addresses = ["172.0.0.0/8"],
services = ["any"],
applications = ["any"],
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resource "panos_security_policy_rules" "name" {
source_zones = ["any"],
source_addresses = ["1.1.1.1"],
destination_zones = ["any"],
destination_addresses = ["172.16.0.0/8"],
destination_addresses = ["172.0.0.0/8"],
services = ["any"],
applications = ["any"],
}
Expand Down
10 changes: 6 additions & 4 deletions assets/terraform/test/resource_security_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ resource "panos_security_policy" "policy" {
# source_hips = ["hip-profile"]
negate_source = false
destination_zone = "any"
destination_zones = ["any"]
destination_addresses = ["any"]
# destination_hips = ["hip-device"]
Expand Down Expand Up @@ -262,8 +262,10 @@ func TestAccSecurityPolicyExtended(t *testing.T) {
"panos_security_policy.policy",
tfjsonpath.New("rules").
AtSliceIndex(0).
AtMapKey("destination_zone"),
knownvalue.StringExact("any"),
AtMapKey("destination_zones"),
knownvalue.ListExact([]knownvalue.Check{
knownvalue.StringExact("any"),
}),
),
statecheck.ExpectKnownValue(
"panos_security_policy.policy",
Expand Down Expand Up @@ -410,7 +412,7 @@ resource "panos_security_policy" "policy" {
source_zones = ["any"]
source_addresses = ["any"]
destination_zone = "any"
destination_zones = ["any"]
destination_addresses = ["any"]
services = ["any"]
Expand Down
3 changes: 1 addition & 2 deletions specs/policies/security-policy-rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,7 @@ spec:
required: false
codegen_overrides:
terraform:
name: destination_zone
type: string
name: destination_zones
- name: uuid
type: string
profiles:
Expand Down

0 comments on commit cdd5af3

Please sign in to comment.