@@ -34,10 +34,16 @@ func TestAccTencentCloudCynosdbReadonlyInstanceResource(t *testing.T) {
3434 resource .TestCheckResourceAttrSet ("tencentcloud_cynosdb_readonly_instance.foo" , "instance_memory_size" ),
3535 resource .TestCheckResourceAttrSet ("tencentcloud_cynosdb_readonly_instance.foo" , "instance_status" ),
3636 resource .TestCheckResourceAttrSet ("tencentcloud_cynosdb_readonly_instance.foo" , "instance_storage_size" ),
37- resource .TestCheckResourceAttr ("tencentcloud_cynosdb_readonly_instance.foo" , "vpc_id" , "vpc-4owdpnwr " ),
38- resource .TestCheckResourceAttr ("tencentcloud_cynosdb_readonly_instance.foo" , "subnet_id" , "subnet-m4qpx38w " ),
37+ resource .TestCheckResourceAttr ("tencentcloud_cynosdb_readonly_instance.foo" , "vpc_id" , "vpc-m0d2dbnn " ),
38+ resource .TestCheckResourceAttr ("tencentcloud_cynosdb_readonly_instance.foo" , "subnet_id" , "subnet-j10lsueq " ),
3939 ),
4040 },
41+ {
42+ ResourceName : "tencentcloud_cynosdb_readonly_instance.foo" ,
43+ ImportState : true ,
44+ ImportStateVerify : true ,
45+ ImportStateVerifyIgnore : []string {"force_delete" },
46+ },
4147 {
4248 Config : testAccCynosdbReadonlyInstance_update ,
4349 Check : resource .ComposeTestCheckFunc (
@@ -48,12 +54,6 @@ func TestAccTencentCloudCynosdbReadonlyInstanceResource(t *testing.T) {
4854 resource .TestCheckResourceAttr ("tencentcloud_cynosdb_readonly_instance.foo" , "instance_memory_size" , "4" ),
4955 ),
5056 },
51- {
52- ResourceName : "tencentcloud_cynosdb_readonly_instance.foo" ,
53- ImportState : true ,
54- ImportStateVerify : true ,
55- ImportStateVerifyIgnore : []string {"force_delete" },
56- },
5757 },
5858 })
5959}
@@ -105,12 +105,24 @@ func testAccCheckCynosdbReadonlyInstanceExists(n string) resource.TestCheckFunc
105105}
106106
107107const readonlyInstanceVar = `
108+ variable "availability_zone" {
109+ default = "ap-guangzhou-3"
110+ }
111+
112+ variable "my_vpc" {
113+ default = "vpc-m0d2dbnn"
114+ }
115+
116+ variable "my_subnet" {
117+ default = "subnet-j10lsueq"
118+ }
119+
108120variable "readonly_subnet" {
109- default = "subnet-m4qpx38w "
121+ default = "subnet-j10lsueq "
110122}
111123`
112124
113- const testAccCynosdbReadonlyInstance = testAccCynosdbBasic + readonlyInstanceVar + `
125+ const testAccCynosdbReadonlyInstance = readonlyInstanceVar + `
114126resource "tencentcloud_cynosdb_cluster" "foo" {
115127 available_zone = var.availability_zone
116128 vpc_id = var.my_vpc
@@ -139,9 +151,9 @@ resource "tencentcloud_cynosdb_cluster" "foo" {
139151 current_value = "utf8"
140152 }
141153
142- # tags = {
143- # test = "test"
144- # }
154+ tags = {
155+ test = "test"
156+ }
145157
146158 force_delete = true
147159
@@ -173,7 +185,7 @@ resource "tencentcloud_cynosdb_readonly_instance" "foo" {
173185}
174186`
175187
176- const testAccCynosdbReadonlyInstance_update = testAccCynosdbBasic + `
188+ const testAccCynosdbReadonlyInstance_update = readonlyInstanceVar + `
177189resource "tencentcloud_cynosdb_cluster" "foo" {
178190 available_zone = var.availability_zone
179191 vpc_id = var.my_vpc
@@ -202,9 +214,9 @@ resource "tencentcloud_cynosdb_cluster" "foo" {
202214 current_value = "utf8"
203215 }
204216
205- # tags = {
206- # test = "test"
207- # }
217+ tags = {
218+ test = "test"
219+ }
208220
209221 force_delete = true
210222
0 commit comments