From 0d49e767d0988e1feef1111f0af46751d2df5985 Mon Sep 17 00:00:00 2001 From: "Marcel S. Henselin" Date: Tue, 10 Feb 2026 13:12:49 +0100 Subject: [PATCH] fix: fix wrong identity handling in Read --- .../postgresflexalpha/instance/resource.go | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/stackit/internal/services/postgresflexalpha/instance/resource.go b/stackit/internal/services/postgresflexalpha/instance/resource.go index 78bb0572..3d603df0 100644 --- a/stackit/internal/services/postgresflexalpha/instance/resource.go +++ b/stackit/internal/services/postgresflexalpha/instance/resource.go @@ -324,13 +324,6 @@ func (r *instanceResource) Read( return } - // Read identity data - var identityData InstanceResourceIdentityModel - resp.Diagnostics.Append(req.Identity.Get(ctx, &identityData)...) - if resp.Diagnostics.HasError() { - return - } - ctx = core.InitProviderContext(ctx) // projectId := model.ProjectId.ValueString() @@ -340,34 +333,16 @@ func (r *instanceResource) Read( var projectId string if !model.ProjectId.IsNull() && !model.ProjectId.IsUnknown() { projectId = model.ProjectId.ValueString() - } else { - if identityData.ProjectID.IsNull() || identityData.ProjectID.IsUnknown() { - core.LogAndAddError(ctx, &resp.Diagnostics, functionErrorSummary, "project_id not found in config") - return - } - projectId = identityData.ProjectID.ValueString() } var region string if !model.Region.IsNull() && !model.Region.IsUnknown() { region = r.providerData.GetRegionWithOverride(model.Region) - } else { - if identityData.Region.IsNull() || identityData.Region.IsUnknown() { - core.LogAndAddError(ctx, &resp.Diagnostics, functionErrorSummary, "region not found in config") - return - } - region = r.providerData.GetRegionWithOverride(identityData.Region) } var instanceId string if !model.InstanceId.IsNull() && !model.InstanceId.IsUnknown() { instanceId = model.InstanceId.ValueString() - } else { - if identityData.InstanceID.IsNull() || identityData.InstanceID.IsUnknown() { - core.LogAndAddError(ctx, &resp.Diagnostics, functionErrorSummary, "instance_id not found in config") - return - } - instanceId = identityData.InstanceID.ValueString() } ctx = tflog.SetField(ctx, "project_id", projectId) -- 2.49.1