Skip to content

Commit 45e8981

Browse files
Add UseStateForUnknown for all Computed fields that RequireReplacement and dont change after an update (#149)
1 parent f62984a commit 45e8981

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

stackit/internal/services/dns/zone/resource.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ func (r *zoneResource) Schema(_ context.Context, _ resource.SchemaRequest, resp
231231
ElementType: types.StringType,
232232
PlanModifiers: []planmodifier.List{
233233
listplanmodifier.RequiresReplace(),
234+
listplanmodifier.UseStateForUnknown(),
234235
},
235236
Validators: []validator.List{
236237
listvalidator.SizeAtMost(10),

stackit/internal/services/loadbalancer/loadbalancer/resource.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ The example below uses OpenStack to create the network, router, a public IP addr
271271
Computed: true,
272272
PlanModifiers: []planmodifier.String{
273273
stringplanmodifier.RequiresReplace(),
274+
stringplanmodifier.UseStateForUnknown(),
274275
},
275276
},
276277
"port": schema.Int64Attribute{
@@ -279,6 +280,7 @@ The example below uses OpenStack to create the network, router, a public IP addr
279280
Computed: true,
280281
PlanModifiers: []planmodifier.Int64{
281282
int64planmodifier.RequiresReplace(),
283+
int64planmodifier.UseStateForUnknown(),
282284
},
283285
},
284286
"protocol": schema.StringAttribute{
@@ -287,6 +289,7 @@ The example below uses OpenStack to create the network, router, a public IP addr
287289
Computed: true,
288290
PlanModifiers: []planmodifier.String{
289291
stringplanmodifier.RequiresReplace(),
292+
stringplanmodifier.UseStateForUnknown(),
290293
},
291294
Validators: []validator.String{
292295
stringvalidator.OneOf("PROTOCOL_UNSPECIFIED", "PROTOCOL_TCP", "PROTOCOL_UDP", "PROTOCOL_TCP_PROXY"),
@@ -298,6 +301,7 @@ The example below uses OpenStack to create the network, router, a public IP addr
298301
Computed: true,
299302
PlanModifiers: []planmodifier.String{
300303
stringplanmodifier.RequiresReplace(),
304+
stringplanmodifier.UseStateForUnknown(),
301305
},
302306
},
303307
},
@@ -343,6 +347,7 @@ The example below uses OpenStack to create the network, router, a public IP addr
343347
Computed: true,
344348
PlanModifiers: []planmodifier.String{
345349
stringplanmodifier.RequiresReplace(),
350+
stringplanmodifier.UseStateForUnknown(),
346351
},
347352
Validators: []validator.String{
348353
stringvalidator.OneOf("ROLE_UNSPECIFIED", "ROLE_LISTENERS_AND_TARGETS", "ROLE_LISTENERS", "ROLE_TARGETS"),
@@ -357,6 +362,7 @@ The example below uses OpenStack to create the network, router, a public IP addr
357362
Computed: true,
358363
PlanModifiers: []planmodifier.Object{
359364
objectplanmodifier.RequiresReplace(),
365+
objectplanmodifier.UseStateForUnknown(),
360366
},
361367
Attributes: map[string]schema.Attribute{
362368
"acl": schema.SetAttribute{
@@ -366,6 +372,7 @@ The example below uses OpenStack to create the network, router, a public IP addr
366372
Computed: true,
367373
PlanModifiers: []planmodifier.Set{
368374
setplanmodifier.RequiresReplace(),
375+
setplanmodifier.UseStateForUnknown(),
369376
},
370377
Validators: []validator.Set{
371378
setvalidator.ValueStringsAre(
@@ -379,6 +386,7 @@ The example below uses OpenStack to create the network, router, a public IP addr
379386
Computed: true,
380387
PlanModifiers: []planmodifier.Bool{
381388
boolplanmodifier.RequiresReplace(),
389+
boolplanmodifier.UseStateForUnknown(),
382390
},
383391
},
384392
},

stackit/internal/services/mongodbflex/user/resource.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ func (r *userResource) Schema(_ context.Context, _ resource.SchemaRequest, resp
155155
Computed: true,
156156
PlanModifiers: []planmodifier.String{
157157
stringplanmodifier.RequiresReplace(),
158+
stringplanmodifier.UseStateForUnknown(),
158159
},
159160
},
160161
"roles": schema.SetAttribute{

0 commit comments

Comments
 (0)