|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "squaredup_dashboard_ordering Resource - squaredup" |
| 4 | +subcategory: "" |
| 5 | +description: |- |
| 6 | + Manage the order of dashboards in a workspace. It also allows you to create dashboard folders. |
| 7 | +--- |
| 8 | + |
| 9 | +# squaredup_dashboard_ordering (Resource) |
| 10 | + |
| 11 | +Manage the order of dashboards in a workspace. It also allows you to create dashboard folders. |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +```terraform |
| 16 | +resource "squaredup_workspace" "application_workspace" { |
| 17 | + display_name = "Application Team" |
| 18 | + description = "Workspace with Dashboards for Application Team" |
| 19 | +} |
| 20 | +
|
| 21 | +resource "squaredup_dashboard" "application1" { |
| 22 | + workspace_id = squaredup_workspace.application_workspace.id |
| 23 | + display_name = "Application 1" |
| 24 | + dashboard_template = <<EOT |
| 25 | +{ |
| 26 | + "_type": "layout/grid", |
| 27 | + "columns": 4, |
| 28 | + "contents": [ |
| 29 | + { |
| 30 | + "i": "07bb1be5-e210-4fa1-81e7-728a750ed247", |
| 31 | + "x": 0, |
| 32 | + "y": 0, |
| 33 | + "w": 4, |
| 34 | + "h": 2, |
| 35 | + "config": { |
| 36 | + "title": "", |
| 37 | + "description": "" |
| 38 | + } |
| 39 | + } |
| 40 | + ] |
| 41 | +} |
| 42 | +EOT |
| 43 | +} |
| 44 | +
|
| 45 | +resource "squaredup_dashboard" "application1_api" { |
| 46 | + workspace_id = squaredup_workspace.application_workspace.id |
| 47 | + display_name = "Application 1 (API)" |
| 48 | + dashboard_template = <<EOT |
| 49 | +{ |
| 50 | + "_type": "layout/grid", |
| 51 | + "columns": 4, |
| 52 | + "contents": [ |
| 53 | + { |
| 54 | + "i": "07bb1be5-e210-4fa1-81e7-728a750ed247", |
| 55 | + "x": 0, |
| 56 | + "y": 0, |
| 57 | + "w": 4, |
| 58 | + "h": 2, |
| 59 | + "config": { |
| 60 | + "title": "", |
| 61 | + "description": "" |
| 62 | + } |
| 63 | + } |
| 64 | + ] |
| 65 | +} |
| 66 | +EOT |
| 67 | +} |
| 68 | +
|
| 69 | +resource "squaredup_dashboard" "application2" { |
| 70 | + workspace_id = squaredup_workspace.application_workspace.id |
| 71 | + display_name = "Application 2" |
| 72 | + dashboard_template = <<EOT |
| 73 | +{ |
| 74 | + "_type": "layout/grid", |
| 75 | + "columns": 4, |
| 76 | + "contents": [ |
| 77 | + { |
| 78 | + "i": "07bb1be5-e210-4fa1-81e7-728a750ed247", |
| 79 | + "x": 0, |
| 80 | + "y": 0, |
| 81 | + "w": 4, |
| 82 | + "h": 2, |
| 83 | + "config": { |
| 84 | + "title": "", |
| 85 | + "description": "" |
| 86 | + } |
| 87 | + } |
| 88 | + ] |
| 89 | +} |
| 90 | +EOT |
| 91 | +} |
| 92 | +
|
| 93 | +resource "squaredup_dashboard" "application3" { |
| 94 | + workspace_id = squaredup_workspace.application_workspace.id |
| 95 | + display_name = "Application 3" |
| 96 | + dashboard_template = <<EOT |
| 97 | +{ |
| 98 | + "_type": "layout/grid", |
| 99 | + "columns": 4, |
| 100 | + "contents": [ |
| 101 | + { |
| 102 | + "i": "07bb1be5-e210-4fa1-81e7-728a750ed247", |
| 103 | + "x": 0, |
| 104 | + "y": 0, |
| 105 | + "w": 4, |
| 106 | + "h": 2, |
| 107 | + "config": { |
| 108 | + "title": "", |
| 109 | + "description": "" |
| 110 | + } |
| 111 | + } |
| 112 | + ] |
| 113 | +} |
| 114 | +EOT |
| 115 | +} |
| 116 | +
|
| 117 | +resource "random_uuid" "application_1_folder_id" {} |
| 118 | +
|
| 119 | +resource "random_uuid" "app1_api_folder_id" {} |
| 120 | +
|
| 121 | +resource "squaredup_dashboard_ordering" "example_ordering" { |
| 122 | + workspace_id = squaredup_workspace.application_workspace.id |
| 123 | + # Example with dashboards in top level and nested folders |
| 124 | + # Folders needs to be as an object with name, id and dashboardIdOrder |
| 125 | + # dashboardIdOrder is a list of dashboard ids or nested folders |
| 126 | + order = jsonencode([ |
| 127 | + { |
| 128 | + name = "Application 1" |
| 129 | + id = random_uuid.application_1_folder_id.result |
| 130 | + dashboardIdOrder = [ |
| 131 | + { |
| 132 | + name = "API" |
| 133 | + id = random_uuid.app1_api_folder_id.result |
| 134 | + dashboardIdOrder = [ |
| 135 | + squaredup_dashboard.application1_api.id |
| 136 | + ] |
| 137 | + }, |
| 138 | + squaredup_dashboard.application1.id |
| 139 | + ] |
| 140 | + }, |
| 141 | + squaredup_dashboard.application2.id, |
| 142 | + squaredup_dashboard.application3.id |
| 143 | + ]) |
| 144 | +} |
| 145 | +``` |
| 146 | + |
| 147 | +<!-- schema generated by tfplugindocs --> |
| 148 | +## Schema |
| 149 | + |
| 150 | +### Required |
| 151 | + |
| 152 | +- `order` (String) The order of the dashboards and folders in the workspace. |
| 153 | +- `workspace_id` (String) The ID of the workspace to manage. |
| 154 | + |
| 155 | +### Read-Only |
| 156 | + |
| 157 | +- `id` (String) The ID of the workspace. |
| 158 | +- `last_updated` (String) The last time the workspace order was updated. |
| 159 | + |
| 160 | +## Import |
| 161 | + |
| 162 | +Import is supported using the following syntax: |
| 163 | + |
| 164 | +```shell |
| 165 | +# Dashboard Ordering can be imported by specifying the workspace id |
| 166 | +terraform import squaredup_dashboard_ordering.example space-123 |
| 167 | +``` |
0 commit comments