@@ -11,6 +11,7 @@ import (
1111 "github.com/scaleway/scaleway-sdk-go/api/instance/v1"
1212 "github.com/scaleway/scaleway-sdk-go/scw"
1313 "github.com/scaleway/terraform-provider-scaleway/v2/internal/httperrors"
14+ "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional"
1415 "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/zonal"
1516 "github.com/scaleway/terraform-provider-scaleway/v2/internal/transport"
1617 "github.com/scaleway/terraform-provider-scaleway/v2/internal/types"
@@ -80,10 +81,14 @@ func ResourceScalewayInstanceSnapshot() *schema.Resource {
8081 Elem : & schema.Resource {
8182 Schema : map [string ]* schema.Schema {
8283 "bucket" : {
83- Type : schema .TypeString ,
84- Required : true ,
85- ForceNew : true ,
86- Description : "Bucket containing qcow" ,
84+ Type : schema .TypeString ,
85+ Required : true ,
86+ ForceNew : true ,
87+ Description : "Bucket containing qcow" ,
88+ DiffSuppressFunc : diffSuppressFuncLocality ,
89+ StateFunc : func (i interface {}) string {
90+ return regional .ExpandID (i .(string )).ID
91+ },
8792 },
8893 "key" : {
8994 Type : schema .TypeString ,
@@ -134,7 +139,7 @@ func resourceScalewayInstanceSnapshotCreate(ctx context.Context, d *schema.Resou
134139 }
135140
136141 if _ , isImported := d .GetOk ("import" ); isImported {
137- req .Bucket = types .ExpandStringPtr (d .Get ("import.0.bucket" ))
142+ req .Bucket = types .ExpandStringPtr (regional . ExpandID ( d .Get ("import.0.bucket" )). ID )
138143 req .Key = types .ExpandStringPtr (d .Get ("import.0.key" ))
139144 }
140145
0 commit comments