From f85a0f494ab9c373130fb5d544da681990709e30 Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Thu, 25 Jul 2024 13:09:40 -0300 Subject: [PATCH] [schedule_rotation] Allow "none" as rotation participant (#61) --- examples/config/resources/schedule_rotations.yaml | 1 + modules/config/README.md | 1 + modules/config/schedule_rotations.tf | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/config/resources/schedule_rotations.yaml b/examples/config/resources/schedule_rotations.yaml index 720ad2b..58a410e 100644 --- a/examples/config/resources/schedule_rotations.yaml +++ b/examples/config/resources/schedule_rotations.yaml @@ -9,6 +9,7 @@ schedule_rotations: username: opsgenie-test@cloudposse.com - type: user username: opsgenie-test-2@cloudposse.com + - type: none time_restriction: type: time-of-day restrictions: diff --git a/modules/config/README.md b/modules/config/README.md index 648a560..f64f0a4 100644 --- a/modules/config/README.md +++ b/modules/config/README.md @@ -94,6 +94,7 @@ schedule_rotations: participants: - type: user username: opsgenie-test@cloudposse.com + - type: none - type: user username: opsgenie-test-2@cloudposse.com time_restriction: diff --git a/modules/config/schedule_rotations.tf b/modules/config/schedule_rotations.tf index 6db8328..1e68a23 100644 --- a/modules/config/schedule_rotations.tf +++ b/modules/config/schedule_rotations.tf @@ -16,7 +16,7 @@ resource "opsgenie_schedule_rotation" "this" { content { type = participant.value.type - id = try(opsgenie_user.this[participant.value.username].id, data.opsgenie_user.this[participant.value.username].id) + id = participant.value.type == "none" ? null : try(opsgenie_user.this[participant.value.username].id, data.opsgenie_user.this[participant.value.username].id) } }