-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ssl): [119948410] Add SSL Check Certificate Domain Verification (#…
…2871) * add * add * add * add * add
- Loading branch information
1 parent
3773bdc
commit 3f57a48
Showing
17 changed files
with
2,309 additions
and
1,400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:new-resource | ||
tencentcloud_ssl_check_certificate_domain_verification_operation | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
147 changes: 147 additions & 0 deletions
147
tencentcloud/services/ssl/resource_tc_ssl_check_certificate_domain_verification_operation.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
...services/ssl/resource_tc_ssl_check_certificate_domain_verification_operation.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Provides a resource to create a ssl Check Certificate Domain Verification | ||
|
||
Example Usage | ||
|
||
```hcl | ||
resource "tencentcloud_ssl_check_certificate_domain_verification_operation" "example" { | ||
certificate_id = "6BE701Jx" | ||
} | ||
``` |
61 changes: 61 additions & 0 deletions
61
...services/ssl/resource_tc_ssl_check_certificate_domain_verification_operation_extension.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package ssl | ||
|
||
import ( | ||
"context" | ||
|
||
tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" | ||
|
||
sslv20191205 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl/v20191205" | ||
) | ||
|
||
func resourceTencentCloudSslCheckCertificateDomainVerificationOperationCreatePreHandleResponse0(ctx context.Context, resp *sslv20191205.CheckCertificateDomainVerificationResponse) error { | ||
d := tccommon.ResourceDataFromContext(ctx) | ||
|
||
response := resp.Response.VerificationResults | ||
tmpList := make([]map[string]interface{}, 0, len(response)) | ||
for _, item := range response { | ||
tmpObject := make(map[string]interface{}) | ||
if item.Domain != nil { | ||
tmpObject["domain"] = item.Domain | ||
} | ||
|
||
if item.VerifyType != nil { | ||
tmpObject["verify_type"] = item.VerifyType | ||
} | ||
|
||
if item.LocalCheck != nil { | ||
tmpObject["local_check"] = item.LocalCheck | ||
} | ||
|
||
if item.CaCheck != nil { | ||
tmpObject["ca_check"] = item.CaCheck | ||
} | ||
|
||
if item.LocalCheckFailReason != nil { | ||
tmpObject["local_check_fail_reason"] = item.LocalCheckFailReason | ||
} | ||
|
||
if item.CheckValue != nil { | ||
tmpValueList := make([]string, 0, len(item.CheckValue)) | ||
for _, v := range item.CheckValue { | ||
tmpValueList = append(tmpValueList, *v) | ||
} | ||
|
||
tmpObject["check_value"] = tmpValueList | ||
} | ||
|
||
if item.Frequently != nil { | ||
tmpObject["frequently"] = item.Frequently | ||
} | ||
|
||
if item.Issued != nil { | ||
tmpObject["issued"] = item.Issued | ||
} | ||
|
||
tmpList = append(tmpList, tmpObject) | ||
} | ||
|
||
_ = d.Set("verification_results", tmpList) | ||
|
||
return nil | ||
} |
36 changes: 36 additions & 0 deletions
36
...loud/services/ssl/resource_tc_ssl_check_certificate_domain_verification_operation_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package ssl_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" | ||
|
||
tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" | ||
) | ||
|
||
// go test -i; go test -test.run TestAccTencentCloudNeedFixSslCheckCertificateDomainVerificationOperationResource_basic -v | ||
func TestAccTencentCloudNeedFixSslCheckCertificateDomainVerificationOperationResource_basic(t *testing.T) { | ||
t.Parallel() | ||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { | ||
tcacctest.AccPreCheck(t) | ||
}, | ||
Providers: tcacctest.AccProviders, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccSslCheckCertificateDomainVerificationOperation, | ||
Check: resource.ComposeTestCheckFunc( | ||
resource.TestCheckResourceAttrSet("tencentcloud_ssl_check_certificate_domain_verification_operation.example", "id"), | ||
resource.TestCheckResourceAttrSet("tencentcloud_ssl_check_certificate_domain_verification_operation.example", "certificate_id"), | ||
), | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
const testAccSslCheckCertificateDomainVerificationOperation = ` | ||
resource "tencentcloud_ssl_check_certificate_domain_verification_operation" "example" { | ||
certificate_id = "6BE701Jx" | ||
} | ||
` |
2 changes: 1 addition & 1 deletion
2
vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.