diff --git a/cspell.json b/cspell.json index 2124122..38f8d11 100644 --- a/cspell.json +++ b/cspell.json @@ -29,6 +29,7 @@ "tfsdk", "timeframe", "unmarshalling", + "uuidgen", "visualisation" ] } diff --git a/docs/resources/dashboard_image.md b/docs/resources/dashboard_image.md new file mode 100644 index 0000000..47a28a8 --- /dev/null +++ b/docs/resources/dashboard_image.md @@ -0,0 +1,91 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "squaredup_dashboard_image Resource - squaredup" +subcategory: "" +description: |- + SquaredUp Dashboard Image resource allows you to upload an image for use in the Image tile. +--- + +# squaredup_dashboard_image (Resource) + +SquaredUp Dashboard Image resource allows you to upload an image for use in the Image tile. + +## Example Usage + +```terraform +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 = < +## 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: + +```shell +# 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 +``` diff --git a/examples/resources/squaredup_dashboard_image/import.sh b/examples/resources/squaredup_dashboard_image/import.sh new file mode 100644 index 0000000..b225191 --- /dev/null +++ b/examples/resources/squaredup_dashboard_image/import.sh @@ -0,0 +1,2 @@ +# 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 diff --git a/examples/resources/squaredup_dashboard_image/resource.tf b/examples/resources/squaredup_dashboard_image/resource.tf new file mode 100644 index 0000000..895ec69 --- /dev/null +++ b/examples/resources/squaredup_dashboard_image/resource.tf @@ -0,0 +1,51 @@ +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 = <