From 906e2bbd9b5a108d180213493d07aebcd17797ad Mon Sep 17 00:00:00 2001 From: abhinavkumarsph Date: Wed, 25 Sep 2024 16:29:55 +0800 Subject: [PATCH 1/4] feat: dashbaord obj submodule --- examples/dashboard/main.tf | 42 +++++++++++++++++++++++++++ examples/dashboard/providers.tf | 2 ++ examples/dashboard/variables.tf | 17 +++++++++++ examples/dashboard/versions.tf | 10 +++++++ modules/dashboard/object/main.tf | 4 +++ modules/dashboard/object/outputs.tf | 4 +++ modules/dashboard/object/variables.tf | 10 +++++++ modules/dashboard/object/versions.tf | 10 +++++++ modules/dashboard/tenant/outputs.tf | 5 ++++ 9 files changed, 104 insertions(+) create mode 100644 examples/dashboard/main.tf create mode 100644 examples/dashboard/providers.tf create mode 100644 examples/dashboard/variables.tf create mode 100644 examples/dashboard/versions.tf create mode 100644 modules/dashboard/object/main.tf create mode 100644 modules/dashboard/object/outputs.tf create mode 100644 modules/dashboard/object/variables.tf create mode 100644 modules/dashboard/object/versions.tf diff --git a/examples/dashboard/main.tf b/examples/dashboard/main.tf new file mode 100644 index 0000000..e66270a --- /dev/null +++ b/examples/dashboard/main.tf @@ -0,0 +1,42 @@ +locals { + id = coalesce(var.pattern_id, split("-*", var.pattern)[0]) +} + +module "tenant" { + source = "../../modules/dashboard/tenant" + + name = "test-tenant" +} + +module "index_pattern" { + source = "../../modules/dashboard/index-pattern" + + tenant_name = module.tenant.name + pattern = "test-*" + time_field_name = var.time_field_name +} + +module "dashboard" { + source = "../../modules/dashboard/object" + + tenant_name = module.tenant.name + + body = < Date: Wed, 25 Sep 2024 16:33:15 +0800 Subject: [PATCH 2/4] chore: rm id from example --- examples/dashboard/main.tf | 4 ---- 1 file changed, 4 deletions(-) diff --git a/examples/dashboard/main.tf b/examples/dashboard/main.tf index e66270a..c7f8a7f 100644 --- a/examples/dashboard/main.tf +++ b/examples/dashboard/main.tf @@ -1,7 +1,3 @@ -locals { - id = coalesce(var.pattern_id, split("-*", var.pattern)[0]) -} - module "tenant" { source = "../../modules/dashboard/tenant" From c0dac18e32635ca7c80febe185c8a10675054b9e Mon Sep 17 00:00:00 2001 From: abhinavkumarsph Date: Wed, 25 Sep 2024 16:35:26 +0800 Subject: [PATCH 3/4] chore: tf lint --- examples/dashboard/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/dashboard/main.tf b/examples/dashboard/main.tf index c7f8a7f..11fda06 100644 --- a/examples/dashboard/main.tf +++ b/examples/dashboard/main.tf @@ -8,7 +8,7 @@ module "index_pattern" { source = "../../modules/dashboard/index-pattern" tenant_name = module.tenant.name - pattern = "test-*" + pattern = var.pattern time_field_name = var.time_field_name } From 20f2efef99857ea07887aaf60cff11a6ae84396b Mon Sep 17 00:00:00 2001 From: abhinavkumarsph Date: Wed, 25 Sep 2024 16:36:40 +0800 Subject: [PATCH 4/4] chore: tf lint --- examples/dashboard/variables.tf | 6 ------ 1 file changed, 6 deletions(-) diff --git a/examples/dashboard/variables.tf b/examples/dashboard/variables.tf index 374ea4e..c3ea287 100644 --- a/examples/dashboard/variables.tf +++ b/examples/dashboard/variables.tf @@ -4,12 +4,6 @@ variable "pattern" { default = "test-pattern-*" } -variable "pattern_id" { - description = "The ID of index pattern" - type = string - default = "test" -} - variable "time_field_name" { description = "Field name which has the timestamp" type = string