Skip to content

Commit

Permalink
Update dws_cluster.md
Browse files Browse the repository at this point in the history
update dws_cluster.md
  • Loading branch information
hmbig2 committed Jul 30, 2021
1 parent 3cb4b3e commit 177004d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
3 changes: 1 addition & 2 deletions docs/resources/css_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ The following arguments are supported:

* `tags` - (Optional, Map) The key/value pairs to associate with the cluster.

* `enterprise_project_id` - (Optional, String, ForceNew) Enterprise project ID. When creating a cluster,
associate the enterprise project ID with the cluster.
* `enterprise_project_id` - (Optional, String, ForceNew) Specifies the enterprise project id of the css cluster,
Value 0 indicates the default enterprise project.
Changing this parameter will create a new resource.

Expand Down
3 changes: 1 addition & 2 deletions docs/resources/dis_stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ The following arguments are supported:

* `csv_delimiter` - (Optional, String, ForceNew) Field separator for CSV file. Changing this parameter will create a new resource.

* `enterprise_project_id` - (Optional, String, ForceNew) Enterprise project ID. When creating a cluster,
associate the enterprise project ID with the cluster.
* `enterprise_project_id` - (Optional, String, ForceNew) Specifies the enterprise project id of the dis stream,
Value 0 indicates the default enterprise project.
Changing this parameter will create a new resource.

Expand Down
10 changes: 4 additions & 6 deletions docs/resources/dws_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ subcategory: "Data Warehouse Service (DWS)"

# huaweicloud_dws_cluster

cluster management
Manages Cluster in the Data Warehouse Service.

## Example Usage

Expand All @@ -24,9 +24,8 @@ resource "huaweicloud_dws_cluster" "cluster" {
security_group_id = huaweicloud_networking_secgroup.secgroup.id
availability_zone = "{{ availability_zone }}"
name = "terraform_dws_cluster_test"
user_name = "userNmae"
user_pwd = "password"
enterprise_project_id = "0"
user_name = "test_cluster_admin"
user_pwd = "cluster123@!"
timeouts {
create = "30m"
delete = "30m"
Expand Down Expand Up @@ -66,8 +65,7 @@ The following arguments are supported:
Lowercase letters Uppercase letters Digits Special characters
~!@#%^&*()-_=+|[{}];:,<.>/?

* `enterprise_project_id` - (Optional, String, ForceNew) Enterprise project ID. When creating a cluster,
associate the enterprise project ID with the cluster.
* `enterprise_project_id` - (Optional, String, ForceNew) Specifies the enterprise project id of the dws cluster,
Value 0 indicates the default enterprise project.
Changing this parameter will create a new resource.

Expand Down
13 changes: 13 additions & 0 deletions huaweicloud/resource_huaweicloud_css_cluster_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,12 @@ func fillCssClusterV1ReadRespBody(body interface{}) interface{} {
result["updated"] = nil
}

if v, ok := val["enterprise_project_id"]; ok {
result["enterprise_project_id"] = v
} else {
result["enterprise_project_id"] = nil
}

return result
}

Expand Down Expand Up @@ -1020,6 +1026,13 @@ func setCssClusterV1Properties(d *schema.ResourceData, response map[string]inter
return fmtp.Errorf("Error setting Cluster:expect_node_num, err: %s", err)
}

v, err = navigateValue(response, []string{"read", "enterprise_project_id"}, nil)
if err == nil {
if err = d.Set("enterprise_project_id", v); err != nil {
return fmtp.Errorf("Error setting Cluster:enterprise_project_id, err: %s", err)
}
}

return nil
}

Expand Down
1 change: 0 additions & 1 deletion huaweicloud/resource_huaweicloud_dis_stream_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ func ResourceDisStreamV2() *schema.Resource {
func resourceDisStreamV2UserInputParams(d *schema.ResourceData) map[string]interface{} {
return map[string]interface{}{
"terraform_resource_data": d,
"auto_scale_enabled": d.Get("auto_scale_enabled"),
"auto_scale_max_partition_count": d.Get("auto_scale_max_partition_count"),
"auto_scale_min_partition_count": d.Get("auto_scale_min_partition_count"),
"compression_format": d.Get("compression_format"),
Expand Down
6 changes: 6 additions & 0 deletions huaweicloud/resource_huaweicloud_dws_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,12 @@ func resourceDwsClusterRead(d *schema.ResourceData, meta interface{}) error {
}
}

if v, ok := res["enterprise_project_id"]; ok {
if err := d.Set("enterprise_project_id", v); err != nil {
return fmtp.Errorf("Error reading Cluster:enterprise_project_id, err: %s", err)
}
}

return nil
}

Expand Down

0 comments on commit 177004d

Please sign in to comment.