diff --git a/docs/resources/dw_data_visualization.md b/docs/resources/dw_data_visualization.md index 2066be3e..4ce3eaf5 100644 --- a/docs/resources/dw_data_visualization.md +++ b/docs/resources/dw_data_visualization.md @@ -33,7 +33,7 @@ terraform { resource "cdp_dw_data_visualization" "example" { cluster_id = "env-id" name = "data-visualization" - image_version = "2024.0.18.4-5" + image_version = "7.2.7-b48" resource_template = "default" @@ -47,7 +47,7 @@ resource "cdp_dw_data_visualization" "example" { ### Required -- `admin_groups` (String) List of the LDAP groups which can administer this Data Visualization instance. At least one valid group is required. +- `admin_groups` (List of 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. @@ -56,7 +56,7 @@ resource "cdp_dw_data_visualization" "example" { - `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. +- `user_groups` (List of String) List of the LDAP groups which have access to this Data Visualization instance. ### Read-Only diff --git a/examples/resources/cdp_dw_data_visualization/resource.tf b/examples/resources/cdp_dw_data_visualization/resource.tf index 50033b5d..04d205dc 100644 --- a/examples/resources/cdp_dw_data_visualization/resource.tf +++ b/examples/resources/cdp_dw_data_visualization/resource.tf @@ -19,7 +19,7 @@ terraform { resource "cdp_dw_data_visualization" "example" { cluster_id = "env-id" name = "data-visualization" - image_version = "2024.0.18.4-5" + image_version = "7.2.7-b48" resource_template = "default" diff --git a/resources/dw/dataviz/resource_dataviz.go b/resources/dw/dataviz/resource_dataviz.go index d38989e1..a4b986bd 100644 --- a/resources/dw/dataviz/resource_dataviz.go +++ b/resources/dw/dataviz/resource_dataviz.go @@ -85,8 +85,8 @@ func (r *datavizResource) Create(ctx context.Context, req resource.CreateRequest if opts := plan.PollingOptions; !(opts != nil && opts.Async.ValueBool()) { if _, err = r.retryStateConf(ctx, setupRetryCfg(clusterID, vizID), &plan).WaitForStateContext(ctx); err != nil { resp.Diagnostics.AddError( - "Error waiting for Data Warehouse hive virtual warehouse", - "Could not create hive, unexpected error: "+err.Error(), + "Error waiting for Data Visualization", + "Could not create Data Visualization, unexpected error: "+err.Error(), ) return } @@ -113,9 +113,6 @@ func (r *datavizResource) Create(ctx context.Context, req resource.CreateRequest ), ) resp.Diagnostics.Append(diags...) - if resp.Diagnostics.HasError() { - return - } } func (r *datavizResource) Read(ctx context.Context, _ resource.ReadRequest, _ *resource.ReadResponse) { @@ -215,7 +212,7 @@ func (r *datavizResource) retryStateConf( Delay: 30 * time.Second, Timeout: utils.GetPollingTimeout(po, 20*time.Minute), PollInterval: 30 * time.Second, - Refresh: r.stateRefresh(ctx, cfg.clusterID, cfg.clusterID, &failedCnt, utils.GetCallFailureThreshold(po, 3)), + Refresh: r.stateRefresh(ctx, cfg.clusterID, cfg.vizID, &failedCnt, utils.GetCallFailureThreshold(po, 3)), } } diff --git a/resources/dw/dataviz/schema_dataviz.go b/resources/dw/dataviz/schema_dataviz.go index a5d48003..d55c714f 100644 --- a/resources/dw/dataviz/schema_dataviz.go +++ b/resources/dw/dataviz/schema_dataviz.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema/int64default" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/types" ) var datavizSchema = schema.Schema{ @@ -52,12 +53,14 @@ var datavizSchema = schema.Schema{ MarkdownDescription: "The name of the resource template being used. Available options: reduced, medium, large. Empty means the default resources template will be assigned.", }, - "user_groups": schema.StringAttribute{ + "user_groups": schema.ListAttribute{ Optional: true, + ElementType: types.StringType, MarkdownDescription: "List of the LDAP groups which have access to this Data Visualization instance.", }, - "admin_groups": schema.StringAttribute{ + "admin_groups": schema.ListAttribute{ Required: true, + ElementType: types.StringType, MarkdownDescription: "List of the LDAP groups which can administer this Data Visualization instance. At least one valid group is required.", },