From 889622b05e209b72b5e6a160dd48b3537c945d17 Mon Sep 17 00:00:00 2001 From: Himanshu Sharma Date: Tue, 14 Feb 2023 17:01:46 +0530 Subject: [PATCH] Adding evaluation delay and obj_permission --- inputs.tf | 22 +++++++++++++++++----- main.tf | 10 ++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/inputs.tf b/inputs.tf index f0f57c6..dea27b3 100644 --- a/inputs.tf +++ b/inputs.tf @@ -28,11 +28,11 @@ variable "monitor_slo_id" { description = "Slo Id. Required if Monitor Type is Slo." default = null } -#variable "monitor_evaluation_delay" { . #TODO -# type = string -# description = "Evaluation Delay." -# default = "" -# } +variable "monitor_evaluation_delay" { + type = string + description = "Evaluation Delay." + default = "0m" +} variable "monitor_is_disabled" { type = bool description = "Whether or not the monitor is disabled. Default false." @@ -113,4 +113,16 @@ variable "email_notifications" { } )) description = "Email Notifications to be sent by the alert." +} + +variable "monitor_permission" { + type = list(object( + { + subject_type = string, + subject_id = string, + permissions = list(string) + } + )) + description = "An monitor_permission is used to control permissions Explicitly associated with a Monitor" + default = [] } \ No newline at end of file diff --git a/main.tf b/main.tf index 4d31583..7003f9d 100644 --- a/main.tf +++ b/main.tf @@ -43,6 +43,7 @@ resource "sumologic_monitor" "tf_monitor" { monitor_type = var.monitor_monitor_type group_notifications = var.group_notifications slo_id = var.monitor_slo_id + evaluation_delay = var.monitor_evaluation_delay dynamic "queries" { @@ -173,6 +174,15 @@ resource "sumologic_monitor" "tf_monitor" { } } + dynamic "obj_permission" { + for_each = var.monitor_permission + content { + subject_type = obj_permission.value.subject_type + subject_id = obj_permission.value.subject_id + permissions = obj_permission.value.permissions + } + } + dynamic "notifications" { for_each = var.connection_notifications content {