diff --git a/.changelog/3233.txt b/.changelog/3233.txt new file mode 100644 index 0000000000..787d0945c4 --- /dev/null +++ b/.changelog/3233.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/tencentcloud_serverless_hbase_instance: Change `tags` from `TypeList` to `TypeSet` +``` \ No newline at end of file diff --git a/tencentcloud/services/emr/resource_tc_serverless_hbase_instance.go b/tencentcloud/services/emr/resource_tc_serverless_hbase_instance.go index e31011832c..929070fc96 100644 --- a/tencentcloud/services/emr/resource_tc_serverless_hbase_instance.go +++ b/tencentcloud/services/emr/resource_tc_serverless_hbase_instance.go @@ -98,7 +98,7 @@ func ResourceTencentCloudServerlessHbaseInstance() *schema.Resource { }, "tags": { - Type: schema.TypeList, + Type: schema.TypeSet, Optional: true, Description: "List of tags to bind to the instance.", Elem: &schema.Resource{ @@ -195,7 +195,7 @@ func resourceTencentCloudServerlessHbaseInstanceCreate(d *schema.ResourceData, m } if v, ok := d.GetOk("tags"); ok { - for _, item := range v.([]interface{}) { + for _, item := range v.(*schema.Set).List() { tagsMap := item.(map[string]interface{}) tag := emr.Tag{} if v, ok := tagsMap["tag_key"]; ok { @@ -415,11 +415,11 @@ func resourceTencentCloudServerlessHbaseInstanceUpdate(d *schema.ResourceData, m oldMap := make(map[string]interface{}) newMap := make(map[string]interface{}) - for _, o := range oldValue.([]interface{}) { + for _, o := range oldValue.(*schema.Set).List() { oMap := o.(map[string]interface{}) oldMap[oMap["tag_key"].(string)] = oMap["tag_value"].(string) } - for _, n := range newValue.([]interface{}) { + for _, n := range newValue.(*schema.Set).List() { nMap := n.(map[string]interface{}) newMap[nMap["tag_key"].(string)] = nMap["tag_value"].(string) } diff --git a/website/docs/r/serverless_hbase_instance.html.markdown b/website/docs/r/serverless_hbase_instance.html.markdown index a8b2e7cbca..6634989832 100644 --- a/website/docs/r/serverless_hbase_instance.html.markdown +++ b/website/docs/r/serverless_hbase_instance.html.markdown @@ -46,7 +46,7 @@ The following arguments are supported: * `zone_settings` - (Required, List) Detailed configuration of the instance availability zone, currently supports multiple availability zones, the number of availability zones can only be 1 or 3, including zone name, VPC information, and number of nodes. The total number of nodes across all zones must be greater than or equal to 3 and less than or equal to 50. * `auto_renew_flag` - (Optional, Int) AutoRenewFlag, Value range: 0: indicates NOTIFY_AND_MANUAL_RENEW; 1: indicates NOTIFY_AND_AUTO_RENEW; 2: indicates DISABLE_NOTIFY_AND_MANUAL_RENEW. * `node_type` - (Optional, String) Instance node type, can be filled in as 4C16G, 8C32G, 16C64G, 32C128G, case insensitive. -* `tags` - (Optional, List) List of tags to bind to the instance. +* `tags` - (Optional, Set) List of tags to bind to the instance. * `time_span` - (Optional, Int) Time span. * `time_unit` - (Optional, String) Time unit, fill in m which means month.