Skip to content

Commit 78bc684

Browse files
KagashinoKGSN
andauthored
fix: free ssl - set auth method readable (#1302)
* fix: free ssl - set auth method optional but required when creating * fix: free ssl - add dv_auth_method update * fix: free ssl - reset auth method to required Co-authored-by: KGSN <kgsn@p_payhuang-NB0.tencent.com>
1 parent be84aaa commit 78bc684

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

tencentcloud/resource_tc_ssl_free_certificate.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ func resourceTencentCloudSSLFreeCertificate() *schema.Resource {
5454
"dv_auth_method": {
5555
Type: schema.TypeString,
5656
Required: true,
57-
ForceNew: true,
58-
Description: "Specify DV authorize method, available values: `DNS_AUTO` - automatic DNS auth, `DNS` - manual DNS auth, `FILE` - auth by file.",
57+
Description: "Specify DV authorize method. Available values: `DNS_AUTO` - automatic DNS auth, `DNS` - manual DNS auth, `FILE` - auth by file.",
5958
},
6059
"domain": {
6160
Type: schema.TypeString,
@@ -203,6 +202,10 @@ func resourceTencentCloudFreeCertificateRead(d *schema.ResourceData, meta interf
203202

204203
d.SetId(id)
205204

205+
if detail.VerifyType != nil {
206+
_ = d.Set("dv_auth_method", detail.VerifyType)
207+
}
208+
206209
if detail.Domain != nil {
207210
_ = d.Set("domain", detail.Domain)
208211
}
@@ -362,6 +365,7 @@ func resourceTencentCloudFreeCertificateUpdate(d *schema.ResourceData, meta inte
362365
}
363366

364367
immutableFields := []string{
368+
"dv_auth_method",
365369
"package_type",
366370
"contact_email",
367371
"contact_phone",

tencentcloud/resource_tc_ssl_free_certificate_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ func TestAccTencentCloudNeedFixSSLFreeCertificate(t *testing.T) {
7070
resource.TestCheckResourceAttrSet("tencentcloud_ssl_free_certificate.foo", "domain"),
7171
),
7272
},
73+
{
74+
ImportState: true,
75+
ImportStateVerify: true,
76+
ResourceName: "tencentcloud_ssl_free_certificate.foo",
77+
},
7378
},
7479
})
7580
}

website/docs/r/ssl_free_certificate.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ resource "tencentcloud_ssl_free_certificate" "foo" {
3535
The following arguments are supported:
3636

3737
* `domain` - (Required, String, ForceNew) Specify domain name.
38-
* `dv_auth_method` - (Required, String, ForceNew) Specify DV authorize method, available values: `DNS_AUTO` - automatic DNS auth, `DNS` - manual DNS auth, `FILE` - auth by file.
38+
* `dv_auth_method` - (Required, String) Specify DV authorize method. Available values: `DNS_AUTO` - automatic DNS auth, `DNS` - manual DNS auth, `FILE` - auth by file.
3939
* `alias` - (Optional, String) Specify alias for remark.
4040
* `contact_email` - (Optional, String) Email address.
4141
* `contact_phone` - (Optional, String) Phone number.

0 commit comments

Comments
 (0)