@@ -62,6 +62,26 @@ func TestAccTencentCloudSsmSshKeyPairSecretResource_basic(t *testing.T) {
62
62
ImportStateVerify : true ,
63
63
ImportStateVerifyIgnore : []string {"clean_ssh_key" },
64
64
},
65
+ {
66
+ Config : testAccSsmSshKeyPairSecretNoName ,
67
+ Check : resource .ComposeTestCheckFunc (
68
+ resource .TestCheckResourceAttr ("tencentcloud_ssm_ssh_key_pair_secret.example2" , "description" , "desc." ),
69
+ resource .TestCheckResourceAttr ("tencentcloud_ssm_ssh_key_pair_secret.example2" , "status" , "Disabled" ),
70
+ ),
71
+ },
72
+ {
73
+ Config : testAccSsmSshKeyPairSecretNoNameUpdate ,
74
+ Check : resource .ComposeTestCheckFunc (
75
+ resource .TestCheckResourceAttr ("tencentcloud_ssm_ssh_key_pair_secret.example2" , "description" , "update desc." ),
76
+ resource .TestCheckResourceAttr ("tencentcloud_ssm_ssh_key_pair_secret.example2" , "status" , "Enabled" ),
77
+ ),
78
+ },
79
+ {
80
+ ResourceName : "tencentcloud_ssm_ssh_key_pair_secret.example2" ,
81
+ ImportState : true ,
82
+ ImportStateVerify : true ,
83
+ ImportStateVerifyIgnore : []string {"clean_ssh_key" },
84
+ },
65
85
},
66
86
})
67
87
}
@@ -149,3 +169,31 @@ resource "tencentcloud_ssm_ssh_key_pair_secret" "example1" {
149
169
}
150
170
}
151
171
`
172
+
173
+ const testAccSsmSshKeyPairSecretNoName = `
174
+ resource "tencentcloud_ssm_ssh_key_pair_secret" "example2" {
175
+ secret_name = "tf-example-ssh-test-no-id"
176
+ project_id = 0
177
+ description = "desc."
178
+ status = "Disabled"
179
+ clean_ssh_key = true
180
+
181
+ tags = {
182
+ createdBy = "terraform"
183
+ }
184
+ }
185
+ `
186
+
187
+ const testAccSsmSshKeyPairSecretNoNameUpdate = `
188
+ resource "tencentcloud_ssm_ssh_key_pair_secret" "example2" {
189
+ secret_name = "tf-example-ssh-test-no-id"
190
+ project_id = 0
191
+ description = "update desc."
192
+ status = "Enabled"
193
+ clean_ssh_key = true
194
+
195
+ tags = {
196
+ createdBy = "terraform"
197
+ }
198
+ }
199
+ `
0 commit comments