Skip to content

Commit fd70932

Browse files
gitmknanonymous
andauthored
fix: support dv_auths (#1993)
* fix: support dv_auths * feat: add changelog * fix: modify changelog --------- Co-authored-by: anonymous <anonymous@mail.org>
1 parent 3d0e5c4 commit fd70932

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

.changelog/1993.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
datasource/tencentcloud_ssl_certificates: Support querying `dv_auths` and `order_id`
3+
```

tencentcloud/data_source_tc_ssl_certificates.go

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,35 @@ func dataSourceTencentCloudSslCertificates() *schema.Resource {
121121
Computed: true,
122122
Description: "ALL domains included in the SSL certificate. Including the primary domain name.",
123123
},
124+
"order_id": {
125+
Type: schema.TypeString,
126+
Computed: true,
127+
Description: "Order ID returned.",
128+
},
129+
"dv_auths": {
130+
Type: schema.TypeList,
131+
Computed: true,
132+
Description: "DV certification information.",
133+
Elem: &schema.Resource{
134+
Schema: map[string]*schema.Schema{
135+
"dv_auth_key": {
136+
Type: schema.TypeString,
137+
Computed: true,
138+
Description: "DV authentication key.",
139+
},
140+
"dv_auth_value": {
141+
Type: schema.TypeString,
142+
Computed: true,
143+
Description: "DV authentication value.",
144+
},
145+
"dv_auth_verify_type": {
146+
Type: schema.TypeString,
147+
Computed: true,
148+
Description: "DV authentication type.",
149+
},
150+
},
151+
},
152+
},
124153
},
125154
},
126155
},
@@ -224,6 +253,22 @@ func dataSourceTencentCloudSslCertificatesRead(d *schema.ResourceData, m interfa
224253
if describeResponse.Response.CertificatePrivateKey != nil {
225254
m["key"] = *describeResponse.Response.CertificatePrivateKey
226255
}
256+
257+
if describeResponse.Response.OrderId != nil {
258+
m["order_id"] = *describeResponse.Response.OrderId
259+
}
260+
if describeResponse.Response.DvAuthDetail != nil && len(describeResponse.Response.DvAuthDetail.DvAuths) != 0 {
261+
dvAuths := make([]map[string]string, 0)
262+
for _, item := range describeResponse.Response.DvAuthDetail.DvAuths {
263+
dvAuth := make(map[string]string)
264+
dvAuth["dv_auth_key"] = *item.DvAuthKey
265+
dvAuth["dv_auth_value"] = *item.DvAuthValue
266+
dvAuth["dv_auth_verify_type"] = *item.DvAuthVerifyType
267+
dvAuths = append(dvAuths, dvAuth)
268+
}
269+
270+
m["dv_auths"] = dvAuths
271+
}
227272
}
228273

229274
certificates = append(certificates, m)

website/docs/d/ssl_certificates.html.markdown

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,15 @@ In addition to all arguments above, the following attributes are exported:
3737
* `cert` - Content of the SSL certificate.
3838
* `create_time` - Creation time of the SSL certificate.
3939
* `domain` - Primary domain of the SSL certificate.
40+
* `dv_auths` - DV certification information.
41+
* `dv_auth_key` - DV authentication key.
42+
* `dv_auth_value` - DV authentication value.
43+
* `dv_auth_verify_type` - DV authentication type.
4044
* `end_time` - Ending time of the SSL certificate.
4145
* `id` - ID of the SSL certificate.
4246
* `key` - Key of the SSL certificate.
4347
* `name` - Name of the SSL certificate.
48+
* `order_id` - Order ID returned.
4449
* `product_zh_name` - Certificate authority.
4550
* `project_id` - Project ID of the SSL certificate.
4651
* `status` - Status of the SSL certificate.

0 commit comments

Comments
 (0)