Skip to content

Latest commit

 

History

History
91 lines (76 loc) · 2.61 KB

File metadata and controls

91 lines (76 loc) · 2.61 KB
page_title squaredup_dashboard_image Resource - squaredup
subcategory
description SquaredUp Dashboard Image resource allows you to upload an image to a dashboard tile.

squaredup_dashboard_image (Resource)

SquaredUp Dashboard Image resource allows you to upload an image to a dashboard tile.

Example Usage

resource "squaredup_workspace" "application_workspace" {
  display_name            = "Application Team"
  allow_dashboard_sharing = false
  description             = "Workspace with Dashboards for Application Team"
}

locals {
  // unique id for the image tile which is generated using uuidgen in bash
  application1_image_tile_id = "1d5ec28e-d5d5-4bc9-bbe0-dd63d9871244"
}

resource "squaredup_dashboard" "application1_dashboard" {
  display_name       = "Application 1"
  workspace_id       = squaredup_workspace.application_workspace.id
  dashboard_template = <<EOT
{
  "_type": "layout/grid",
  "contents": [
    {
      "x": 0,
      "h": 2,
      "i": "${local.application1_image_tile_id}",
      "y": 0,
      "config": {
        "_type": "tile/image",
        "description": "",
        "title": "",
        "visualisation": {
          "config": {
            "title": "Some description",
            "uploaded": 123456789,
            "showHealthState": false
          }
        }
      },
      "w": 4
    }
  ],
  "version": 5,
  "columns": 4
}
EOT
}

resource "squaredup_dashboard_image" "application1_image" {
  tile_id               = local.application1_image_tile_id
  dashboard_id          = squaredup_dashboard.application1_dashboard.id
  workspace_id          = squaredup_workspace.application_workspace.id
  image_base64_data_uri = "data:image/png;base64, ${filebase64("path/to/your/image.png")}"
  image_file_name       = "application1.png"
}

Schema

Required

  • dashboard_id (String) The ID of the dashboard which contains the tile where the image will be used.
  • image_base64_data_uri (String) The base64 data URI of the image.
  • image_file_name (String) The file name of the image.
  • tile_id (String) The ID of the tile where the image will be used.
  • workspace_id (String) The ID of the workspace which contains the dashboard.

Read-Only

  • id (String) The ID of the dashboard image which is the same as the tile ID.

Import

Import is supported using the following syntax:

# Dashboard Image can be imported by specifying the workspace id, dashboard id and the tile id.
terraform import squaredup_dashboard_image.example space-123,dash-123,tile-guid