@@ -4,10 +4,13 @@ import (
4
4
"context"
5
5
"time"
6
6
7
- dfcloud "github.com/dragonflydb/terraform-provider-dfcloud/internal/sdk"
8
7
"github.com/dragonflydb/terraform-provider-dfcloud/internal/resource_model"
8
+ dfcloud "github.com/dragonflydb/terraform-provider-dfcloud/internal/sdk"
9
9
"github.com/hashicorp/terraform-plugin-framework/resource"
10
10
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
11
+ "github.com/hashicorp/terraform-plugin-framework/resource/schema/objectplanmodifier"
12
+ "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
13
+ "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
11
14
"github.com/hashicorp/terraform-plugin-framework/types"
12
15
)
13
16
@@ -26,6 +29,7 @@ func (r *ConnectionResource) Metadata(ctx context.Context, req resource.Metadata
26
29
func (r * ConnectionResource ) Schema (ctx context.Context , req resource.SchemaRequest , resp * resource.SchemaResponse ) {
27
30
resp .Schema = schema.Schema {
28
31
MarkdownDescription : "Manages a Dragonfly network connection." ,
32
+
29
33
Attributes : map [string ]schema.Attribute {
30
34
"connection_id" : schema.StringAttribute {
31
35
MarkdownDescription : "The ID of the connection." ,
@@ -46,10 +50,16 @@ func (r *ConnectionResource) Schema(ctx context.Context, req resource.SchemaRequ
46
50
"name" : schema.StringAttribute {
47
51
MarkdownDescription : "The name of the connection." ,
48
52
Required : true ,
53
+ PlanModifiers : []planmodifier.String {
54
+ stringplanmodifier .RequiresReplace (),
55
+ },
49
56
},
50
57
"network_id" : schema.StringAttribute {
51
58
MarkdownDescription : "The ID of the network to connect to." ,
52
59
Required : true ,
60
+ PlanModifiers : []planmodifier.String {
61
+ stringplanmodifier .RequiresReplace (),
62
+ },
53
63
},
54
64
"peer" : schema.SingleNestedAttribute {
55
65
MarkdownDescription : "The VPC to connect to." ,
@@ -68,6 +78,9 @@ func (r *ConnectionResource) Schema(ctx context.Context, req resource.SchemaRequ
68
78
Optional : true ,
69
79
},
70
80
},
81
+ PlanModifiers : []planmodifier.Object {
82
+ objectplanmodifier .RequiresReplace (),
83
+ },
71
84
},
72
85
},
73
86
}
0 commit comments