Skip to content

Commit 78c01ad

Browse files
authored
fix(iaas): prevent replace in server_volume_attach, when migrating to iaas v2 (#1135)
1 parent fc1c1f4 commit 78c01ad

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

stackit/internal/services/iaas/volumeattach/resource.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ func (r *volumeAttachResource) Create(ctx context.Context, req resource.CreateRe
205205
}
206206

207207
model.Id = utils.BuildInternalTerraformId(projectId, region, serverId, volumeId)
208+
model.Region = types.StringValue(region)
208209

209210
// Set state to fully populated data
210211
diags = resp.State.Set(ctx, model)
@@ -248,6 +249,10 @@ func (r *volumeAttachResource) Read(ctx context.Context, req resource.ReadReques
248249

249250
ctx = core.LogResponse(ctx)
250251

252+
// Update region in model
253+
model.Region = types.StringValue(region)
254+
model.Id = utils.BuildInternalTerraformId(projectId, region, serverId, volumeId)
255+
251256
// Set refreshed state
252257
diags = resp.State.Set(ctx, model)
253258
resp.Diagnostics.Append(diags...)

0 commit comments

Comments
 (0)