Skip to content

Commit 78d3157

Browse files
authored
fix(rdb): drop bssd references from documentation and tests (#3047)
1 parent a1a5c53 commit 78d3157

15 files changed

+4759
-11880
lines changed

docs/resources/rdb_instance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ interruption.
143143

144144
~> **Important** Updates to `engine` will recreate the Database Instance.
145145

146-
- `volume_type` - (Optional, default to `lssd`) Type of volume where data are stored (`bssd`, `lssd`, `sbs_5k` or `sbs_15k`).
146+
- `volume_type` - (Optional, default to `lssd`) Type of volume where data are stored (`lssd`, `sbs_5k` or `sbs_15k`).
147147

148148
- `volume_size_in_gb` - (Optional) Volume size (in GB). Cannot be used when `volume_type` is set to `lssd`.
149149

docs/resources/rdb_snapshot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ resource "scaleway_rdb_instance" "main" {
2323
user_name = "my_initial_user"
2424
password = "thiZ_is_v&ry_s3cret"
2525
tags = ["terraform-test", "scaleway_rdb_instance", "minimal"]
26-
volume_type = "bssd"
26+
volume_type = "sbs_5k"
2727
volume_size_in_gb = 10
2828
}
2929

internal/services/rdb/instance.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ func ResourceRdbInstanceUpdate(ctx context.Context, d *schema.ResourceData, m in
677677
// Volume type and size
678678
if d.HasChanges("volume_type", "volume_size_in_gb") {
679679
switch volType {
680-
case rdb.VolumeTypeBssd, rdb.VolumeTypeSbs5k, rdb.VolumeTypeSbs15k:
680+
case rdb.VolumeTypeSbs5k, rdb.VolumeTypeSbs15k:
681681
if d.HasChange("volume_type") {
682682
upgradeInstanceRequests = append(upgradeInstanceRequests,
683683
rdb.UpgradeInstanceRequest{
@@ -710,7 +710,7 @@ func ResourceRdbInstanceUpdate(ctx context.Context, d *schema.ResourceData, m in
710710
case rdb.VolumeTypeLssd:
711711
_, ok := d.GetOk("volume_size_in_gb")
712712
if d.HasChange("volume_size_in_gb") && ok {
713-
return diag.FromErr(fmt.Errorf("volume_size_in_gb should be used with volume_type %s only", rdb.VolumeTypeBssd.String()))
713+
return diag.FromErr(fmt.Errorf("volume_size_in_gb should be used with volume_type %s or %s only", rdb.VolumeTypeSbs5k.String(), rdb.VolumeTypeSbs15k.String()))
714714
}
715715

716716
if d.HasChange("volume_type") {
@@ -730,21 +730,19 @@ func ResourceRdbInstanceUpdate(ctx context.Context, d *schema.ResourceData, m in
730730
if d.HasChange("node_type") {
731731
// Upgrading the node_type with block storage is not allowed when the disk is full, so if we are in this case,
732732
// we can only allow this action if an increase of the size of the volume is also scheduled before it.
733-
if !diskIsFull || volType == rdb.VolumeTypeLssd || len(upgradeInstanceRequests) > 0 {
733+
if !diskIsFull || len(upgradeInstanceRequests) > 0 {
734734
upgradeInstanceRequests = append(upgradeInstanceRequests,
735735
rdb.UpgradeInstanceRequest{
736736
Region: region,
737737
InstanceID: ID,
738738
NodeType: types.ExpandStringPtr(d.Get("node_type")),
739739
})
740740
} else {
741-
return diag.Diagnostics{
742-
{
743-
Severity: diag.Error,
744-
Summary: "Node type upgrade forbidden when disk is full",
745-
Detail: "You cannot upgrade the node_type of an instance that is using bssd storage once it is in disk_full state. Please increase the volume_size_in_gb first.",
746-
},
747-
}
741+
return diag.Diagnostics{{
742+
Severity: diag.Error,
743+
Summary: "Node type upgrade forbidden when disk is full",
744+
Detail: "You cannot upgrade the node_type of an instance when it is in disk_full state. Please increase the volume_size_in_gb first.",
745+
}}
748746
}
749747
}
750748

internal/services/rdb/instance_test.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ func TestAccInstance_PrivateNetworkUpdate(t *testing.T) {
343343
user_name = "my_initial_user"
344344
password = "thiZ_is_v&ry_s3cret"
345345
tags = [ "terraform-test", "scaleway_rdb_instance", "volume", "rdb_pn" ]
346-
volume_type = "bssd"
346+
volume_type = "sbs_5k"
347347
volume_size_in_gb = 10
348348
private_network {
349349
pn_id = "${scaleway_vpc_private_network.pn01.id}"
@@ -378,7 +378,7 @@ func TestAccInstance_PrivateNetworkUpdate(t *testing.T) {
378378
user_name = "my_initial_user"
379379
password = "thiZ_is_v&ry_s3cret"
380380
tags = [ "terraform-test", "scaleway_rdb_instance", "volume", "rdb_pn" ]
381-
volume_type = "bssd"
381+
volume_type = "sbs_5k"
382382
volume_size_in_gb = 10
383383
private_network {
384384
pn_id = "${scaleway_vpc_private_network.pn02.id}"
@@ -419,7 +419,7 @@ func TestAccInstance_PrivateNetworkUpdate(t *testing.T) {
419419
user_name = "my_initial_user"
420420
password = "thiZ_is_v&ry_s3cret"
421421
tags = [ "terraform-test", "scaleway_rdb_instance", "volume", "rdb_pn" ]
422-
volume_type = "bssd"
422+
volume_type = "sbs_5k"
423423
volume_size_in_gb = 10`, latestEngineVersion) + `
424424
private_network {
425425
ip_net = format("%s/%s", local.ip_address, local.cidr_prefix)
@@ -458,7 +458,7 @@ func TestAccInstance_PrivateNetworkUpdate(t *testing.T) {
458458
user_name = "my_initial_user"
459459
password = "thiZ_is_v&ry_s3cret"
460460
tags = [ "terraform-test", "scaleway_rdb_instance", "volume", "rdb_pn" ]
461-
volume_type = "bssd"
461+
volume_type = "sbs_5k"
462462
volume_size_in_gb = 10`, latestEngineVersion) + `
463463
private_network {
464464
ip_net = format("%s/%s", local.ip_address, local.cidr_prefix)
@@ -490,7 +490,7 @@ func TestAccInstance_PrivateNetworkUpdate(t *testing.T) {
490490
user_name = "my_initial_user"
491491
password = "thiZ_is_v&ry_s3cret"
492492
tags = [ "terraform-test", "scaleway_rdb_instance", "volume", "rdb_pn" ]
493-
volume_type = "bssd"
493+
volume_type = "sbs_5k"
494494
volume_size_in_gb = 10`, latestEngineVersion) + `
495495
private_network {
496496
pn_id = scaleway_vpc_private_network.pn01.id
@@ -588,7 +588,7 @@ func TestAccInstance_PrivateNetwork(t *testing.T) {
588588
password = "thiZ_is_v&ry_s3cret"
589589
region = "nl-ams"
590590
tags = ["terraform-test", "scaleway_rdb_instance", "volume", "rdb_pn"]
591-
volume_type = "bssd"
591+
volume_type = "sbs_5k"
592592
volume_size_in_gb = 10
593593
private_network {
594594
ip_net = "192.168.1.254/24" #pool high
@@ -627,7 +627,7 @@ func TestAccInstance_PrivateNetwork(t *testing.T) {
627627
password = "thiZ_is_v&ry_s3cret"
628628
region = "nl-ams"
629629
tags = ["terraform-test", "scaleway_rdb_instance", "volume", "rdb_pn"]
630-
volume_type = "bssd"
630+
volume_type = "sbs_5k"
631631
volume_size_in_gb = 10
632632
}
633633
`, latestEngineVersion),
@@ -718,13 +718,13 @@ func TestAccInstance_Volume(t *testing.T) {
718718
password = "thiZ_is_v&ry_s3cret"
719719
region= "nl-ams"
720720
tags = [ "terraform-test", "scaleway_rdb_instance", "volume" ]
721-
volume_type = "bssd"
721+
volume_type = "sbs_5k"
722722
volume_size_in_gb = 10
723723
}
724724
`, latestEngineVersion),
725725
Check: resource.ComposeTestCheckFunc(
726726
isInstancePresent(tt, "scaleway_rdb_instance.main"),
727-
resource.TestCheckResourceAttr("scaleway_rdb_instance.main", "volume_type", "bssd"),
727+
resource.TestCheckResourceAttr("scaleway_rdb_instance.main", "volume_type", "sbs_5k"),
728728
resource.TestCheckResourceAttr("scaleway_rdb_instance.main", "volume_size_in_gb", "10"),
729729
),
730730
},
@@ -855,13 +855,13 @@ func TestAccInstance_ChangeVolumeType(t *testing.T) {
855855
password = "thiZ_is_v&ry_s3cret"
856856
region= "nl-ams"
857857
tags = [ "terraform-test", "scaleway_rdb_instance", "sdb-volume" ]
858-
volume_type = "bssd"
858+
volume_type = "sbs_5k"
859859
volume_size_in_gb = 10
860860
}
861861
`, latestEngineVersion),
862862
Check: resource.ComposeTestCheckFunc(
863863
isInstancePresent(tt, "scaleway_rdb_instance.main"),
864-
resource.TestCheckResourceAttr("scaleway_rdb_instance.main", "volume_type", "bssd"),
864+
resource.TestCheckResourceAttr("scaleway_rdb_instance.main", "volume_type", "sbs_5k"),
865865
resource.TestCheckResourceAttr("scaleway_rdb_instance.main", "volume_size_in_gb", "10"),
866866
),
867867
},
@@ -915,7 +915,7 @@ func TestAccInstance_ChangeNodeType(t *testing.T) {
915915
password = "thiZ_is_v&ry_s3cret"
916916
region= "nl-ams"
917917
tags = [ "terraform-test", "scaleway_rdb_instance" ]
918-
volume_type = "bssd"
918+
volume_type = "sbs_5k"
919919
volume_size_in_gb = 10
920920
}
921921
`, latestEngineVersion),
@@ -936,7 +936,7 @@ func TestAccInstance_ChangeNodeType(t *testing.T) {
936936
password = "thiZ_is_v&ry_s3cret"
937937
region= "nl-ams"
938938
tags = [ "terraform-test", "scaleway_rdb_instance"]
939-
volume_type = "bssd"
939+
volume_type = "sbs_5k"
940940
volume_size_in_gb = 10
941941
}
942942
`, latestEngineVersion),
@@ -1220,7 +1220,7 @@ func TestAccInstance_CompleteWorkflow(t *testing.T) {
12201220
user_name = "my_initial_user"
12211221
password = "thiZ_is_v&ry_s3cret"
12221222
tags = ["terraform-test", "scaleway_rdb_instance"]
1223-
volume_type = "bssd"
1223+
volume_type = "sbs_5k"
12241224
volume_size_in_gb = 10
12251225
}
12261226
@@ -1236,7 +1236,7 @@ func TestAccInstance_CompleteWorkflow(t *testing.T) {
12361236
is_ha_cluster = false
12371237
disable_backup = true
12381238
snapshot_id = scaleway_rdb_snapshot.test.id
1239-
volume_type = "bssd"
1239+
volume_type = "sbs_5k"
12401240
tags = ["terraform-test", "restored_instance"]
12411241
depends_on = [scaleway_rdb_snapshot.test]
12421242
}
@@ -1260,7 +1260,7 @@ func TestAccInstance_CompleteWorkflow(t *testing.T) {
12601260
user_name = "my_initial_user"
12611261
password = "thiZ_is_v&ry_s3cret"
12621262
tags = ["terraform-test", "scaleway_rdb_instance"]
1263-
volume_type = "bssd"
1263+
volume_type = "sbs_5k"
12641264
volume_size_in_gb = 10
12651265
}
12661266
@@ -1276,7 +1276,7 @@ func TestAccInstance_CompleteWorkflow(t *testing.T) {
12761276
is_ha_cluster = false
12771277
disable_backup = true
12781278
snapshot_id = scaleway_rdb_snapshot.test.id
1279-
volume_type = "bssd"
1279+
volume_type = "sbs_5k"
12801280
user_name = "updated_user"
12811281
password = "thiZ_is_v&ry_s3cret2"
12821282
tags = ["terraform-test", "updated_instance"]

internal/services/rdb/snapshots_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func TestAccRdbSnapshot_Basic(t *testing.T) {
3535
user_name = "my_initial_user"
3636
password = "thiZ_is_v&ry_s3cret"
3737
tags = ["terraform-test", "scaleway_rdb_instance", "minimal"]
38-
volume_type = "bssd"
38+
volume_type = "sbs_5k"
3939
volume_size_in_gb = 10
4040
}
4141
@@ -77,7 +77,7 @@ func TestAccRdbSnapshot_Update(t *testing.T) {
7777
user_name = "my_initial_user"
7878
password = "thiZ_is_v&ry_s3cret"
7979
tags = ["terraform-test", "scaleway_rdb_instance", "minimal"]
80-
volume_type = "bssd"
80+
volume_type = "sbs_5k"
8181
volume_size_in_gb = 10
8282
}
8383
@@ -102,7 +102,7 @@ func TestAccRdbSnapshot_Update(t *testing.T) {
102102
user_name = "my_initial_user"
103103
password = "thiZ_is_v&ry_s3cret"
104104
tags = ["terraform-test", "scaleway_rdb_instance", "minimal"]
105-
volume_type = "bssd"
105+
volume_type = "sbs_5k"
106106
volume_size_in_gb = 10
107107
}
108108

internal/services/rdb/testdata/instance-change-node-type.cassette.yaml

Lines changed: 410 additions & 508 deletions
Large diffs are not rendered by default.

internal/services/rdb/testdata/instance-change-volume-type.cassette.yaml

Lines changed: 307 additions & 1289 deletions
Large diffs are not rendered by default.

internal/services/rdb/testdata/instance-complete-workflow.cassette.yaml

Lines changed: 662 additions & 1103 deletions
Large diffs are not rendered by default.

internal/services/rdb/testdata/instance-private-network-dhcp.cassette.yaml

Lines changed: 0 additions & 4562 deletions
This file was deleted.

internal/services/rdb/testdata/instance-private-network-update.cassette.yaml

Lines changed: 1060 additions & 1109 deletions
Large diffs are not rendered by default.

internal/services/rdb/testdata/instance-private-network.cassette.yaml

Lines changed: 948 additions & 801 deletions
Large diffs are not rendered by default.

internal/services/rdb/testdata/instance-volume.cassette.yaml

Lines changed: 809 additions & 1005 deletions
Large diffs are not rendered by default.

internal/services/rdb/testdata/rdb-snapshot-basic.cassette.yaml

Lines changed: 222 additions & 271 deletions
Large diffs are not rendered by default.

internal/services/rdb/testdata/rdb-snapshot-end-to-end.cassette.yaml

Lines changed: 0 additions & 889 deletions
This file was deleted.

internal/services/rdb/testdata/rdb-snapshot-update.cassette.yaml

Lines changed: 311 additions & 311 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)