Skip to content

Commit 9b1ae19

Browse files
committed
r/aws_eks_cluster: Supports null compute_config.node_role_arn when disabling auto mode or built-in node pools
1 parent f042ca6 commit 9b1ae19

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.changelog/42483.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
resource/aws_eks_cluster: Supports null `compute_config.node_role_arn` when disabling auto mode or built-in node pools
3+
```

internal/service/eks/cluster.go

+12
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,18 @@ func resourceCluster() *schema.Resource {
7474
oldRoleARN := aws.ToString(oldComputeConfig.NodeRoleArn)
7575
newRoleARN := aws.ToString(newComputeConfig.NodeRoleArn)
7676

77+
newComputeConfigEnabled := aws.ToBool(newComputeConfig.Enabled)
78+
79+
// Do not force new if auto mode is disabled in new config and role ARN is unset
80+
if !newComputeConfigEnabled && newRoleARN == "" {
81+
return nil
82+
}
83+
84+
// Do not force new if built-in node pools are zeroed in new config and role ARN is unset
85+
if len(newComputeConfig.NodePools) == 0 && newRoleARN == "" {
86+
return nil
87+
}
88+
7789
// only force new if an existing role has changed, not if a new role is added
7890
if oldRoleARN != "" && oldRoleARN != newRoleARN {
7991
if err := rd.ForceNew("compute_config.0.node_role_arn"); err != nil {

0 commit comments

Comments
 (0)