@@ -84,9 +84,8 @@ func resourceClusterSchema() schema.Schema {
84
84
return schema.Schema {
85
85
Attributes : map [string ]schema.Attribute {
86
86
"name" : schema.StringAttribute {
87
- Required : true ,
88
- Description : "Unique name of the cluster." ,
89
- PlanModifiers : []planmodifier.String {stringplanmodifier .RequiresReplace ()},
87
+ Required : true ,
88
+ Description : "Unique name of the cluster." ,
90
89
},
91
90
"cluster_type" : schema.StringAttribute {
92
91
Required : true ,
@@ -405,16 +404,23 @@ func (c *Cluster) Update(ctx context.Context, req resource.UpdateRequest, resp *
405
404
var plan models.Cluster
406
405
resp .Diagnostics .Append (req .Plan .Get (ctx , & plan )... )
407
406
407
+ var state models.Cluster
408
+ resp .Diagnostics .Append (req .State .Get (ctx , & state )... )
409
+
408
410
updateReq := & controlplanev1beta2.UpdateClusterRequest {
409
411
Cluster : & controlplanev1beta2.ClusterUpdate {
410
- Id : plan .ID .ValueString (),
411
- Name : plan .Name .ValueString (),
412
+ Id : plan .ID .ValueString (),
412
413
},
413
414
UpdateMask : & fieldmaskpb.FieldMask {
414
415
Paths : make ([]string , 0 ),
415
416
},
416
417
}
417
418
419
+ if ! plan .Name .Equal (state .Name ) {
420
+ updateReq .Cluster .Name = plan .Name .ValueString ()
421
+ updateReq .UpdateMask .Paths = append (updateReq .UpdateMask .Paths , "name" )
422
+ }
423
+
418
424
if ! isAwsPrivateLinkStructNil (plan .AwsPrivateLink ) {
419
425
updateReq .Cluster .AwsPrivateLink = & controlplanev1beta2.AWSPrivateLinkSpec {
420
426
Enabled : plan .AwsPrivateLink .Enabled .ValueBool (),
0 commit comments