Skip to content

Commit 5d0838d

Browse files
andrew-txlyu571
authored andcommitted
docs: add changelog of version v1.81.36 (#2217)
1 parent fe764d2 commit 5d0838d

7 files changed

+953
-0
lines changed

.changelog/2219.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
```release-note:new-resource
2+
tencentcloud_css_common_mix
3+
```
4+
5+
```release-note:new-data-source
6+
tencentcloud_css_live_domain_cert
7+
```
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
/*
2+
Use this data source to query detailed information of css live_domain_cert
3+
4+
Example Usage
5+
6+
```hcl
7+
data "tencentcloud_css_live_domain_cert" "live_domain_cert" {
8+
domain_name = ""
9+
}
10+
```
11+
*/
12+
package tencentcloud
13+
14+
import (
15+
"context"
16+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
17+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
18+
css "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/live/v20180801"
19+
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
20+
)
21+
22+
func dataSourceTencentCloudCssLiveDomainCert() *schema.Resource {
23+
return &schema.Resource{
24+
Read: dataSourceTencentCloudCssLiveDomainCertRead,
25+
Schema: map[string]*schema.Schema{
26+
"domain_name": {
27+
Required: true,
28+
Type: schema.TypeString,
29+
Description: "Playback domain name.",
30+
},
31+
32+
"domain_cert_info": {
33+
Computed: true,
34+
Type: schema.TypeList,
35+
Description: "Certificate information.",
36+
Elem: &schema.Resource{
37+
Schema: map[string]*schema.Schema{
38+
"cert_id": {
39+
Type: schema.TypeInt,
40+
Computed: true,
41+
Description: "Certificate ID.",
42+
},
43+
"cert_name": {
44+
Type: schema.TypeString,
45+
Computed: true,
46+
Description: "Certificate name.",
47+
},
48+
"description": {
49+
Type: schema.TypeString,
50+
Computed: true,
51+
Description: "Description.",
52+
},
53+
"create_time": {
54+
Type: schema.TypeString,
55+
Computed: true,
56+
Description: "The creation time in UTC format.Note: Beijing time (UTC+8) is used.",
57+
},
58+
"https_crt": {
59+
Type: schema.TypeString,
60+
Computed: true,
61+
Description: "Certificate content.",
62+
},
63+
"cert_type": {
64+
Type: schema.TypeInt,
65+
Computed: true,
66+
Description: "Certificate type.0: user-added certificate1: Tencent Cloud-hosted certificate.",
67+
},
68+
"cert_expire_time": {
69+
Type: schema.TypeString,
70+
Computed: true,
71+
Description: "The certificate expiration time in UTC format.Note: Beijing time (UTC+8) is used.",
72+
},
73+
"domain_name": {
74+
Type: schema.TypeString,
75+
Computed: true,
76+
Description: "Domain name that uses this certificate.",
77+
},
78+
"status": {
79+
Type: schema.TypeInt,
80+
Computed: true,
81+
Description: "Certificate status.",
82+
},
83+
"cert_domains": {
84+
Type: schema.TypeSet,
85+
Elem: &schema.Schema{
86+
Type: schema.TypeString,
87+
},
88+
Computed: true,
89+
Description: "List of domain names in the certificate.[*.x.com] for example.Note: this field may return `null`, indicating that no valid values can be obtained.",
90+
},
91+
"cloud_cert_id": {
92+
Type: schema.TypeString,
93+
Computed: true,
94+
Description: "Tencent Cloud SSL certificate ID.Note: this field may return `null`, indicating that no valid values can be obtained.",
95+
},
96+
},
97+
},
98+
},
99+
100+
"result_output_file": {
101+
Type: schema.TypeString,
102+
Optional: true,
103+
Description: "Used to save results.",
104+
},
105+
},
106+
}
107+
}
108+
109+
func dataSourceTencentCloudCssLiveDomainCertRead(d *schema.ResourceData, meta interface{}) error {
110+
defer logElapsed("data_source.tencentcloud_css_live_domain_cert.read")()
111+
defer inconsistentCheck(d, meta)()
112+
113+
logId := getLogId(contextNil)
114+
115+
ctx := context.WithValue(context.TODO(), logIdKey, logId)
116+
117+
paramMap := make(map[string]interface{})
118+
if v, ok := d.GetOk("domain_name"); ok {
119+
paramMap["DomainName"] = helper.String(v.(string))
120+
}
121+
122+
service := CssService{client: meta.(*TencentCloudClient).apiV3Conn}
123+
124+
var domainCertInfo []*css.DomainCertInfo
125+
126+
err := resource.Retry(readRetryTimeout, func() *resource.RetryError {
127+
result, e := service.DescribeCssLiveDomainCertByFilter(ctx, paramMap)
128+
if e != nil {
129+
return retryError(e)
130+
}
131+
domainCertInfo = result
132+
return nil
133+
})
134+
if err != nil {
135+
return err
136+
}
137+
138+
ids := make([]string, 0, len(domainCertInfo))
139+
if domainCertInfo != nil {
140+
domainCertInfoMap := map[string]interface{}{}
141+
142+
if domainCertInfo.CertId != nil {
143+
domainCertInfoMap["cert_id"] = domainCertInfo.CertId
144+
}
145+
146+
if domainCertInfo.CertName != nil {
147+
domainCertInfoMap["cert_name"] = domainCertInfo.CertName
148+
}
149+
150+
if domainCertInfo.Description != nil {
151+
domainCertInfoMap["description"] = domainCertInfo.Description
152+
}
153+
154+
if domainCertInfo.CreateTime != nil {
155+
domainCertInfoMap["create_time"] = domainCertInfo.CreateTime
156+
}
157+
158+
if domainCertInfo.HttpsCrt != nil {
159+
domainCertInfoMap["https_crt"] = domainCertInfo.HttpsCrt
160+
}
161+
162+
if domainCertInfo.CertType != nil {
163+
domainCertInfoMap["cert_type"] = domainCertInfo.CertType
164+
}
165+
166+
if domainCertInfo.CertExpireTime != nil {
167+
domainCertInfoMap["cert_expire_time"] = domainCertInfo.CertExpireTime
168+
}
169+
170+
if domainCertInfo.DomainName != nil {
171+
domainCertInfoMap["domain_name"] = domainCertInfo.DomainName
172+
}
173+
174+
if domainCertInfo.Status != nil {
175+
domainCertInfoMap["status"] = domainCertInfo.Status
176+
}
177+
178+
if domainCertInfo.CertDomains != nil {
179+
domainCertInfoMap["cert_domains"] = domainCertInfo.CertDomains
180+
}
181+
182+
if domainCertInfo.CloudCertId != nil {
183+
domainCertInfoMap["cloud_cert_id"] = domainCertInfo.CloudCertId
184+
}
185+
186+
ids = append(ids, *domainCertInfo.CertId)
187+
_ = d.Set("domain_cert_info", domainCertInfoMap)
188+
}
189+
190+
d.SetId(helper.DataResourceIdsHash(ids))
191+
output, ok := d.GetOk("result_output_file")
192+
if ok && output.(string) != "" {
193+
if e := writeToFile(output.(string), domainCertInfoMap); e != nil {
194+
return e
195+
}
196+
}
197+
return nil
198+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package tencentcloud
2+
3+
import (
4+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
5+
"testing"
6+
)
7+
8+
func TestAccTencentCloudCssLiveDomainCertDataSource_basic(t *testing.T) {
9+
t.Parallel()
10+
resource.Test(t, resource.TestCase{
11+
PreCheck: func() {
12+
testAccPreCheck(t)
13+
},
14+
Providers: testAccProviders,
15+
Steps: []resource.TestStep{
16+
{
17+
Config: testAccCssLiveDomainCertDataSource,
18+
Check: resource.ComposeTestCheckFunc(testAccCheckTencentCloudDataSourceID("data.tencentcloud_css_live_domain_cert.live_domain_cert")),
19+
},
20+
},
21+
})
22+
}
23+
24+
const testAccCssLiveDomainCertDataSource = `
25+
26+
data "tencentcloud_css_live_domain_cert" "live_domain_cert" {
27+
domain_name = ""
28+
}
29+
30+
`

tencentcloud/provider.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,8 +1468,11 @@ Cloud Streaming Services(CSS)
14681468
tencentcloud_css_play_domain_cert_attachment
14691469
tencentcloud_css_play_auth_key_config
14701470
tencentcloud_css_push_auth_key_config
1471+
tencentcloud_css_common_mix
1472+
14711473
Data Source
14721474
tencentcloud_css_domains
1475+
tencentcloud_css_live_domain_cert
14731476
14741477
Performance Testing Service(PTS)
14751478
Data Source
@@ -2561,6 +2564,7 @@ func Provider() *schema.Provider {
25612564
"tencentcloud_cynosdb_proxy_node": dataSourceTencentCloudCynosdbProxyNode(),
25622565
"tencentcloud_cynosdb_proxy_version": dataSourceTencentCloudCynosdbProxyVersion(),
25632566
"tencentcloud_css_domains": dataSourceTencentCloudCssDomains(),
2567+
"tencentcloud_css_live_domain_cert": dataSourceTencentCloudCssLiveDomainCert(),
25642568
"tencentcloud_chdfs_access_groups": dataSourceTencentCloudChdfsAccessGroups(),
25652569
"tencentcloud_chdfs_mount_points": dataSourceTencentCloudChdfsMountPoints(),
25662570
"tencentcloud_chdfs_file_systems": dataSourceTencentCloudChdfsFileSystems(),
@@ -3256,6 +3260,7 @@ func Provider() *schema.Provider {
32563260
"tencentcloud_css_play_domain_cert_attachment": resourceTencentCloudCssPlayDomainCertAttachment(),
32573261
"tencentcloud_css_play_auth_key_config": resourceTencentCloudCssPlayAuthKeyConfig(),
32583262
"tencentcloud_css_push_auth_key_config": resourceTencentCloudCssPushAuthKeyConfig(),
3263+
"tencentcloud_css_common_mix": resourceTencentCloudCssCommonMix(),
32593264
"tencentcloud_pts_project": resourceTencentCloudPtsProject(),
32603265
"tencentcloud_pts_alert_channel": resourceTencentCloudPtsAlertChannel(),
32613266
"tencentcloud_pts_scenario": resourceTencentCloudPtsScenario(),

0 commit comments

Comments
 (0)