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 ACL sequence name key error and add port ranges #26

Merged
merged 1 commit into from
May 6, 2024
Merged
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
9 changes: 4 additions & 5 deletions sdwan_localized_policies.tf
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ resource "sdwan_ipv6_acl_policy_definition" "ipv6_acl_policy_definition" {
type = "destinationIpv6"
destination_ip = s.match_criterias.destination_ip_prefix
}],
try(s.match_criterias.destination_port, null) == null ? [] : [{
try(s.match_criterias.destination_ports, null) == null && try(s.match_criterias.destination_port_ranges, null) == null ? [] : [{
type = "destinationPort"
destination_ports = s.match_criterias.destination_port
destination_ports = join(" ", concat([for p in try(s.match_criterias.destination_ports, []) : p], [for r in try(s.match_criterias.destination_port_ranges, []) : "${r.from}-${r.to}"]))
}],
try(s.match_criterias.next_header, null) == null ? [] : [{
type = "nextHeader"
Expand Down Expand Up @@ -276,7 +276,7 @@ resource "sdwan_ipv4_device_acl_policy_definition" "ipv4_device_acl_policy_defin
default_action = try(each.value.default_action, null)
sequences = try(length(each.value.sequences) == 0, true) ? null : [for s in each.value.sequences : {
id = s.id
name = try(s.sequenceName, "Device Access Control List")
name = try(s.name, "Device Access Control List")
base_action = s.base_action
match_entries = !(can(s.match_criterias.destination_data_prefix_list) ||
can(s.match_criterias.destination_ip_prefix) ||
Expand Down Expand Up @@ -325,7 +325,7 @@ resource "sdwan_ipv6_device_acl_policy_definition" "ipv6_device_acl_policy_defin
default_action = try(each.value.default_action, null)
sequences = try(length(each.value.sequences) == 0, true) ? null : [for s in each.value.sequences : {
id = s.id
name = try(s.sequenceName, "Device Access Control List")
name = try(s.name, "Device Access Control List")
base_action = s.base_action
match_entries = !(can(s.match_criterias.destination_data_prefix_list) ||
can(s.match_criterias.destination_ip_prefix) ||
Expand Down Expand Up @@ -570,4 +570,3 @@ resource "sdwan_localized_policy" "localized_policy" {
}]]
])
}