Skip to content

Commit 302861b

Browse files
committed
feat/ssm
1 parent 5ac7cc9 commit 302861b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tencentcloud/resource_tc_ssm_ssh_key_pair_secret_test.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
package tencentcloud
22

33
import (
4+
"fmt"
45
"testing"
56

7+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
68
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
79
)
810

911
// go test -i; go test -test.run TestAccTencentCloudSsmSshKeyPairSecretResource_basic -v
1012
func TestAccTencentCloudSsmSshKeyPairSecretResource_basic(t *testing.T) {
1113
t.Parallel()
14+
rName := fmt.Sprintf("tf-testacc-kms-key-%s", acctest.RandString(13))
1215
resource.Test(t, resource.TestCase{
1316
PreCheck: func() {
1417
testAccPreCheck(t)
1518
},
1619
Providers: testAccProviders,
1720
Steps: []resource.TestStep{
1821
{
19-
Config: testAccSsmSshKeyPairSecret,
22+
Config: fmt.Sprintf(testAccSsmSshKeyPairSecret, rName),
2023
Check: resource.ComposeTestCheckFunc(
2124
resource.TestCheckResourceAttr("tencentcloud_ssm_ssh_key_pair_secret.example", "description", "desc."),
2225
resource.TestCheckResourceAttr("tencentcloud_ssm_ssh_key_pair_secret.example", "status", "Disabled"),
2326
),
2427
},
2528
{
26-
Config: testAccSsmSshKeyPairSecretUpdate,
29+
Config: fmt.Sprintf(testAccSsmSshKeyPairSecretUpdate, rName),
2730
Check: resource.ComposeTestCheckFunc(
2831
resource.TestCheckResourceAttr("tencentcloud_ssm_ssh_key_pair_secret.example", "description", "update desc."),
2932
resource.TestCheckResourceAttr("tencentcloud_ssm_ssh_key_pair_secret.example", "status", "Enabled"),
@@ -41,7 +44,7 @@ func TestAccTencentCloudSsmSshKeyPairSecretResource_basic(t *testing.T) {
4144

4245
const testAccSsmSshKeyPairSecret = `
4346
resource "tencentcloud_kms_key" "example" {
44-
alias = "tf-example-kms-key-test"
47+
alias = "%s"
4548
description = "example of kms key"
4649
key_rotation_enabled = false
4750
is_enabled = true
@@ -68,7 +71,7 @@ resource "tencentcloud_ssm_ssh_key_pair_secret" "example" {
6871

6972
const testAccSsmSshKeyPairSecretUpdate = `
7073
resource "tencentcloud_kms_key" "example" {
71-
alias = "tf-example-kms-key-test"
74+
alias = "%s"
7275
description = "example of kms key"
7376
key_rotation_enabled = false
7477
is_enabled = true

0 commit comments

Comments
 (0)