@@ -22,6 +22,7 @@ import (
2222 "github.com/hashicorp/terraform-plugin-sdk/helper/resource"
2323 "github.com/hashicorp/terraform-plugin-sdk/helper/schema"
2424 cdn "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn/v20180606"
25+ "github.com/terraform-providers/terraform-provider-tencentcloud/tencentcloud/internal/helper"
2526)
2627
2728func dataSourceTencentCloudCdnDomains () * schema.Resource {
@@ -266,6 +267,7 @@ func dataSourceTencentCloudCdnDomainsRead(d *schema.ResourceData, meta interface
266267 }
267268
268269 cdnDomainList := make ([]map [string ]interface {}, 0 , len (domainConfigs ))
270+ ids := make ([]string , 0 , len (domainConfigs ))
269271 for _ , detailDomain := range domainConfigs {
270272 var fullUrlCache bool
271273 if detailDomain .CacheKey != nil && * detailDomain .CacheKey .FullUrlCache == CDN_SWITCH_ON {
@@ -317,8 +319,10 @@ func dataSourceTencentCloudCdnDomainsRead(d *schema.ResourceData, meta interface
317319 }
318320
319321 cdnDomainList = append (cdnDomainList , mapping )
322+ ids = append (ids , * detailDomain .ResourceId )
320323 }
321324
325+ d .SetId (helper .DataResourceIdsHash (ids ))
322326 err = d .Set ("domain_list" , cdnDomainList )
323327 if err != nil {
324328 log .Printf ("[CRITAL]%s provider set cdn domain list fail, reason:%s\n " , logId , err .Error ())
0 commit comments