Skip to content

Commit 6c14bf8

Browse files
committed
fix import
1 parent 89fb64c commit 6c14bf8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal/provider/resource_tfe_data_retention_policy.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ func (r *resourceTFEDataRetentionPolicy) Schema(ctx context.Context, req resourc
6868
PlanModifiers: []planmodifier.String{
6969
stringplanmodifier.RequiresReplace(),
7070
},
71+
//Validators: []validator.String{
72+
// stringvalidator.ExactlyOneOf(
73+
// path.MatchRelative().AtParent().AtName("organization"),
74+
// ),
75+
//},
7176
},
7277
},
7378
Blocks: map[string]schema.Block{
@@ -346,6 +351,7 @@ func (r *resourceTFEDataRetentionPolicy) ImportState(ctx context.Context, req re
346351
}
347352

348353
req.ID = r.getPolicyID(policy)
354+
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), r.getPolicyID(policy))...)
349355
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("workspace_id"), workspaceID)...)
350356
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("organization"), s[0])...)
351357
return
@@ -358,7 +364,7 @@ func (r *resourceTFEDataRetentionPolicy) ImportState(ctx context.Context, req re
358364
))
359365
return
360366
}
361-
req.ID = r.getPolicyID(policy)
367+
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), r.getPolicyID(policy))...)
362368
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("organization"), s[0])...)
363369
}
364370

0 commit comments

Comments
 (0)