terraform-provider-sumologic icon indicating copy to clipboard operation
terraform-provider-sumologic copied to clipboard

Weird behavior of 'title' and 'name' for dashboards created using sumologic_content

Open mccartney opened this issue 3 years ago • 3 comments

Steps to reproduce

  1. Define a dashboard whose title and name do 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": []
}
  1. Run terraform apply once
  2. Open the dashboard in the UI (I know it sounds weird, but without this step, the symptoms are different)
  3. Run terraform apply again 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?

mccartney avatar Mar 23 '22 15:03 mccartney

I suspect this might be related to: https://github.com/SumoLogic/terraform-provider-sumologic/issues/328

mccartney avatar Mar 23 '22 15:03 mccartney

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.

pbaroni avatar Jan 19 '23 11:01 pbaroni

#673 is related

mccartney avatar Oct 09 '24 13:10 mccartney