opensearch-project / terraform-provider-opensearch

https://registry.terraform.io/providers/opensearch-project/opensearch
Apache License 2.0
74 stars 57 forks source link

[FEATURE] Allow tenant selection when creating Dashboard Objects #97

Closed spacez320 closed 4 months ago

spacez320 commented 11 months ago

Is your feature request related to a problem?

The Dashboard Object spec provides a nice way to inject index patterns/visualizations/dashboards, but it seems like it's only able to provide these resources to the global tenant.

What solution would you like?

Specifying the tenant to target for the Dashboard Object. Possibly other resources?

E.g.

resource "opensearch_dashboard_object" "test_index_pattern_v7" {
  body = <<EOF
[
  {
    "_id": "index-pattern:cloudwatch",
    "_type": "doc",
    "_source": {
      "type": "index-pattern",
      "index-pattern": {
        "title": "cloudwatch-*",
        "timeFieldName": "timestamp"
      }
    }
  }
]
EOF
  security_tenant = "my_tenant"  # Add this.
}

What alternatives have you considered?

It seems like you can generally specify tenancy in direct API calls by doing something like providing security_tenant=<something> as a URL parameter. For now probably going to invoke the API directly to copy dashboard objects around, but it would be nice if security_tenant was an option on the resource, or the provider instantiation, or something.

Do you have any additional context?

Sorry if I'm missing something!

peterzhuamazon commented 10 months ago

Similar to:

spacez320 commented 10 months ago

@peterzhuamazon It looks like https://github.com/opensearch-project/terraform-provider-opensearch/issues/104 does cover this request. Happy to have this be closed and follow that, instead.