File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 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+ ```
Original file line number Diff line number Diff 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  {
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments