Skip to content

Commit 38ea497

Browse files
feat: multi-tenancy support for dashboard objects
1 parent 17f25be commit 38ea497

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

modules/dashboard/index-pattern/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
21
## Requirements
32

43
| Name | Version |
54
|------|---------|
65
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.4 |
7-
| <a name="requirement_opensearch"></a> [opensearch](#requirement\_opensearch) | >= 1.0 |
6+
| <a name="requirement_opensearch"></a> [opensearch](#requirement\_opensearch) | >= 2.3 |
87

98
## Providers
109

1110
| Name | Version |
1211
|------|---------|
13-
| <a name="provider_opensearch"></a> [opensearch](#provider\_opensearch) | 2.2.1 |
12+
| <a name="provider_opensearch"></a> [opensearch](#provider\_opensearch) | >= 2.3 |
1413

1514
## Modules
1615

@@ -28,11 +27,11 @@ No modules.
2827
|------|-------------|------|---------|:--------:|
2928
| <a name="input_pattern"></a> [pattern](#input\_pattern) | The index pattern | `string` | n/a | yes |
3029
| <a name="input_pattern_id"></a> [pattern\_id](#input\_pattern\_id) | The ID of index pattern | `string` | `null` | no |
30+
| <a name="input_tenant_name"></a> [tenant\_name](#input\_tenant\_name) | The name of the tenant to which dashboard data associates. Empty string defaults to global tenant | `string` | `""` | no |
3131
| <a name="input_time_field_name"></a> [time\_field\_name](#input\_time\_field\_name) | Field name which has the timestamp | `string` | n/a | yes |
3232

3333
## Outputs
3434

3535
| Name | Description |
3636
|------|-------------|
3737
| <a name="output_id"></a> [id](#output\_id) | The ID of the index pattern |
38-
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

modules/dashboard/index-pattern/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ locals {
33
}
44

55
resource "opensearch_dashboard_object" "index_pattern" {
6-
body = <<EOF
6+
tenant_name = var.tenant_name
7+
body = <<EOF
78
[
89
{
910
"_id": "index-pattern:${local.id}",

modules/dashboard/index-pattern/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ variable "time_field_name" {
1313
description = "Field name which has the timestamp"
1414
type = string
1515
}
16+
17+
variable "tenant_name" {
18+
description = "The name of the tenant to which dashboard data associates. Empty string defaults to global tenant"
19+
type = string
20+
default = ""
21+
}

modules/dashboard/index-pattern/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
opensearch = {
66
source = "opensearch-project/opensearch"
7-
version = ">= 1.0"
7+
version = ">= 2.3"
88
}
99
}
1010
}

0 commit comments

Comments
 (0)