Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: kibana_object does not work with dashboards #34

Open
nicholas-r-king opened this issue Nov 23, 2022 · 2 comments
Open

bug: kibana_object does not work with dashboards #34

nicholas-r-king opened this issue Nov 23, 2022 · 2 comments

Comments

@nicholas-r-king
Copy link

File contains the exact contents of an exported dashboard from Kibana (saved object). Attempting to create this returns a 400 bad request from kibana/elasticsearch. Dashboard was created in the existing version of Kibana. (Not a version mismatch or something).

resource "kibana_object" "test" {
  name           = "terraform-test"
  data           = file("./json/${var.environment}/rhapsody-dashboard.ndjson")
  deep_reference = "true"
}

running "/usr/local/bin/terraform apply -input=false "/atlantis/repos/sre/tf-workspaces/infra-central/453/default/cvg-elasticsearch/dashboards/dev-dashboards-elasticsearch-default.tfplan"" in "/atlantis/repos/sre/tf-workspaces/infra-central/453/default/cvg-elasticsearch/dashboards": exit status 1
kibana_object.rhapsody-dashboard: Creating...

│ Error: 400 Bad Request

│ with kibana_object.test,
│ on dashboards.tf line 1, in resource "kibana_object" "test":
│ 1: resource "kibana_object" "test" {

@eloo
Copy link

eloo commented Nov 24, 2022

i guess you need to use the export_objects or @disaster37 ?

@t0mmili
Copy link

t0mmili commented Jan 5, 2023

I was actually having the same issue and did some digging.

First of all tf with debug shows this:
Response: {"statusCode":400,"error":"Bad Request","message":"Unexpected end of JSON input"}

But then it gets interesting :) When you put index-pattern from repos tests it works! But wait, let's format this json properly, with each key-value in new line. Oh, it doesn't work...

@disaster37, could you check if it's valid conclusion? Provider "doesn't like" new line chars in json?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants