File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import (
1111 "github.com/scaleway/scaleway-sdk-go/scw"
1212 "github.com/scaleway/terraform-provider-scaleway/v2/internal/dsf"
1313 "github.com/scaleway/terraform-provider-scaleway/v2/internal/httperrors"
14+ "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality"
1415 "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/zonal"
1516 "github.com/scaleway/terraform-provider-scaleway/v2/internal/meta"
1617 "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/instance/instancehelpers"
@@ -69,9 +70,11 @@ func customDiffSnapshot(key string) schema.CustomizeDiffFunc {
6970 }
7071
7172 blockAPI := block .NewAPI (meta .ExtractScwClient (i ))
73+ zone , id , _ := locality .ParseLocalizedID (oldValue .(string ))
7274
7375 _ , err := blockAPI .GetSnapshot (& block.GetSnapshotRequest {
74- SnapshotID : oldValue .(string ),
76+ SnapshotID : id ,
77+ Zone : scw .Zone (zone ),
7578 })
7679 if (httperrors .Is403 (err ) || httperrors .Is404 (err )) && newValue == "" {
7780 return nil
Original file line number Diff line number Diff line change 99 block "github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1"
1010 "github.com/scaleway/scaleway-sdk-go/logger"
1111 "github.com/scaleway/scaleway-sdk-go/scw"
12+ "github.com/scaleway/terraform-provider-scaleway/v2/internal/dsf"
1213 "github.com/scaleway/terraform-provider-scaleway/v2/internal/httperrors"
1314 "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality"
1415 "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/zonal"
@@ -52,9 +53,10 @@ func ResourceVolume() *schema.Resource {
5253 Description : "The volume size in GB" ,
5354 },
5455 "snapshot_id" : {
55- Type : schema .TypeString ,
56- Optional : true ,
57- Description : "The snapshot to create the volume from" ,
56+ Type : schema .TypeString ,
57+ Optional : true ,
58+ Description : "The snapshot to create the volume from" ,
59+ DiffSuppressFunc : dsf .Locality ,
5860 },
5961 "instance_volume_id" : {
6062 Type : schema .TypeString ,
You can’t perform that action at this time.
0 commit comments