@@ -95,6 +95,30 @@ func testSweepMySQLInstance(region string) error {
9595 return nil
9696}
9797
98+ func TestAccTencentCloudMysqlInstanceResource_prepaid (t * testing.T ) {
99+ resource .Test (t , resource.TestCase {
100+ PreCheck : func () { testAccPreCheckCommon (t , ACCOUNT_TYPE_PREPAY ) },
101+ Providers : testAccProviders ,
102+ CheckDestroy : testAccCheckMysqlMasterInstanceDestroy ,
103+ Steps : []resource.TestStep {
104+ {
105+ Config : testAccMySQLPrepaid ,
106+ Check : resource .ComposeTestCheckFunc (
107+ testAccCheckMysqlMasterInstanceExists ("tencentcloud_mysql_instance.prepaid" ),
108+ resource .TestCheckResourceAttrSet ("tencentcloud_mysql_instance.prepaid" , "id" ),
109+ resource .TestCheckResourceAttr ("tencentcloud_mysql_instance.prepaid" , "charge_type" , "PREPAID" ),
110+ ),
111+ },
112+ {
113+ ResourceName : "tencentcloud_mysql_instance.prepaid" ,
114+ ImportState : true ,
115+ ImportStateVerify : true ,
116+ ImportStateVerifyIgnore : []string {"root_password" , "prepaid_period" , "first_slave_zone" , "force_delete" , "param_template_id" , "fast_upgrade" },
117+ },
118+ },
119+ })
120+ }
121+
98122func TestAccTencentCloudMysqlInstanceResource_DeviceType (t * testing.T ) {
99123 resource .Test (t , resource.TestCase {
100124 PreCheck : func () { testAccPreCheck (t ) },
@@ -306,6 +330,22 @@ func testAccCheckMysqlMasterInstanceExists(n string) resource.TestCheckFunc {
306330 }
307331}
308332
333+ const testAccMySQLPrepaid = `
334+ resource "tencentcloud_mysql_instance" "prepaid" {
335+ charge_type = "PREPAID"
336+ prepaid_period = 1
337+ mem_size = 2000
338+ volume_size = 30
339+ instance_name = "testAccMysqlPrepaid"
340+ engine_version = "5.7"
341+ intranet_port = 3360
342+ root_password = "test1234"
343+ availability_zone = "ap-guangzhou-3"
344+ first_slave_zone = "ap-guangzhou-3"
345+ force_delete = true
346+ }
347+ `
348+
309349const testAccMySQLDeviceType = `
310350variable "temporary_param_tmpl_id" {
311351 default = 16954
0 commit comments