Skip to content

Commit d87a951

Browse files
committed
resource/aws_eks_node_group : Add update_strategy attribute
1 parent 3bbbf5a commit d87a951

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

.changelog/41442.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/aws_eks_node_group : Add `update_strategy` attribute
3+
```

internal/service/eks/node_group.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ func resourceNodeGroup() *schema.Resource {
303303
"update_config.0.max_unavailable_percentage",
304304
},
305305
},
306+
"update_strategy": {
307+
Type: schema.TypeString,
308+
Optional: true,
309+
ValidateDiagFunc: enum.Validate[types.NodegroupUpdateStrategies](),
310+
},
306311
},
307312
},
308313
},
@@ -943,6 +948,10 @@ func expandNodegroupUpdateConfig(tfMap map[string]interface{}) *types.NodegroupU
943948
apiObject.MaxUnavailablePercentage = aws.Int32(int32(v))
944949
}
945950

951+
if v, ok := tfMap["update_strategy"].(string); ok && v != "" {
952+
apiObject.UpdateStrategy = types.NodegroupUpdateStrategies(v)
953+
}
954+
946955
return apiObject
947956
}
948957

internal/service/eks/node_group_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,16 @@ func TestAccEKSNodeGroup_update(t *testing.T) {
965965
resource.TestCheckResourceAttr(resourceName, "update_config.0.max_unavailable_percentage", "40"),
966966
),
967967
},
968+
{
969+
Config: testAccNodeGroupConfig_update2(rName),
970+
Check: resource.ComposeTestCheckFunc(
971+
testAccCheckNodeGroupExists(ctx, resourceName, &nodeGroup1),
972+
resource.TestCheckResourceAttr(resourceName, "update_config.#", "1"),
973+
resource.TestCheckResourceAttr(resourceName, "update_config.0.max_unavailable", "0"),
974+
resource.TestCheckResourceAttr(resourceName, "update_config.0.max_unavailable_percentage", "40"),
975+
resource.TestCheckResourceAttr(resourceName, "update_config.0.update_strategy", "MINIMAL"),
976+
),
977+
},
968978
},
969979
})
970980
}

website/docs/r/eks_node_group.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ The following arguments are mutually exclusive.
193193

194194
* `max_unavailable` - (Optional) Desired max number of unavailable worker nodes during node group update.
195195
* `max_unavailable_percentage` - (Optional) Desired max percentage of unavailable worker nodes during node group update.
196+
* `update_strategy` - (Optional) Strategy to use for updating the node group. Valid values: `MINIMAL` and `DEFAULT`.
196197

197198
## Attribute Reference
198199

0 commit comments

Comments
 (0)