Skip to content

Commit

Permalink
[RELEASE] feat: add opensearch_dashboard_object
Browse files Browse the repository at this point in the history
  • Loading branch information
kvendingoldo committed Mar 11, 2024
1 parent 3783e42 commit 97a707d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
5 changes: 5 additions & 0 deletions dashboard_object.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resource "opensearch_dashboard_object" "test_visualization_v6" {
for_each = local.dashboard_object

body = jsonencode(each.value)
}
7 changes: 7 additions & 0 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@ locals {
replace(basename(filename), "/\\.(ya?ml|json)$/", "") =>
length(regexall("\\.ya?ml$", filename)) > 0 ? yamldecode(file(filename)) : jsondecode(file(filename))
}, var.monitors)


dashboard_object = merge({
for filename in var.dashboard_objects_files :
replace(basename(filename), "/\\.(ya?ml|json)$/", "") =>
length(regexall("\\.ya?ml$", filename)) > 0 ? yamldecode(file(filename)) : jsondecode(file(filename))
}, var.dashboard_objects)
}
1 change: 0 additions & 1 deletion monitor.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
resource "opensearch_monitor" "monitors" {
for_each = local.monitors


body = jsonencode(each.value)
}
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,15 @@ variable "monitor_files" {
type = set(string)
default = []
}

variable "dashboard_objects" {
description = "A map of all dashboard objects to create."
type = map(any)
default = {}
}

variable "dashboard_objects_files" {
description = "A set of all dashboard objects files to create."
type = set(string)
default = []
}

0 comments on commit 97a707d

Please sign in to comment.