|
9 | 9 | "github.com/hashicorp/terraform-plugin-framework/path"
|
10 | 10 | "github.com/hashicorp/terraform-plugin-framework/resource"
|
11 | 11 | "github.com/hashicorp/terraform-plugin-framework/resource/schema"
|
12 |
| - "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" |
13 |
| - "github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier" |
14 | 12 | "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
|
15 | 13 | "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault"
|
16 | 14 | "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
|
@@ -166,8 +164,6 @@ func (r *SecurityAccountResource) Schema(ctx context.Context, req resource.Schem
|
166 | 164 | MarkdownDescription: "Account locked",
|
167 | 165 | Optional: true,
|
168 | 166 | Computed: true,
|
169 |
| - Default: booldefault.StaticBool(false), |
170 |
| - PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()}, |
171 | 167 | },
|
172 | 168 | "id": schema.StringAttribute{
|
173 | 169 | MarkdownDescription: "SecurityAccount id",
|
@@ -346,7 +342,7 @@ func (r *SecurityAccountResource) Create(ctx context.Context, req resource.Creat
|
346 | 342 | body.Comment = data.Comment.ValueString()
|
347 | 343 | }
|
348 | 344 | if !data.Locked.IsNull() {
|
349 |
| - body.Locked = data.Locked.ValueBool() |
| 345 | + body.Locked = data.Locked.ValueBoolPointer() |
350 | 346 | }
|
351 | 347 |
|
352 | 348 | client, err := connection.GetRestClient(errorHandler, r.config, data.CxProfileName)
|
@@ -410,6 +406,7 @@ func (r *SecurityAccountResource) Create(ctx context.Context, req resource.Creat
|
410 | 406 |
|
411 | 407 | data.ID = types.StringValue(resource.Name)
|
412 | 408 | data.OwnerID = types.StringValue(resource.Owner.UUID)
|
| 409 | + data.Locked = types.BoolValue(resource.Locked) |
413 | 410 |
|
414 | 411 | tflog.Trace(ctx, "created a resource")
|
415 | 412 |
|
@@ -472,7 +469,7 @@ func (r *SecurityAccountResource) Update(ctx context.Context, req resource.Updat
|
472 | 469 |
|
473 | 470 | // locked update
|
474 | 471 | if !plan.Locked.IsNull() {
|
475 |
| - request.Locked = plan.Locked.ValueBool() |
| 472 | + request.Locked = plan.Locked.ValueBoolPointer() |
476 | 473 | }
|
477 | 474 |
|
478 | 475 | // comment update
|
|
0 commit comments