Skip to content

Commit 5f69543

Browse files
author
mikatong
committed
update
1 parent 3bbdb38 commit 5f69543

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tencentcloud/services/cdwpg/data_source_tc_cdwpg_instances.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func dataSourceTencentCloudCdwpgInstancesRead(d *schema.ResourceData, meta inter
181181
return err
182182
}
183183

184-
var instanceId string
184+
ids := make([]string, 0, len(instances))
185185
instancesList := make([]map[string]interface{}, 0, len(instances))
186186
for _, instance := range instances {
187187
instancesListMap := map[string]interface{}{}
@@ -191,7 +191,7 @@ func dataSourceTencentCloudCdwpgInstancesRead(d *schema.ResourceData, meta inter
191191
}
192192

193193
if instance.InstanceId != nil {
194-
instanceId = *instance.InstanceId
194+
ids = append(ids, *instance.InstanceId)
195195
instancesListMap["instance_id"] = instance.InstanceId
196196
}
197197

@@ -258,9 +258,9 @@ func dataSourceTencentCloudCdwpgInstancesRead(d *schema.ResourceData, meta inter
258258
instancesList = append(instancesList, instancesListMap)
259259
}
260260

261-
_ = d.Set("instances_list.", instancesList)
261+
_ = d.Set("instances_list", instancesList)
262262

263-
d.SetId(instanceId)
263+
d.SetId(helper.DataResourceIdsHash(ids))
264264

265265
output, ok := d.GetOk("result_output_file")
266266
if ok && output.(string) != "" {

0 commit comments

Comments
 (0)