Skip to content

Commit

Permalink
feat(rulesets): improve handling of id and ref unknown values
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jacobbednarz committed Dec 11, 2024
1 parent eb23ef0 commit 1eaa51b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions internal/framework/service/rulesets/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 1eaa51b

Please sign in to comment.