@@ -877,6 +877,124 @@ func TestAccScalewayRdbInstance_Volume(t *testing.T) {
877877 })
878878}
879879
880+ func TestAccScalewayRdbInstance_SBSVolume (t * testing.T ) {
881+ tt := NewTestTools (t )
882+ defer tt .Cleanup ()
883+
884+ latestEngineVersion := testAccCheckScalewayRdbEngineGetLatestVersion (tt , postgreSQLEngineName )
885+
886+ resource .ParallelTest (t , resource.TestCase {
887+ PreCheck : func () { testAccPreCheck (t ) },
888+ ProviderFactories : tt .ProviderFactories ,
889+ CheckDestroy : testAccCheckScalewayRdbInstanceDestroy (tt ),
890+ Steps : []resource.TestStep {
891+ {
892+ Config : fmt .Sprintf (`
893+ resource scaleway_rdb_instance main {
894+ name = "test-rdb-instance-volume"
895+ node_type = "db-play2-pico"
896+ engine = %q
897+ is_ha_cluster = false
898+ disable_backup = true
899+ user_name = "my_initial_user"
900+ password = "thiZ_is_v&ry_s3cret"
901+ region= "nl-ams"
902+ tags = [ "terraform-test", "scaleway_rdb_instance", "sdb-volume" ]
903+ volume_type = "sbs_5k"
904+ volume_size_in_gb = 10
905+ }
906+ ` , latestEngineVersion ),
907+ Check : resource .ComposeTestCheckFunc (
908+ testAccCheckScalewayRdbExists (tt , "scaleway_rdb_instance.main" ),
909+ resource .TestCheckResourceAttr ("scaleway_rdb_instance.main" , "volume_type" , "sbs_5k" ),
910+ resource .TestCheckResourceAttr ("scaleway_rdb_instance.main" , "volume_size_in_gb" , "10" ),
911+ ),
912+ },
913+ {
914+ Config : fmt .Sprintf (`
915+ resource scaleway_rdb_instance main {
916+ name = "test-rdb-instance-volume"
917+ node_type = "db-play2-pico"
918+ engine = %q
919+ is_ha_cluster = false
920+ disable_backup = true
921+ user_name = "my_initial_user"
922+ password = "thiZ_is_v&ry_s3cret"
923+ region= "nl-ams"
924+ tags = [ "terraform-test", "scaleway_rdb_instance", "volume" ]
925+ volume_type = "sbs_5k"
926+ volume_size_in_gb = 20
927+ }
928+ ` , latestEngineVersion ),
929+ Check : resource .ComposeTestCheckFunc (
930+ testAccCheckScalewayRdbExists (tt , "scaleway_rdb_instance.main" ),
931+ resource .TestCheckResourceAttr ("scaleway_rdb_instance.main" , "volume_type" , "sbs_5k" ),
932+ resource .TestCheckResourceAttr ("scaleway_rdb_instance.main" , "volume_size_in_gb" , "20" ),
933+ ),
934+ },
935+ },
936+ })
937+ }
938+
939+ func TestAccScalewayRdbInstance_ChangeVolumeType (t * testing.T ) {
940+ tt := NewTestTools (t )
941+ defer tt .Cleanup ()
942+
943+ latestEngineVersion := testAccCheckScalewayRdbEngineGetLatestVersion (tt , postgreSQLEngineName )
944+
945+ resource .ParallelTest (t , resource.TestCase {
946+ PreCheck : func () { testAccPreCheck (t ) },
947+ ProviderFactories : tt .ProviderFactories ,
948+ CheckDestroy : testAccCheckScalewayRdbInstanceDestroy (tt ),
949+ Steps : []resource.TestStep {
950+ {
951+ Config : fmt .Sprintf (`
952+ resource scaleway_rdb_instance main {
953+ name = "test-rdb-instance-volume"
954+ node_type = "db-play2-pico"
955+ engine = %q
956+ is_ha_cluster = false
957+ disable_backup = true
958+ user_name = "my_initial_user"
959+ password = "thiZ_is_v&ry_s3cret"
960+ region= "nl-ams"
961+ tags = [ "terraform-test", "scaleway_rdb_instance", "sdb-volume" ]
962+ volume_type = "bssd"
963+ volume_size_in_gb = 10
964+ }
965+ ` , latestEngineVersion ),
966+ Check : resource .ComposeTestCheckFunc (
967+ testAccCheckScalewayRdbExists (tt , "scaleway_rdb_instance.main" ),
968+ resource .TestCheckResourceAttr ("scaleway_rdb_instance.main" , "volume_type" , "bssd" ),
969+ resource .TestCheckResourceAttr ("scaleway_rdb_instance.main" , "volume_size_in_gb" , "10" ),
970+ ),
971+ },
972+ {
973+ Config : fmt .Sprintf (`
974+ resource scaleway_rdb_instance main {
975+ name = "test-rdb-instance-volume"
976+ node_type = "db-play2-pico"
977+ engine = %q
978+ is_ha_cluster = false
979+ disable_backup = true
980+ user_name = "my_initial_user"
981+ password = "thiZ_is_v&ry_s3cret"
982+ region= "nl-ams"
983+ tags = [ "terraform-test", "scaleway_rdb_instance", "volume" ]
984+ volume_type = "sbs_5k"
985+ volume_size_in_gb = 20
986+ }
987+ ` , latestEngineVersion ),
988+ Check : resource .ComposeTestCheckFunc (
989+ testAccCheckScalewayRdbExists (tt , "scaleway_rdb_instance.main" ),
990+ resource .TestCheckResourceAttr ("scaleway_rdb_instance.main" , "volume_type" , "sbs_5k" ),
991+ resource .TestCheckResourceAttr ("scaleway_rdb_instance.main" , "volume_size_in_gb" , "20" ),
992+ ),
993+ },
994+ },
995+ })
996+ }
997+
880998func TestAccScalewayRdbInstance_Endpoints (t * testing.T ) {
881999 tt := NewTestTools (t )
8821000 defer tt .Cleanup ()
0 commit comments