@@ -67,11 +67,36 @@ func dataSourceTencentCloudCdnDomains() *schema.Resource {
6767 Description : "An information list of cdn domain. Each element contains the following attributes:" ,
6868 Elem : & schema.Resource {
6969 Schema : map [string ]* schema.Schema {
70+ "resource_id" : {
71+ Type : schema .TypeString ,
72+ Computed : true ,
73+ Description : "Domain name ID." ,
74+ },
7075 "domain" : {
7176 Type : schema .TypeString ,
7277 Computed : true ,
7378 Description : "Acceleration domain name." ,
7479 },
80+ "cname" : {
81+ Type : schema .TypeString ,
82+ Computed : true ,
83+ Description : "CNAME address of domain name." ,
84+ },
85+ "status" : {
86+ Type : schema .TypeString ,
87+ Computed : true ,
88+ Description : "Acceleration service status." ,
89+ },
90+ "create_time" : {
91+ Type : schema .TypeString ,
92+ Computed : true ,
93+ Description : "Domain name creation time." ,
94+ },
95+ "update_time" : {
96+ Type : schema .TypeString ,
97+ Computed : true ,
98+ Description : "Last modified time of domain name." ,
99+ },
75100 "service_type" : {
76101 Type : schema .TypeString ,
77102 Computed : true ,
@@ -260,21 +285,28 @@ func dataSourceTencentCloudCdnDomainsRead(d *schema.ResourceData, meta interface
260285 origins = append (origins , origin )
261286
262287 httpsconfigs := make ([]map [string ]interface {}, 0 , 1 )
263- httpsConfig := make (map [string ]interface {}, 7 )
264- httpsConfig ["https_switch" ] = detailDomain .Https .Switch
265- httpsConfig ["http2_switch" ] = detailDomain .Https .Http2
266- httpsConfig ["ocsp_stapling_switch" ] = detailDomain .Https .OcspStapling
267- httpsConfig ["spdy_switch" ] = detailDomain .Https .Spdy
268- httpsConfig ["verify_client" ] = detailDomain .Https .VerifyClient
269- httpsconfigs = append (httpsconfigs , httpsConfig )
288+ if detailDomain .Https != nil {
289+ httpsConfig := make (map [string ]interface {}, 7 )
290+ httpsConfig ["https_switch" ] = detailDomain .Https .Switch
291+ httpsConfig ["http2_switch" ] = detailDomain .Https .Http2
292+ httpsConfig ["ocsp_stapling_switch" ] = detailDomain .Https .OcspStapling
293+ httpsConfig ["spdy_switch" ] = detailDomain .Https .Spdy
294+ httpsConfig ["verify_client" ] = detailDomain .Https .VerifyClient
295+ httpsconfigs = append (httpsconfigs , httpsConfig )
296+ }
270297
271298 tags , errRet := tagService .DescribeResourceTags (ctx , CDN_SERVICE_NAME , CDN_RESOURCE_NAME_DOMAIN , region , * detailDomain .Domain )
272299 if errRet != nil {
273300 return errRet
274301 }
275302
276303 mapping := map [string ]interface {}{
304+ "resource_id" : detailDomain .ResourceId ,
277305 "domain" : detailDomain .Domain ,
306+ "cname" : detailDomain .Cname ,
307+ "status" : detailDomain .Status ,
308+ "create_time" : detailDomain .CreateTime ,
309+ "update_time" : detailDomain .UpdateTime ,
278310 "service_type" : detailDomain .ServiceType ,
279311 "area" : detailDomain .Area ,
280312 "project_id" : detailDomain .ProjectId ,
0 commit comments