Skip to content

Commit

Permalink
fix empty list issue #55 (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
tzarski0 authored Nov 13, 2024
1 parent 5ec4d36 commit e347e36
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
- add support for sdwan_policy_object_policer resource
- add support for sdwan_policy_object_tloc_list resource
- add support for variables in secure app hosting feature template
- fix issue where sdwan_custom_control_topology_policy_definition always shows diff when actions are not configured in data model
- fix issue where sdwan_traffic_data_policy_definition always shows diff when match_criterias or actions are not configured in data model
- fix issue where sdwan_application_aware_routing_policy_definition always shows diff when match_criterias or actions are not configured in data model

## 0.1.0

Expand Down
10 changes: 5 additions & 5 deletions sdwan_centralized_policies.tf
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ resource "sdwan_custom_control_topology_policy_definition" "custom_control_topol
group_id = s.match_criterias.group_id
}]
])
action_entries = flatten([
action_entries = try(s.actions, null) == null ? null : flatten([
try(s.actions.community, null) == null && try(s.actions.community_additive, null) == null && try(s.actions.omp_tag, null) == null && try(s.actions.preference, null) == null && try(s.actions.tloc_action, null) == null && try(s.actions.tloc, null) == null && try(s.actions.tloc_list, null) == null ? [] : [{
type = "set"
set_parameters = flatten([
Expand Down Expand Up @@ -326,7 +326,7 @@ resource "sdwan_traffic_data_policy_definition" "traffic_data_policy_definition"
)
ip_type = try(s.ip_type, null)
base_action = try(s.base_action, null)
match_entries = flatten([
match_entries = try(s.match_criterias, null) == null ? null : flatten([
try(s.match_criterias.application_list, null) == null ? [] : [{
type = "appList"
application_list_id = sdwan_application_list_policy_object.application_list_policy_object[s.match_criterias.application_list].id
Expand Down Expand Up @@ -396,7 +396,7 @@ resource "sdwan_traffic_data_policy_definition" "traffic_data_policy_definition"
traffic_to = s.match_criterias.traffic_to
}]
])
action_entries = flatten([
action_entries = try(s.actions, null) == null ? null : flatten([
try(s.actions.log, null) == null ? [] : [{
type = "log"
log = s.actions.log
Expand Down Expand Up @@ -579,7 +579,7 @@ resource "sdwan_application_aware_routing_policy_definition" "application_aware_
id = s.id
name = s.name
ip_type = try(s.ip_type, null)
match_entries = flatten([
match_entries = try(s.match_criterias, null) == null ? null : flatten([
try(s.match_criterias.application_list, null) == null ? [] : [{
type = "appList"
application_list_id = sdwan_application_list_policy_object.application_list_policy_object[s.match_criterias.application_list].id
Expand Down Expand Up @@ -641,7 +641,7 @@ resource "sdwan_application_aware_routing_policy_definition" "application_aware_
traffic_to = s.match_criterias.traffic_to
}]
])
action_entries = flatten([
action_entries = try(s.actions, null) == null ? null : flatten([
try(s.actions.counter_name, null) == null ? [] : [{
type = "count"
counter = s.actions.counter_name
Expand Down

0 comments on commit e347e36

Please sign in to comment.