@@ -1031,6 +1031,64 @@ func TestAccInstance_ChangeVolumeType(t *testing.T) {
10311031 })
10321032}
10331033
1034+ func TestAccInstance_ChangeNodeType (t * testing.T ) {
1035+ tt := acctest .NewTestTools (t )
1036+ defer tt .Cleanup ()
1037+
1038+ latestEngineVersion := rdbchecks .GetLatestEngineVersion (tt , postgreSQLEngineName )
1039+
1040+ resource .ParallelTest (t , resource.TestCase {
1041+ PreCheck : func () { acctest .PreCheck (t ) },
1042+
1043+ ProviderFactories : tt .ProviderFactories ,
1044+ CheckDestroy : rdbchecks .IsInstanceDestroyed (tt ),
1045+ Steps : []resource.TestStep {
1046+ {
1047+ Config : fmt .Sprintf (`
1048+ resource scaleway_rdb_instance main {
1049+ name = "test-rdb-instance-volume"
1050+ node_type = "db-play2-pico"
1051+ engine = %q
1052+ is_ha_cluster = false
1053+ disable_backup = true
1054+ user_name = "my_initial_user"
1055+ password = "thiZ_is_v&ry_s3cret"
1056+ region= "nl-ams"
1057+ tags = [ "terraform-test", "scaleway_rdb_instance" ]
1058+ volume_type = "bssd"
1059+ volume_size_in_gb = 10
1060+ }
1061+ ` , latestEngineVersion ),
1062+ Check : resource .ComposeTestCheckFunc (
1063+ isInstancePresent (tt , "scaleway_rdb_instance.main" ),
1064+ resource .TestCheckResourceAttr ("scaleway_rdb_instance.main" , "node_type" , "db-play2-pico" ),
1065+ ),
1066+ },
1067+ {
1068+ Config : fmt .Sprintf (`
1069+ resource scaleway_rdb_instance main {
1070+ name = "test-rdb-instance-volume"
1071+ node_type = "db-play2-nano"
1072+ engine = %q
1073+ is_ha_cluster = false
1074+ disable_backup = true
1075+ user_name = "my_initial_user"
1076+ password = "thiZ_is_v&ry_s3cret"
1077+ region= "nl-ams"
1078+ tags = [ "terraform-test", "scaleway_rdb_instance"]
1079+ volume_type = "bssd"
1080+ volume_size_in_gb = 10
1081+ }
1082+ ` , latestEngineVersion ),
1083+ Check : resource .ComposeTestCheckFunc (
1084+ isInstancePresent (tt , "scaleway_rdb_instance.main" ),
1085+ resource .TestCheckResourceAttr ("scaleway_rdb_instance.main" , "node_type" , "db-play2-nano" ),
1086+ ),
1087+ },
1088+ },
1089+ })
1090+ }
1091+
10341092func TestAccInstance_Endpoints (t * testing.T ) {
10351093 tt := acctest .NewTestTools (t )
10361094 defer tt .Cleanup ()
0 commit comments