-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Add retry to eks cluster delete #23366
Add retry to eks cluster delete #23366
Conversation
Signed-off-by: Eddie Zaneski <eddiezane@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @eddiezane 👋
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! 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @eddiezane , thank you for this PR! Overall looks like a great workaround to include in this resource. I've pushed up the changelog entry as the change enhances the current delete functionality and will refactor to use tfresource.RetryWhen
since we only need to retry on the ErrCodeResourceInUseException
Thanks @anGie44! I went with |
Oh that's a great point @eddiezane , I overlooked that and it doesn't hurt to use the |
This functionality has been released in v4.4.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! |
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. |
EKS delete cluster calls can fail due to an in-progress cluster upgrade operation (customer initiated or automated scaling by EKS) or service outage.
This PR helps mitigate delete cluster failures by adding a retry with backoff.
The suite is currently running and I will update when it finishes.The failure seems like a flake?Output from acceptance testing:
I tested this manually by creating an EKS cluster using https://github.com/hashicorp/learn-terraform-provision-eks-cluster. I deployed the sample as is and then updated the config to use Kubernetes 1.21. I then built a copy of the provider that commented out
waitClusterUpdateSuccessful
. I applied the change and started the cluster upgrade. Then I ran the destroy and observed that it retries successfully while an upgrade is in progress.Output
Community Note