Skip to content

feat: add validatefunc to name+pfx for eks_node_group #29975

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

Conversation

DorukAkinci
Copy link
Contributor

@DorukAkinci DorukAkinci commented Mar 13, 2023

Description

This PR adds ValidateFuncs to node_group_name and node_group_name_prefix variables for eks_node_group.

Relations

Closes #29974

References

Official AWS Docs: The node group name can't be longer than 63 characters. It must start with letter or digit, but can also include hyphens and underscores for the remaining characters.

Output from Acceptance Testing

$ make testacc TESTS=TestAccEKSNodeGroup_basic PKG=eks
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/eks/... -v -count 1 -parallel 20 -run='TestAccEKSNodeGroup_basic'  -timeout 180m
=== RUN   TestAccEKSNodeGroup_basic
=== PAUSE TestAccEKSNodeGroup_basic
=== CONT  TestAccEKSNodeGroup_basic
--- PASS: TestAccEKSNodeGroup_basic (933.79s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/eks	935.796s
----------
$ make testacc TESTS=TestAccEKSNodeGroup_namePrefix PKG=eks
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/eks/... -v -count 1 -parallel 20 -run='TestAccEKSNodeGroup_namePrefix'  -timeout 180m
=== RUN   TestAccEKSNodeGroup_namePrefix
=== PAUSE TestAccEKSNodeGroup_namePrefix
=== CONT  TestAccEKSNodeGroup_namePrefix
--- PASS: TestAccEKSNodeGroup_namePrefix (1220.20s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/eks	1222.236s

image
image

Before the Enhancement / Feature

The Terraform provider thinks it can actually create the new node group and waits your approval.

image

It fails with the client's runtime error.

image

After the Enhancement / Feature

The provider throws an error even before asking the user for approval. The initial validation also prevents any unexpected executions that happen in the apply state because once the AWS API endpoint throws an error, terraform breaks the apply command

image

@github-actions
Copy link

Community Note

Voting for Prioritization

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

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. size/XS Managed by automation to categorize the size of a PR. service/eks Issues and PRs that pertain to the eks service. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 13, 2023
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 @DorukAkinci 👋

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 CONTRIBUTOR 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! 😃

@DorukAkinci DorukAkinci reopened this Mar 14, 2023
@DorukAkinci DorukAkinci changed the title feat: add validatefunc to name+pfx for eks_node_group feat: add validatefunc to name+pfx for eks_node_group Mar 14, 2023
@github-actions github-actions bot added the documentation Introduces or discusses updates to documentation. label Mar 16, 2023
@DorukAkinci
Copy link
Contributor Author

I have also revised the documentation; consequently, the workflows now require reapproval.

@ewbankkit ewbankkit self-assigned this Apr 17, 2023
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 🚀.

% make testacc TESTARGS='-run=TestAccEKSNodeGroup_basic\|TestAccEKSNodeGroup_Name_generated\|TestAccEKSNodeGroup_namePrefix' PKG=eks ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/eks/... -v -count 1 -parallel 3  -run=TestAccEKSNodeGroup_basic\|TestAccEKSNodeGroup_Name_generated\|TestAccEKSNodeGroup_namePrefix -timeout 180m
=== RUN   TestAccEKSNodeGroup_basic
=== PAUSE TestAccEKSNodeGroup_basic
=== RUN   TestAccEKSNodeGroup_Name_generated
=== PAUSE TestAccEKSNodeGroup_Name_generated
=== RUN   TestAccEKSNodeGroup_namePrefix
=== PAUSE TestAccEKSNodeGroup_namePrefix
=== CONT  TestAccEKSNodeGroup_basic
=== CONT  TestAccEKSNodeGroup_namePrefix
=== CONT  TestAccEKSNodeGroup_Name_generated
--- PASS: TestAccEKSNodeGroup_namePrefix (1032.48s)
--- PASS: TestAccEKSNodeGroup_basic (1095.09s)
--- PASS: TestAccEKSNodeGroup_Name_generated (1189.06s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/eks	1199.923s

@ewbankkit
Copy link
Contributor

@DorukAkinci Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 5eb9325 into hashicorp:main Apr 17, 2023
@github-actions github-actions bot added this to the v4.64.0 milestone Apr 17, 2023
@github-actions
Copy link

This functionality has been released in v4.64.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. Thank you!

@github-actions
Copy link

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 May 21, 2023
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/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement]: aws_eks_node_group needs ValidateFunc for node_group_name and node_group_name_prefix
2 participants