@@ -14,6 +14,9 @@ import (
1414 "github.com/hashicorp/terraform-plugin-framework/path"
1515 "github.com/hashicorp/terraform-plugin-framework/resource"
1616 "github.com/hashicorp/terraform-plugin-framework/resource/schema"
17+ "github.com/hashicorp/terraform-plugin-framework/resource/schema/objectplanmodifier"
18+ "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
19+ "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
1720 "github.com/hashicorp/terraform-plugin-framework/types"
1821 "github.com/hashicorp/terraform-plugin-framework/types/basetypes"
1922 "github.com/hashicorp/terraform-plugin-log/tflog"
@@ -63,6 +66,9 @@ func (r *talosClusterKubeConfigResource) Schema(ctx context.Context, _ resource.
6366 Attributes : map [string ]schema.Attribute {
6467 "id" : schema.StringAttribute {
6568 Computed : true ,
69+ PlanModifiers : []planmodifier.String {
70+ stringplanmodifier .UseStateForUnknown (),
71+ },
6672 },
6773 "node" : schema.StringAttribute {
6874 Required : true ,
@@ -96,6 +102,9 @@ func (r *talosClusterKubeConfigResource) Schema(ctx context.Context, _ resource.
96102 Computed : true ,
97103 Description : "The raw kubeconfig" ,
98104 Sensitive : true ,
105+ PlanModifiers : []planmodifier.String {
106+ stringplanmodifier .UseStateForUnknown (),
107+ },
99108 },
100109 "kubernetes_client_configuration" : schema.SingleNestedAttribute {
101110 Attributes : map [string ]schema.Attribute {
@@ -119,6 +128,9 @@ func (r *talosClusterKubeConfigResource) Schema(ctx context.Context, _ resource.
119128 },
120129 Computed : true ,
121130 Description : "The kubernetes client configuration" ,
131+ PlanModifiers : []planmodifier.Object {
132+ objectplanmodifier .UseStateForUnknown (),
133+ },
122134 },
123135 "timeouts" : timeouts .Attributes (ctx , timeouts.Opts {
124136 Create : true ,
@@ -222,7 +234,7 @@ func (r *talosClusterKubeConfigResource) Create(ctx context.Context, req resourc
222234
223235 state .ID = basetypes .NewStringValue (clusterName )
224236
225- diags = resp .State .Set (ctx , state )
237+ diags = resp .State .Set (ctx , & state )
226238 resp .Diagnostics .Append (diags ... )
227239
228240 if resp .Diagnostics .HasError () {
0 commit comments