terraform-provider-sumologic
terraform-provider-sumologic copied to clipboard
Weird behavior of 'title' and 'name' for dashboards created using sumologic_content
Steps to reproduce
- Define a dashboard whose
titleandnamedo not match, e.g.
data "sumologic_personal_folder" "personalFolder" {}
resource "sumologic_content" "crazy_dashboard" {
parent_id = data.sumologic_personal_folder.personalFolder.id
config =<<EOF
{
"type": "DashboardV2SyncDefinition",
"name": "An empty dashboard",
"description": "",
"title": "Not that empty",
"theme": "Light",
"topologyLabelMap": {
"data": {}
},
"refreshInterval": 0,
"timeRange": {
"type": "BeginBoundedTimeRange",
"from": {
"type": "RelativeTimeRangeBoundary",
"relativeTime": "-15m"
},
"to": null
},
"layout": {
"layoutType": "Grid",
"layoutStructures": [
{
"key": "panelPANE-D2CBAAB9AF97884F",
"structure": "{\"height\":6,\"width\":12,\"x\":0,\"y\":0,\"minHeight\":1,\"minWidth\":1}"
}
]
},
"panels": [
{
"id": null,
"key": "panelPANE-D2CBAAB9AF97884F",
"title": "text 1",
"visualSettings": "{\"general\":{\"mode\":\"TextPanel\",\"type\":\"text\",\"displayType\":\"default\"},\"title\":{\"fontSize\":14},\"text\":{\"format\":\"markdownV2\"},\"series\":{},\"legend\":{\"enabled\":false}}",
"keepVisualSettingsConsistentWithParent": true,
"panelType": "TextPanel",
"text": ""
}
],
"variables": [],
"coloringRules": []
}
- Run
terraform applyonce - Open the dashboard in the UI (I know it sounds weird, but without this step, the symptoms are different)
- Run
terraform applyagain with no changes
Observed
It errors out on the second and any subsequent apply with:
Error: Failed - {content1:duplicate_element Content:: Content with same name already exists. Name = Not that empty & Existing Parent ID = 14205149 }
Expected
- Some consistent behavior
- Maybe just remove one of the fields?
I suspect this might be related to: https://github.com/SumoLogic/terraform-provider-sumologic/issues/328
This affected our project as well, even without the
3. Open the dashboard in the UI (I know it sounds weird, but without this step, the symptoms are different) step.
Workaround was to manually set the identical value to title and name fields.
#673 is related