@@ -5,10 +5,12 @@ import (
5
5
"fmt"
6
6
"time"
7
7
8
- dfcloud "github.com/dragonflydb/terraform-provider-dfcloud/internal/sdk"
9
8
"github.com/dragonflydb/terraform-provider-dfcloud/internal/resource_model"
9
+ dfcloud "github.com/dragonflydb/terraform-provider-dfcloud/internal/sdk"
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/boolplanmodifier"
13
+ "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
12
14
"github.com/hashicorp/terraform-plugin-framework/types"
13
15
"github.com/hashicorp/terraform-plugin-log/tflog"
14
16
)
@@ -41,8 +43,18 @@ func (r *datastoreResource) Schema(_ context.Context, _ resource.SchemaRequest,
41
43
MarkdownDescription : "The timestamp when the datastore was created." ,
42
44
Computed : true ,
43
45
},
46
+ "disable_pass_key" : schema.BoolAttribute {
47
+ MarkdownDescription : "Disable the passkey for the datastore." ,
48
+ Optional : true ,
49
+ PlanModifiers : []planmodifier.Bool {
50
+ boolplanmodifier .RequiresReplace (),
51
+ },
52
+ },
53
+ // password cant be set by a user
44
54
"password" : schema.StringAttribute {
45
55
MarkdownDescription : "The password for the datastore." ,
56
+ Optional : false ,
57
+ Required : false ,
46
58
Computed : true ,
47
59
Sensitive : true ,
48
60
},
@@ -251,8 +263,8 @@ func (r *datastoreResource) Update(ctx context.Context, req resource.UpdateReque
251
263
return
252
264
}
253
265
254
- datastore := resource_model .IntoDatastoreConfig (plan )
255
- respDatastore , err = r .client .UpdateDatastore (ctx , state .ID .ValueString (), & datastore .Config )
266
+ updateDatastore := resource_model .IntoDatastoreConfig (plan )
267
+ respDatastore , err = r .client .UpdateDatastore (ctx , state .ID .ValueString (), & updateDatastore .Config )
256
268
if err != nil {
257
269
resp .Diagnostics .AddError ("Error Updating Datastore" , err .Error ())
258
270
return
0 commit comments