Skip to content

Commit 1fa35ce

Browse files
committed
fix(iaas): persist partial state during apply of network area resource
1 parent 459122c commit 1fa35ce

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,16 @@ func (r *networkAreaResource) Create(ctx context.Context, req resource.CreateReq
325325
networkAreaId := *networkArea.Id
326326
ctx = tflog.SetField(ctx, "network_area_id", networkAreaId)
327327

328+
// Deprecated: Will be removed in May 2026. Only introduced to make the IaaS v1 -> v2 API migration non-breaking in the Terraform provider.
329+
// persist state - just in case anything goes wrong while creating the network area region
330+
ctx = utils.SetAndLogStateFields(ctx, &resp.Diagnostics, &resp.State, map[string]any{
331+
"organization_id": model.OrganizationId.ValueString(),
332+
"network_area_id": networkAreaId,
333+
})
334+
if resp.Diagnostics.HasError() {
335+
return
336+
}
337+
328338
// Map response body to schema
329339
err = mapFields(ctx, networkArea, &model)
330340
if err != nil {

0 commit comments

Comments
 (0)