Skip to content

Commit

Permalink
resource/aws_eks_node_group: Support AL2_ARM_64 value for `ami_type…
Browse files Browse the repository at this point in the history
…` argument plan-time validation (#14729)

Output from acceptance testing:

```
--- PASS: TestAccAWSEksNodeGroup_AmiType (1539.32s)
```
  • Loading branch information
niallthomson committed Aug 19, 2020
1 parent 685aa31 commit 1feaf93
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions aws/resource_aws_eks_node_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func resourceAwsEksNodeGroup() *schema.Resource {
ValidateFunc: validation.StringInSlice([]string{
eks.AMITypesAl2X8664,
eks.AMITypesAl2X8664Gpu,
eks.AMITypesAl2Arm64,
}, false),
},
"arn": {
Expand Down
9 changes: 8 additions & 1 deletion aws/resource_aws_eks_node_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func TestAccAWSEksNodeGroup_disappears(t *testing.T) {
}

func TestAccAWSEksNodeGroup_AmiType(t *testing.T) {
var nodeGroup1 eks.Nodegroup
var nodeGroup1, nodeGroup2 eks.Nodegroup
rName := acctest.RandomWithPrefix("tf-acc-test")
resourceName := "aws_eks_node_group.test"

Expand All @@ -168,6 +168,13 @@ func TestAccAWSEksNodeGroup_AmiType(t *testing.T) {
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccAWSEksNodeGroupConfigAmiType(rName, eks.AMITypesAl2Arm64),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup2),
resource.TestCheckResourceAttr(resourceName, "ami_type", eks.AMITypesAl2Arm64),
),
},
},
})
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/eks_node_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ The following arguments are required:

The following arguments are optional:

* `ami_type` - (Optional) Type of Amazon Machine Image (AMI) associated with the EKS Node Group. Defaults to `AL2_x86_64`. Valid values: `AL2_x86_64`, `AL2_x86_64_GPU`. Terraform will only perform drift detection if a configuration value is provided.
* `ami_type` - (Optional) Type of Amazon Machine Image (AMI) associated with the EKS Node Group. Defaults to `AL2_x86_64`. Valid values: `AL2_x86_64`, `AL2_x86_64_GPU`, `AL2_ARM_64`. Terraform will only perform drift detection if a configuration value is provided.
* `disk_size` - (Optional) Disk size in GiB for worker nodes. Defaults to `20`. Terraform will only perform drift detection if a configuration value is provided.
* `force_update_version` - (Optional) Force version update if existing pods are unable to be drained due to a pod disruption budget issue.
* `instance_types` - (Optional) Set of instance types associated with the EKS Node Group. Defaults to `["t3.medium"]`. Terraform will only perform drift detection if a configuration value is provided. Currently, the EKS API only accepts a single value in the set.
Expand Down

0 comments on commit 1feaf93

Please sign in to comment.