Skip to content

Commit

Permalink
Merge pull request #65 from SumoLogic/hsharma-evaluation-delay
Browse files Browse the repository at this point in the history
Adding evaluation delay and obj_permission
  • Loading branch information
himsharma01 authored Feb 15, 2023
2 parents 823a69a + 889622b commit b4cf0db
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
22 changes: 17 additions & 5 deletions inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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 = []
}
10 changes: 10 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit b4cf0db

Please sign in to comment.