I want to import saved objects to dashboard with terraform resource "opensearch_dashboard_object". For that I have an ndjson file that I reference in the resource section but I think this creates problem maybe ndjson is not yet supported. I have multi tenancy and need to import specific file to each tenant. Here is an example of what I am using:
Error: "body" contains an invalid JSON: invalid character '{' after top-level value
│
│ with module.environment.module.opensearch.opensearch_dashboard_object.Tenant_1_visualization,
│ on ../../modules/aws/opensearch/main.tf line 199, in resource "opensearch_dashboard_object" "Tenant_1_visualization":
│ 199: body = local.Tenant_1
Or this:
Error: "body" must be an array of objects: json: cannot unmarshal object into Go value of type []interface {}
│
│ with module.environment.module.opensearch.opensearch_dashboard_object.Tenant_1_visualization,
│ on ../../modules/aws/opensearch/main.tf line [199] in resource "opensearch_dashboard_object" "Tenant_1_visualization":
│ 199: body = local.Tenant_1
Here is my dummy ndjson file, I mad esure it's correctly formatted but I read that NDJSON is a bunch of JSON file together in one single file:
The problem
I want to import saved objects to dashboard with terraform resource "opensearch_dashboard_object". For that I have an ndjson file that I reference in the resource section but I think this creates problem maybe ndjson is not yet supported. I have multi tenancy and need to import specific file to each tenant. Here is an example of what I am using:
For that I received this error:
Or this:
Here is my dummy ndjson file, I mad esure it's correctly formatted but I read that NDJSON is a bunch of JSON file together in one single file:
What solution would you like?
I would like support for NDJSON file along with JSON to be added. Because we cannot use JSON for our use case
What alternatives have you considered?
As of now there is no other alternative I considered