Open qgervacio opened 6 months ago
Hi @qgervacio If I understand correctly you are trying to create a dashboard resource from a json imported from the UI. The problem is that the structure of the json and the resource's schema are not completely overlap.
i have observed the ff behaviour when using below:
create a dashboard in UI, export to test.json
resource "coralogix_dashboard" "dashboard" {
content_json = file("./test.json")
}
off
or you'll get json content is not matching layout schema. got an err while unmarshalling - proto: (line 125:3): unknown field "off"
test.json
is created successfullyid
in test.json
you get dashboard id not found
seems to me that with content_json
would make that kind of self-service i want difficult to achieve.
I had the same issue, this exported JSON configuration is not meant to be used with Terraform but rather for importing the dashboards in UI.
What I found to be working more or less is creating the dashboard manually in UI, then using a "data" source in Terraform to load its config to tfstate and then taking that TF config and pasting to my code. However there are IDs included that are read-only - you need to remove them.
Would be a nice feature though - to export TF config from the UI.
Hi CX team. This is not really a bug but an inquiry. I would like to seek help regarding creations of native dashboards via TF.
The self-service I would like to expose to my users is to create the dashboard first (in any folder), export as JSON and drop to a self-service repo. structure of the repo below
these folders are created in CX accordingly, however Im stuck in creating the dashboard.
Creating via below seems inflexible(?) as i need to give my users options which folder the dashboard should be created as structured in the self-service repo.
Affected Resource(s)
coralogix_dashboard
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
Dashboard is created in a folder
Actual Behavior
Inappropriate value for attribute "layout": attribute "sections": element 0: attribute "rows": element 0: attribute "height" is required.
Steps to Reproduce
i have created a native dashboard using the UI and exported the JSON file.
as part of my TF, i run a removal of certain fields.
and below is the sample result of this
null_resource.clean_json
then in dashboard creation
Important Factoids
References