Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions internal/services/instance/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,24 @@ func ResourceServer() *schema.Resource {
Description: "Size of the root volume in gigabytes",
},
"volume_type": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
Description: "Volume type of the root volume",
ValidateDiagFunc: verify.ValidateEnum[instanceSDK.VolumeVolumeType](),
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
Description: "Volume type of the root volume",
ValidateDiagFunc: func(i interface{}, path cty.Path) diag.Diagnostics {
diags := verify.ValidateEnum[instanceSDK.VolumeVolumeType]()(i, path)
if i.(string) == "b_ssd" {
diags = append(diags, diag.Diagnostic{
Severity: diag.Error,
Summary: "b_ssd volumes are not supported anymore",
Detail: "Remove explicit b_ssd volume_type, migrate to sbs or downgrade terraform.\nLearn more about migration: https://www.scaleway.com/en/docs/instances/how-to/migrate-volumes-snapshots-to-sbs/",
AttributePath: path,
})
}

return diags
},
},
"delete_on_termination": {
Type: schema.TypeBool,
Expand Down
Loading