Skip to content

Commit 0c44e46

Browse files
authored
fix: cynos ro testcases (#1137)
1 parent 104b451 commit 0c44e46

File tree

1 file changed

+80
-2
lines changed

1 file changed

+80
-2
lines changed

tencentcloud/resource_tc_cynosdb_readonly_instance_test.go

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,46 @@ func testAccCheckCynosdbReadonlyInstanceExists(n string) resource.TestCheckFunc
102102
}
103103
}
104104

105-
const testAccCynosdbReadonlyInstance = testAccCynosdbCluster + `
105+
const testAccCynosdbReadonlyInstance = testAccCynosdbBasic + `
106+
resource "tencentcloud_cynosdb_cluster" "foo" {
107+
available_zone = var.availability_zone
108+
vpc_id = var.my_vpc
109+
subnet_id = var.my_subnet
110+
db_type = "MYSQL"
111+
db_version = "5.7"
112+
storage_limit = 1000
113+
cluster_name = "tf-cynosdb"
114+
password = "cynos@123"
115+
instance_maintain_duration = 3600
116+
instance_maintain_start_time = 10800
117+
instance_maintain_weekdays = [
118+
"Fri",
119+
"Mon",
120+
"Sat",
121+
"Sun",
122+
"Thu",
123+
"Wed",
124+
"Tue",
125+
]
126+
127+
instance_cpu_core = 1
128+
instance_memory_size = 2
129+
param_items {
130+
name = "character_set_server"
131+
current_value = "utf8"
132+
}
133+
134+
# tags = {
135+
# test = "test"
136+
# }
137+
138+
force_delete = true
139+
140+
rw_group_sg = [
141+
"` + defaultSecurityGroup + `",
142+
]
143+
}
144+
106145
resource "tencentcloud_cynosdb_readonly_instance" "foo" {
107146
cluster_id = tencentcloud_cynosdb_cluster.foo.id
108147
instance_name = "tf-cynosdb-readonly-instance"
@@ -124,7 +163,46 @@ resource "tencentcloud_cynosdb_readonly_instance" "foo" {
124163
}
125164
`
126165

127-
const testAccCynosdbReadonlyInstance_update = testAccCynosdbCluster + `
166+
const testAccCynosdbReadonlyInstance_update = testAccCynosdbBasic + `
167+
resource "tencentcloud_cynosdb_cluster" "foo" {
168+
available_zone = var.availability_zone
169+
vpc_id = var.my_vpc
170+
subnet_id = var.my_subnet
171+
db_type = "MYSQL"
172+
db_version = "5.7"
173+
storage_limit = 1000
174+
cluster_name = "tf-cynosdb"
175+
password = "cynos@123"
176+
instance_maintain_duration = 3600
177+
instance_maintain_start_time = 10800
178+
instance_maintain_weekdays = [
179+
"Fri",
180+
"Mon",
181+
"Sat",
182+
"Sun",
183+
"Thu",
184+
"Wed",
185+
"Tue",
186+
]
187+
188+
instance_cpu_core = 1
189+
instance_memory_size = 2
190+
param_items {
191+
name = "character_set_server"
192+
current_value = "utf8"
193+
}
194+
195+
# tags = {
196+
# test = "test"
197+
# }
198+
199+
force_delete = true
200+
201+
rw_group_sg = [
202+
"` + defaultSecurityGroup + `",
203+
]
204+
}
205+
128206
resource "tencentcloud_cynosdb_readonly_instance" "foo" {
129207
cluster_id = tencentcloud_cynosdb_cluster.foo.id
130208
instance_name = "tf-cynosdb-readonly-instance"

0 commit comments

Comments
 (0)