Skip to content

Commit

Permalink
CDPCP-13591 Cloudera Data Warehouse - Data Visualisation Support
Browse files Browse the repository at this point in the history
Resource implementation added.
Docs added.
  • Loading branch information
Viktor Csomor committed Dec 18, 2024
1 parent e9bad92 commit 6d434c2
Show file tree
Hide file tree
Showing 9 changed files with 331 additions and 111 deletions.
74 changes: 74 additions & 0 deletions docs/resources/dw_data_visualization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
page_title: "cdp_dw_data_visualization Resource - terraform-provider-cdp"
subcategory: "Data Warehouse"
description: |-
Cloudera Data Warehouse (CDW) integrates Data Visualization https://docs.cloudera.com/data-warehouse/cloud/managing-warehouses/topics/dw-use-data-visualization.html for building graphic representations of data, dashboards, and visual applications based on CDW data.
---

# cdp_dw_data_visualization (Resource)

Cloudera Data Warehouse (CDW) integrates [Data Visualization](https://docs.cloudera.com/data-warehouse/cloud/managing-warehouses/topics/dw-use-data-visualization.html) for building graphic representations of data, dashboards, and visual applications based on CDW data.

## Example Usage

```terraform
## Copyright 2024 Cloudera. All Rights Reserved.
#
# This file is licensed under the Apache License Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
#
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
# OF ANY KIND, either express or implied. Refer to the License for the specific
# permissions and limitations governing your use of the file.
terraform {
required_providers {
cdp = {
source = "cloudera/cdp"
}
}
}
resource "cdp_dw_data_visualization" "example" {
cluster_id = "env-id"
name = "data-visualization"
image_version = "2024.0.18.4-5"
resource_template = "default"
user_groups = ["ugrp0", "ugrp1"]
admin_groups = ["admgrp0", "admgrp1"]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `admin_groups` (String) List of the LDAP groups which can administer this Data Visualization instance. At least one valid group is required.
- `cluster_id` (String) The id of the CDW Cluster which the Data Visualization is attached to.
- `name` (String) The name of the Data Visualization.

### Optional

- `image_version` (String) The version of the Data Visualization.
- `polling_options` (Attributes) Polling related configuration options that could specify various values that will be used during CDP resource creation. (see [below for nested schema](#nestedatt--polling_options))
- `resource_template` (String) The name of the resource template being used. Available options: reduced, medium, large. Empty means the default resources template will be assigned.
- `user_groups` (String) List of the LDAP groups which have access to this Data Visualization instance.

### Read-Only

- `id` (String) The ID of this resource.
- `last_updated` (String) Timestamp of the last Terraform update of the order.
- `status` (String) The status of the Data Visualization.

<a id="nestedatt--polling_options"></a>
### Nested Schema for `polling_options`

Optional:

- `async` (Boolean) Boolean value that specifies if Terraform should wait for resource creation/deletion.
- `call_failure_threshold` (Number) Threshold value that specifies how many times should a single call failure happen before giving up the polling.
- `polling_timeout` (Number) Timeout value in minutes that specifies for how long should the polling go for resource creation/deletion.
2 changes: 1 addition & 1 deletion docs/resources/dw_vw_hive.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ resource "cdp_dw_vw_hive" "example" {
max_group_count = 3
disable_auto_suspend = false
auto_suspend_timeout_seconds = 100
scale_wait_time_seconds = 230 // either headroom or scale_wait_time_seconds can be configured
scale_wait_time_seconds = 230 // either headroom or scale_wait_time_seconds can be configured
headroom = 1
max_concurrent_isolated_queries = 5
max_nodes_per_isolated_query = 2
Expand Down
1 change: 1 addition & 0 deletions docs/resources/dw_vw_impala.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ resource "cdp_dw_vw_impala" "impala-terraform" {
cluster_id = var.cluster_id
database_catalog_id = var.database_catalog_id
name = var.name
image_version = var.image_version
}
```

Expand Down
28 changes: 28 additions & 0 deletions examples/resources/cdp_dw_data_visualization/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Copyright 2024 Cloudera. All Rights Reserved.
#
# This file is licensed under the Apache License Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
#
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
# OF ANY KIND, either express or implied. Refer to the License for the specific
# permissions and limitations governing your use of the file.

terraform {
required_providers {
cdp = {
source = "cloudera/cdp"
}
}
}

resource "cdp_dw_data_visualization" "example" {
cluster_id = "env-id"
name = "data-visualization"
image_version = "2024.0.18.4-5"

resource_template = "default"

user_groups = ["ugrp0", "ugrp1"]
admin_groups = ["admgrp0", "admgrp1"]
}
2 changes: 1 addition & 1 deletion examples/resources/cdp_dw_vw_hive/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ resource "cdp_dw_vw_hive" "example" {
max_group_count = 3
disable_auto_suspend = false
auto_suspend_timeout_seconds = 100
scale_wait_time_seconds = 230 // either headroom or scale_wait_time_seconds can be configured
scale_wait_time_seconds = 230 // either headroom or scale_wait_time_seconds can be configured
headroom = 1
max_concurrent_isolated_queries = 5
max_nodes_per_isolated_query = 2
Expand Down
2 changes: 2 additions & 0 deletions provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package provider
import (
"context"
"fmt"
"github.com/cloudera/terraform-provider-cdp/resources/dw/dataviz"
"os"
"runtime"
"strconv"
Expand Down Expand Up @@ -252,6 +253,7 @@ func (p *CdpProvider) Resources(_ context.Context) []func() resource.Resource {
de.NewServiceResource,
hive.NewHiveResource,
impala.NewImpalaResource,
dataviz.NewDataVizResource,
dwaws.NewDwClusterResource,
dwdatabasecatalog.NewDwDatabaseCatalogResource,
}
Expand Down
2 changes: 2 additions & 0 deletions provider/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package provider
import (
"context"
"fmt"
"github.com/cloudera/terraform-provider-cdp/resources/dw/dataviz"
"os"
"reflect"
"regexp"
Expand Down Expand Up @@ -638,6 +639,7 @@ func TestCdpProvider_Resources(t *testing.T) {
de.NewServiceResource,
hive.NewHiveResource,
impala.NewImpalaResource,
dataviz.NewDataVizResource,
dwaws.NewDwClusterResource,
dwdatabasecatalog.NewDwDatabaseCatalogResource,
}
Expand Down
Loading

0 comments on commit 6d434c2

Please sign in to comment.