Skip to content

Commit 128e72f

Browse files
committed
maybe add a default
1 parent b82b685 commit 128e72f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

internal/fleet/agent_policy/schema.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ import (
1111
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
1212
"github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault"
1313
"github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier"
14+
"github.com/hashicorp/terraform-plugin-framework/resource/schema/mapdefault"
1415
"github.com/hashicorp/terraform-plugin-framework/resource/schema/mapplanmodifier"
1516
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
1617
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
1718
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
19+
"github.com/hashicorp/terraform-plugin-framework/types"
1820
)
1921

2022
func (r *agentPolicyResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
@@ -114,6 +116,12 @@ func getSchema() schema.Schema {
114116
},
115117
Computed: true,
116118
Optional: true,
119+
Default: mapdefault.StaticValue(types.MapValueMust(types.ObjectType{
120+
AttrTypes: map[string]attr.Type{
121+
"string_value": types.StringType,
122+
"number_value": types.Float32Type,
123+
},
124+
}, map[string]attr.Value{})),
117125
PlanModifiers: []planmodifier.Map{
118126
mapplanmodifier.UseStateForUnknown(),
119127
},

0 commit comments

Comments
 (0)