Skip to content

Commit

Permalink
Fix repeat for Escalations (#12)
Browse files Browse the repository at this point in the history
* Update config

* Update config

* Update config
  • Loading branch information
aknysh authored Oct 23, 2020
1 parent 2e81a07 commit 0ebaff3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/config/escalations.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ resource "opsgenie_escalation" "this" {
}

dynamic repeat {
for_each = try(each.value.repeat, [])
for_each = try(each.value.repeat, null) != null ? ["true"] : []

content {
wait_interval = repeat.value.wait_interval
count = repeat.value.count
reset_recipient_states = repeat.value.reset_recipient_states
close_alert_after_all = repeat.value.close_alert_after_all
wait_interval = lookup(each.value.repeat, "wait_interval", 5)
count = lookup(each.value.repeat, "count", 0)
reset_recipient_states = lookup(each.value.repeat, "reset_recipient_states", true)
close_alert_after_all = lookup(each.value.repeat, "close_alert_after_all", true)
}
}
}
11 changes: 11 additions & 0 deletions modules/escalation/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,15 @@ resource "opsgenie_escalation" "this" {
}
}
}

dynamic repeat {
for_each = try(var.escalation.repeat, null) != null ? ["true"] : []

content {
wait_interval = lookup(var.escalation.repeat, "wait_interval", 5)
count = lookup(var.escalation.repeat, "count", 0)
reset_recipient_states = lookup(var.escalation.repeat, "reset_recipient_states", true)
close_alert_after_all = lookup(var.escalation.repeat, "close_alert_after_all", true)
}
}
}

0 comments on commit 0ebaff3

Please sign in to comment.