@@ -10,7 +10,9 @@ import (
10
10
"github.com/hashicorp/terraform-plugin-framework/resource"
11
11
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
12
12
"github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier"
13
+ "github.com/hashicorp/terraform-plugin-framework/resource/schema/listplanmodifier"
13
14
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
15
+ "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
14
16
"github.com/hashicorp/terraform-plugin-framework/types"
15
17
"github.com/hashicorp/terraform-plugin-log/tflog"
16
18
)
@@ -73,16 +75,25 @@ func (r *datastoreResource) Schema(_ context.Context, _ resource.SchemaRequest,
73
75
"provider" : schema.StringAttribute {
74
76
MarkdownDescription : "The provider for the datastore location." ,
75
77
Required : true ,
78
+ PlanModifiers : []planmodifier.String {
79
+ stringplanmodifier .RequiresReplace (),
80
+ },
76
81
},
77
82
"region" : schema.StringAttribute {
78
83
MarkdownDescription : "The region for the datastore location." ,
79
84
Required : true ,
85
+ PlanModifiers : []planmodifier.String {
86
+ stringplanmodifier .RequiresReplace (),
87
+ },
80
88
},
81
89
"availability_zones" : schema.ListAttribute {
82
90
MarkdownDescription : "The availability zones for the datastore location." ,
83
91
ElementType : types .StringType ,
84
92
Optional : true ,
85
93
Computed : true ,
94
+ PlanModifiers : []planmodifier.List {
95
+ listplanmodifier .RequiresReplace (),
96
+ },
86
97
},
87
98
},
88
99
},
@@ -203,7 +214,7 @@ func (r *datastoreResource) Create(ctx context.Context, req resource.CreateReque
203
214
"status" : respDatastore .Status ,
204
215
})
205
216
206
- plan .FromConfig (respDatastore )
217
+ plan .FromConfig (ctx , respDatastore )
207
218
diags = resp .State .Set (ctx , & plan )
208
219
resp .Diagnostics .Append (diags ... )
209
220
}
@@ -233,7 +244,7 @@ func (r *datastoreResource) Read(ctx context.Context, req resource.ReadRequest,
233
244
"status" : respDatastore .Status ,
234
245
})
235
246
236
- state .FromConfig (respDatastore )
247
+ state .FromConfig (ctx , respDatastore )
237
248
diags = resp .State .Set (ctx , & state )
238
249
resp .Diagnostics .Append (diags ... )
239
250
}
@@ -284,7 +295,7 @@ func (r *datastoreResource) Update(ctx context.Context, req resource.UpdateReque
284
295
"status" : respDatastore .Status ,
285
296
})
286
297
287
- plan .FromConfig (respDatastore )
298
+ plan .FromConfig (ctx , respDatastore )
288
299
diags = resp .State .Set (ctx , & plan )
289
300
resp .Diagnostics .Append (diags ... )
290
301
}
@@ -324,7 +335,7 @@ func (r *datastoreResource) ImportState(ctx context.Context, req resource.Import
324
335
}
325
336
326
337
var plan resource_model.Datastore
327
- plan .FromConfig (datastore )
338
+ plan .FromConfig (ctx , datastore )
328
339
diags := resp .State .Set (ctx , & plan )
329
340
resp .Diagnostics .Append (diags ... )
330
341
}
0 commit comments