From 1eaa51b3b9c3cadbf0c59a929850afca6643f48e Mon Sep 17 00:00:00 2001 From: Jacob Bednarz Date: Wed, 11 Dec 2024 10:26:48 +1100 Subject: [PATCH] feat(rulesets): improve handling of `id` and `ref` unknown values Updates the schema definition to apply `stringplanmodifier.UseStateForUnknown` on the values as once they are set, they should not be changing and we can safely rely on the values. --- internal/framework/service/rulesets/schema.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/framework/service/rulesets/schema.go b/internal/framework/service/rulesets/schema.go index bbf00dff3e..94b965b37f 100644 --- a/internal/framework/service/rulesets/schema.go +++ b/internal/framework/service/rulesets/schema.go @@ -109,10 +109,16 @@ func (r *RulesetResource) Schema(ctx context.Context, req resource.SchemaRequest consts.IDSchemaKey: schema.StringAttribute{ Computed: true, MarkdownDescription: "Unique rule identifier.", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, }, "ref": schema.StringAttribute{ - Optional: true, - Computed: true, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, MarkdownDescription: "Rule reference.", }, "enabled": schema.BoolAttribute{