Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resource/aws_eks_node_group: added support for taints #19482

Merged
merged 3 commits into from
May 25, 2021

Conversation

david7482
Copy link
Contributor

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #19310

Release note for CHANGELOG:

resource/aws_eks_node_group: add `taints` attribute.

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSEksNodeGroup_Taints'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSEksNodeGroup_Taints -timeout 180m
=== RUN   TestAccAWSEksNodeGroup_Taints
=== PAUSE TestAccAWSEksNodeGroup_Taints
=== CONT  TestAccAWSEksNodeGroup_Taints
--- PASS: TestAccAWSEksNodeGroup_Taints (1132.05s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       1132.138s
...

This PR adds support for the taints resource block.

taints {
    key = "key1"
    value = "value1"
    effect = "NO_SCHEDULE"
}
taints {
    key = "key2"
    value = "value2"
    effect = "NO_EXECUTE"
}

@david7482 david7482 requested a review from a team as a code owner May 23, 2021 20:21
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label May 23, 2021
@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. service/eks Issues and PRs that pertain to the eks service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. needs-triage Waiting for first response or review from a maintainer. labels May 23, 2021
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome @david7482 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label May 25, 2021
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

Commercial
% make testacc TEST=./aws TESTARGS='-run=TestAccAWSEksNodeGroup_'                                 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSEksNodeGroup_ -timeout 180m
=== RUN   TestAccAWSEksNodeGroup_basic
=== PAUSE TestAccAWSEksNodeGroup_basic
=== RUN   TestAccAWSEksNodeGroup_Name_Generated
=== PAUSE TestAccAWSEksNodeGroup_Name_Generated
=== RUN   TestAccAWSEksNodeGroup_NamePrefix
=== PAUSE TestAccAWSEksNodeGroup_NamePrefix
=== RUN   TestAccAWSEksNodeGroup_disappears
=== PAUSE TestAccAWSEksNodeGroup_disappears
=== RUN   TestAccAWSEksNodeGroup_AmiType
=== PAUSE TestAccAWSEksNodeGroup_AmiType
=== RUN   TestAccAWSEksNodeGroup_CapacityType_Spot
=== PAUSE TestAccAWSEksNodeGroup_CapacityType_Spot
=== RUN   TestAccAWSEksNodeGroup_DiskSize
=== PAUSE TestAccAWSEksNodeGroup_DiskSize
=== RUN   TestAccAWSEksNodeGroup_ForceUpdateVersion
=== PAUSE TestAccAWSEksNodeGroup_ForceUpdateVersion
=== RUN   TestAccAWSEksNodeGroup_InstanceTypes_Multiple
=== PAUSE TestAccAWSEksNodeGroup_InstanceTypes_Multiple
=== RUN   TestAccAWSEksNodeGroup_InstanceTypes_Single
=== PAUSE TestAccAWSEksNodeGroup_InstanceTypes_Single
=== RUN   TestAccAWSEksNodeGroup_Labels
=== PAUSE TestAccAWSEksNodeGroup_Labels
=== RUN   TestAccAWSEksNodeGroup_LaunchTemplate_Id
=== PAUSE TestAccAWSEksNodeGroup_LaunchTemplate_Id
=== RUN   TestAccAWSEksNodeGroup_LaunchTemplate_Name
=== PAUSE TestAccAWSEksNodeGroup_LaunchTemplate_Name
=== RUN   TestAccAWSEksNodeGroup_LaunchTemplate_Version
=== PAUSE TestAccAWSEksNodeGroup_LaunchTemplate_Version
=== RUN   TestAccAWSEksNodeGroup_ReleaseVersion
=== PAUSE TestAccAWSEksNodeGroup_ReleaseVersion
=== RUN   TestAccAWSEksNodeGroup_RemoteAccess_Ec2SshKey
=== PAUSE TestAccAWSEksNodeGroup_RemoteAccess_Ec2SshKey
=== RUN   TestAccAWSEksNodeGroup_RemoteAccess_SourceSecurityGroupIds
=== PAUSE TestAccAWSEksNodeGroup_RemoteAccess_SourceSecurityGroupIds
=== RUN   TestAccAWSEksNodeGroup_ScalingConfig_DesiredSize
=== PAUSE TestAccAWSEksNodeGroup_ScalingConfig_DesiredSize
=== RUN   TestAccAWSEksNodeGroup_ScalingConfig_MaxSize
=== PAUSE TestAccAWSEksNodeGroup_ScalingConfig_MaxSize
=== RUN   TestAccAWSEksNodeGroup_ScalingConfig_MinSize
=== PAUSE TestAccAWSEksNodeGroup_ScalingConfig_MinSize
=== RUN   TestAccAWSEksNodeGroup_Tags
=== PAUSE TestAccAWSEksNodeGroup_Tags
=== RUN   TestAccAWSEksNodeGroup_Taints
=== PAUSE TestAccAWSEksNodeGroup_Taints
=== RUN   TestAccAWSEksNodeGroup_Version
=== PAUSE TestAccAWSEksNodeGroup_Version
=== CONT  TestAccAWSEksNodeGroup_basic
=== CONT  TestAccAWSEksNodeGroup_LaunchTemplate_Name
=== CONT  TestAccAWSEksNodeGroup_Version
=== CONT  TestAccAWSEksNodeGroup_RemoteAccess_SourceSecurityGroupIds
=== CONT  TestAccAWSEksNodeGroup_ScalingConfig_DesiredSize
=== CONT  TestAccAWSEksNodeGroup_LaunchTemplate_Version
=== CONT  TestAccAWSEksNodeGroup_Taints
=== CONT  TestAccAWSEksNodeGroup_RemoteAccess_Ec2SshKey
=== CONT  TestAccAWSEksNodeGroup_ScalingConfig_MaxSize
=== CONT  TestAccAWSEksNodeGroup_ReleaseVersion
=== CONT  TestAccAWSEksNodeGroup_DiskSize
=== CONT  TestAccAWSEksNodeGroup_NamePrefix
=== CONT  TestAccAWSEksNodeGroup_Labels
=== CONT  TestAccAWSEksNodeGroup_InstanceTypes_Single
=== CONT  TestAccAWSEksNodeGroup_Tags
=== CONT  TestAccAWSEksNodeGroup_ScalingConfig_MinSize
=== CONT  TestAccAWSEksNodeGroup_LaunchTemplate_Id
=== CONT  TestAccAWSEksNodeGroup_InstanceTypes_Multiple
=== CONT  TestAccAWSEksNodeGroup_ForceUpdateVersion
=== CONT  TestAccAWSEksNodeGroup_disappears
--- PASS: TestAccAWSEksNodeGroup_InstanceTypes_Single (946.99s)
=== CONT  TestAccAWSEksNodeGroup_Name_Generated
--- PASS: TestAccAWSEksNodeGroup_InstanceTypes_Multiple (1055.26s)
=== CONT  TestAccAWSEksNodeGroup_CapacityType_Spot
--- PASS: TestAccAWSEksNodeGroup_basic (1061.18s)
=== CONT  TestAccAWSEksNodeGroup_AmiType
--- PASS: TestAccAWSEksNodeGroup_RemoteAccess_Ec2SshKey (1071.36s)
--- PASS: TestAccAWSEksNodeGroup_ScalingConfig_DesiredSize (1078.33s)
--- PASS: TestAccAWSEksNodeGroup_ScalingConfig_MaxSize (1100.26s)
--- PASS: TestAccAWSEksNodeGroup_RemoteAccess_SourceSecurityGroupIds (1106.01s)
--- PASS: TestAccAWSEksNodeGroup_DiskSize (1123.92s)
--- PASS: TestAccAWSEksNodeGroup_disappears (1136.53s)
--- PASS: TestAccAWSEksNodeGroup_ScalingConfig_MinSize (1138.84s)
--- PASS: TestAccAWSEksNodeGroup_NamePrefix (1149.75s)
--- PASS: TestAccAWSEksNodeGroup_Tags (1249.19s)
--- PASS: TestAccAWSEksNodeGroup_Taints (1255.65s)
--- PASS: TestAccAWSEksNodeGroup_Labels (1309.39s)
--- PASS: TestAccAWSEksNodeGroup_LaunchTemplate_Name (1344.33s)
--- PASS: TestAccAWSEksNodeGroup_LaunchTemplate_Id (1452.51s)
--- PASS: TestAccAWSEksNodeGroup_Name_Generated (1054.25s)
--- PASS: TestAccAWSEksNodeGroup_LaunchTemplate_Version (2179.23s)
--- PASS: TestAccAWSEksNodeGroup_CapacityType_Spot (1212.25s)
--- PASS: TestAccAWSEksNodeGroup_AmiType (1619.28s)
--- PASS: TestAccAWSEksNodeGroup_ReleaseVersion (3591.59s)
--- PASS: TestAccAWSEksNodeGroup_Version (4492.29s)
--- PASS: TestAccAWSEksNodeGroup_ForceUpdateVersion (4557.12s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	4560.145s
GovCloud
% make testacc TEST=./aws TESTARGS='-run=TestAccAWSEksNodeGroup_' 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSEksNodeGroup_ -timeout 180m
=== RUN   TestAccAWSEksNodeGroup_basic
=== PAUSE TestAccAWSEksNodeGroup_basic
=== RUN   TestAccAWSEksNodeGroup_Name_Generated
=== PAUSE TestAccAWSEksNodeGroup_Name_Generated
=== RUN   TestAccAWSEksNodeGroup_NamePrefix
=== PAUSE TestAccAWSEksNodeGroup_NamePrefix
=== RUN   TestAccAWSEksNodeGroup_disappears
=== PAUSE TestAccAWSEksNodeGroup_disappears
=== RUN   TestAccAWSEksNodeGroup_AmiType
=== PAUSE TestAccAWSEksNodeGroup_AmiType
=== RUN   TestAccAWSEksNodeGroup_CapacityType_Spot
=== PAUSE TestAccAWSEksNodeGroup_CapacityType_Spot
=== RUN   TestAccAWSEksNodeGroup_DiskSize
=== PAUSE TestAccAWSEksNodeGroup_DiskSize
=== RUN   TestAccAWSEksNodeGroup_ForceUpdateVersion
=== PAUSE TestAccAWSEksNodeGroup_ForceUpdateVersion
=== RUN   TestAccAWSEksNodeGroup_InstanceTypes_Multiple
=== PAUSE TestAccAWSEksNodeGroup_InstanceTypes_Multiple
=== RUN   TestAccAWSEksNodeGroup_InstanceTypes_Single
=== PAUSE TestAccAWSEksNodeGroup_InstanceTypes_Single
=== RUN   TestAccAWSEksNodeGroup_Labels
=== PAUSE TestAccAWSEksNodeGroup_Labels
=== RUN   TestAccAWSEksNodeGroup_LaunchTemplate_Id
=== PAUSE TestAccAWSEksNodeGroup_LaunchTemplate_Id
=== RUN   TestAccAWSEksNodeGroup_LaunchTemplate_Name
=== PAUSE TestAccAWSEksNodeGroup_LaunchTemplate_Name
=== RUN   TestAccAWSEksNodeGroup_LaunchTemplate_Version
=== PAUSE TestAccAWSEksNodeGroup_LaunchTemplate_Version
=== RUN   TestAccAWSEksNodeGroup_ReleaseVersion
=== PAUSE TestAccAWSEksNodeGroup_ReleaseVersion
=== RUN   TestAccAWSEksNodeGroup_RemoteAccess_Ec2SshKey
=== PAUSE TestAccAWSEksNodeGroup_RemoteAccess_Ec2SshKey
=== RUN   TestAccAWSEksNodeGroup_RemoteAccess_SourceSecurityGroupIds
=== PAUSE TestAccAWSEksNodeGroup_RemoteAccess_SourceSecurityGroupIds
=== RUN   TestAccAWSEksNodeGroup_ScalingConfig_DesiredSize
=== PAUSE TestAccAWSEksNodeGroup_ScalingConfig_DesiredSize
=== RUN   TestAccAWSEksNodeGroup_ScalingConfig_MaxSize
=== PAUSE TestAccAWSEksNodeGroup_ScalingConfig_MaxSize
=== RUN   TestAccAWSEksNodeGroup_ScalingConfig_MinSize
=== PAUSE TestAccAWSEksNodeGroup_ScalingConfig_MinSize
=== RUN   TestAccAWSEksNodeGroup_Tags
=== PAUSE TestAccAWSEksNodeGroup_Tags
=== RUN   TestAccAWSEksNodeGroup_Taints
=== PAUSE TestAccAWSEksNodeGroup_Taints
=== RUN   TestAccAWSEksNodeGroup_Version
=== PAUSE TestAccAWSEksNodeGroup_Version
=== CONT  TestAccAWSEksNodeGroup_basic
=== CONT  TestAccAWSEksNodeGroup_Tags
=== CONT  TestAccAWSEksNodeGroup_Labels
=== CONT  TestAccAWSEksNodeGroup_ScalingConfig_MinSize
=== CONT  TestAccAWSEksNodeGroup_ScalingConfig_MaxSize
=== CONT  TestAccAWSEksNodeGroup_LaunchTemplate_Version
=== CONT  TestAccAWSEksNodeGroup_LaunchTemplate_Name
=== CONT  TestAccAWSEksNodeGroup_LaunchTemplate_Id
=== CONT  TestAccAWSEksNodeGroup_InstanceTypes_Multiple
=== CONT  TestAccAWSEksNodeGroup_CapacityType_Spot
=== CONT  TestAccAWSEksNodeGroup_ForceUpdateVersion
=== CONT  TestAccAWSEksNodeGroup_ReleaseVersion
=== CONT  TestAccAWSEksNodeGroup_ScalingConfig_DesiredSize
=== CONT  TestAccAWSEksNodeGroup_InstanceTypes_Single
=== CONT  TestAccAWSEksNodeGroup_RemoteAccess_SourceSecurityGroupIds
=== CONT  TestAccAWSEksNodeGroup_disappears
=== CONT  TestAccAWSEksNodeGroup_DiskSize
=== CONT  TestAccAWSEksNodeGroup_Version
=== CONT  TestAccAWSEksNodeGroup_NamePrefix
=== CONT  TestAccAWSEksNodeGroup_RemoteAccess_Ec2SshKey
--- PASS: TestAccAWSEksNodeGroup_ScalingConfig_MaxSize (918.42s)
=== CONT  TestAccAWSEksNodeGroup_AmiType
--- PASS: TestAccAWSEksNodeGroup_NamePrefix (971.17s)
=== CONT  TestAccAWSEksNodeGroup_Taints
--- PASS: TestAccAWSEksNodeGroup_InstanceTypes_Multiple (973.64s)
=== CONT  TestAccAWSEksNodeGroup_Name_Generated
--- PASS: TestAccAWSEksNodeGroup_disappears (1014.51s)
--- PASS: TestAccAWSEksNodeGroup_Tags (1028.46s)
--- PASS: TestAccAWSEksNodeGroup_CapacityType_Spot (1028.79s)
--- PASS: TestAccAWSEksNodeGroup_basic (1034.43s)
--- PASS: TestAccAWSEksNodeGroup_InstanceTypes_Single (1034.53s)
--- PASS: TestAccAWSEksNodeGroup_ScalingConfig_DesiredSize (1061.22s)
--- PASS: TestAccAWSEksNodeGroup_RemoteAccess_Ec2SshKey (1077.52s)
--- PASS: TestAccAWSEksNodeGroup_ScalingConfig_MinSize (1101.10s)
--- PASS: TestAccAWSEksNodeGroup_Labels (1135.31s)
--- PASS: TestAccAWSEksNodeGroup_RemoteAccess_SourceSecurityGroupIds (1143.96s)
--- PASS: TestAccAWSEksNodeGroup_LaunchTemplate_Id (1282.99s)
--- PASS: TestAccAWSEksNodeGroup_DiskSize (1323.17s)
--- PASS: TestAccAWSEksNodeGroup_LaunchTemplate_Name (1513.69s)
--- PASS: TestAccAWSEksNodeGroup_LaunchTemplate_Version (1591.93s)
--- PASS: TestAccAWSEksNodeGroup_Name_Generated (951.49s)
=== CONT  TestAccAWSEksNodeGroup_AmiType
    provider_test.go:1103: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        2021/05/25 12:19:30 [DEBUG] Using modified User-Agent: Terraform/0.12.31 HashiCorp-terraform-exec/0.13.3
        
        Error: error creating EKS Node Group (tf-acc-test-2340751332921943352/tf-acc-test-2340751332921943352): InvalidParameterException: The following supplied instance types do not exist: [a1.medium]
        {
          RespMetadata: {
            StatusCode: 400,
            RequestID: "24c3e7e6-f884-45d5-b572-c4fd3649639a"
          },
          ClusterName: "tf-acc-test-2340751332921943352",
          Message_: "The following supplied instance types do not exist: [a1.medium]",
          NodegroupName: "tf-acc-test-2340751332921943352"
        }
        
          on terraform_plugin_test.tf line 154, in resource "aws_eks_node_group" "test":
         154: resource "aws_eks_node_group" "test" {
        
        
--- PASS: TestAccAWSEksNodeGroup_Taints (987.27s)
--- SKIP: TestAccAWSEksNodeGroup_AmiType (1087.91s)
--- PASS: TestAccAWSEksNodeGroup_ReleaseVersion (3255.18s)
--- PASS: TestAccAWSEksNodeGroup_ForceUpdateVersion (4055.76s)
--- PASS: TestAccAWSEksNodeGroup_Version (4118.42s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	4121.468s

@ewbankkit
Copy link
Contributor

@david7482 Thanks for the contribution 🎉 👏.
I went ahead and renamed the taints attribute to taint as this fits with our convention of using a singular name for a repeated block, e.g.

resource "aws_eks_node_group" "example" {
  ...

  taint {
    key    = "dedicated"
    value  = "gpuGroup"
    effect = "NO_SCHEDULE"
  }

  taint {
    key    = "special"
    value  = "true"
    effect = "PREFER_NO_SCHEDULE"
  }
}

@ewbankkit ewbankkit merged commit 301bc8c into hashicorp:main May 25, 2021
@github-actions github-actions bot added this to the v3.43.0 milestone May 25, 2021
@ghost
Copy link

ghost commented Jun 1, 2021

This has been released in version 3.43.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@github-actions
Copy link

github-actions bot commented Jul 2, 2021

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. service/eks Issues and PRs that pertain to the eks service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for taints on EKS Managed NodeGroup (aws_eks_node_group)
2 participants