Skip to content

Commit 98e7aea

Browse files
authored
fix(instance): fix default for delete_on_termination (#740)
1 parent 637b885 commit 98e7aea

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scaleway/resource_instance_server.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,12 @@ func resourceScalewayInstanceServerRead(ctx context.Context, d *schema.ResourceD
470470

471471
rootVolume["volume_id"] = newZonedID(zone, volume.ID).String()
472472
rootVolume["size_in_gb"] = int(uint64(volume.Size) / gb)
473-
rootVolume["delete_on_termination"] = d.Get("root_volume.0.delete_on_termination")
473+
474+
// By default we delete the root volume on termination
475+
rootVolume["delete_on_termination"] = true
476+
if deleteOnTermination, ok := d.GetOk("root_volume.0.delete_on_termination"); ok {
477+
rootVolume["delete_on_termination"] = deleteOnTermination
478+
}
474479

475480
_ = d.Set("root_volume", []map[string]interface{}{rootVolume})
476481
} else {

0 commit comments

Comments
 (0)