Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(specs): Make security policy destination zones a list #417

Merged
merged 4 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading