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

fix: add iam retry to eks access entry #35535

Merged

Conversation

iandrewt
Copy link
Contributor

Description

If an EKS Access Entry is made in the same Terraform apply as the IAM role associated with it, it may fail due to eventual consistency with IAM. This PR adds a retry to handle this case.

The existing tests would not have triggered this as the IAM role resource did not depend on the cluster resource, so the role would have been made early, with plenty of time for consistency to catch up by the time the cluster was ready to accept access entry resources.

Relations

N/A

References

N/A

Output from Acceptance Testing

% make testacc TESTS=TestAccEKSAccessEntry_eventualConsistency PKG=eks
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/eks/... -v -count 1 -parallel 20 -run='TestAccEKSAccessEntry_eventualConsistency'  -timeout 360m
=== RUN   TestAccEKSAccessEntry_eventualConsistency
=== PAUSE TestAccEKSAccessEntry_eventualConsistency
=== CONT  TestAccEKSAccessEntry_eventualConsistency
--- PASS: TestAccEKSAccessEntry_eventualConsistency (734.30s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/eks        734.859s
...

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 size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/eks Issues and PRs that pertain to the eks service. labels Jan 29, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 29, 2024
@iandrewt iandrewt force-pushed the b-aws_eks_access_entry-eventual-consistency branch from e28a9fa to 4da2e2b Compare January 29, 2024 09:58
@ewbankkit ewbankkit added eventual-consistency Pertains to eventual consistency issues. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 29, 2024
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=TestAccEKSAccessEntry_eventualConsistency\|TestAccEKSAccessEntry_basic' PKG=eks
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/eks/... -v -count 1 -parallel 20  -run=TestAccEKSAccessEntry_eventualConsistency\|TestAccEKSAccessEntry_basic -timeout 360m
=== RUN   TestAccEKSAccessEntry_basic
=== PAUSE TestAccEKSAccessEntry_basic
=== RUN   TestAccEKSAccessEntry_eventualConsistency
=== PAUSE TestAccEKSAccessEntry_eventualConsistency
=== CONT  TestAccEKSAccessEntry_basic
=== CONT  TestAccEKSAccessEntry_eventualConsistency
--- PASS: TestAccEKSAccessEntry_basic (552.72s)
--- PASS: TestAccEKSAccessEntry_eventualConsistency (645.22s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/eks	655.765s

@ewbankkit
Copy link
Contributor

@iandrewt Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 5042819 into hashicorp:main Jan 29, 2024
36 checks passed
@github-actions github-actions bot added this to the v5.35.0 milestone Jan 29, 2024
@iandrewt iandrewt deleted the b-aws_eks_access_entry-eventual-consistency branch January 29, 2024 13:58
Copy link

github-actions bot commented Feb 2, 2024

This functionality has been released in v5.35.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!

Copy link

github-actions bot commented Mar 4, 2024

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 Mar 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
eventual-consistency Pertains to eventual consistency issues. service/eks Issues and PRs that pertain to the eks service. size/M 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.

None yet

2 participants