diff --git a/tencentcloud/resource_tc_ssl_free_certificate.go b/tencentcloud/resource_tc_ssl_free_certificate.go index 82acba3fea..f896aba470 100644 --- a/tencentcloud/resource_tc_ssl_free_certificate.go +++ b/tencentcloud/resource_tc_ssl_free_certificate.go @@ -54,8 +54,7 @@ func resourceTencentCloudSSLFreeCertificate() *schema.Resource { "dv_auth_method": { Type: schema.TypeString, Required: true, - ForceNew: true, - Description: "Specify DV authorize method, available values: `DNS_AUTO` - automatic DNS auth, `DNS` - manual DNS auth, `FILE` - auth by file.", + Description: "Specify DV authorize method. Available values: `DNS_AUTO` - automatic DNS auth, `DNS` - manual DNS auth, `FILE` - auth by file.", }, "domain": { Type: schema.TypeString, @@ -203,6 +202,10 @@ func resourceTencentCloudFreeCertificateRead(d *schema.ResourceData, meta interf d.SetId(id) + if detail.VerifyType != nil { + _ = d.Set("dv_auth_method", detail.VerifyType) + } + if detail.Domain != nil { _ = d.Set("domain", detail.Domain) } @@ -362,6 +365,7 @@ func resourceTencentCloudFreeCertificateUpdate(d *schema.ResourceData, meta inte } immutableFields := []string{ + "dv_auth_method", "package_type", "contact_email", "contact_phone", diff --git a/tencentcloud/resource_tc_ssl_free_certificate_test.go b/tencentcloud/resource_tc_ssl_free_certificate_test.go index c59d7d8f2e..6d1a7f250b 100644 --- a/tencentcloud/resource_tc_ssl_free_certificate_test.go +++ b/tencentcloud/resource_tc_ssl_free_certificate_test.go @@ -70,6 +70,11 @@ func TestAccTencentCloudNeedFixSSLFreeCertificate(t *testing.T) { resource.TestCheckResourceAttrSet("tencentcloud_ssl_free_certificate.foo", "domain"), ), }, + { + ImportState: true, + ImportStateVerify: true, + ResourceName: "tencentcloud_ssl_free_certificate.foo", + }, }, }) } diff --git a/website/docs/r/ssl_free_certificate.html.markdown b/website/docs/r/ssl_free_certificate.html.markdown index a8c6acd20c..5f1758e05e 100644 --- a/website/docs/r/ssl_free_certificate.html.markdown +++ b/website/docs/r/ssl_free_certificate.html.markdown @@ -35,7 +35,7 @@ resource "tencentcloud_ssl_free_certificate" "foo" { The following arguments are supported: * `domain` - (Required, String, ForceNew) Specify domain name. -* `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. +* `dv_auth_method` - (Required, String) Specify DV authorize method. Available values: `DNS_AUTO` - automatic DNS auth, `DNS` - manual DNS auth, `FILE` - auth by file. * `alias` - (Optional, String) Specify alias for remark. * `contact_email` - (Optional, String) Email address. * `contact_phone` - (Optional, String) Phone number.