-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 eks addon resource, data_source #16972
Conversation
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 @juozasget 👋
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! 😃
- Add validation func for resolve_conflicts - Add idempotency token for create and update requests
@shuheiktgw @bflad Thank you very much for your initial comments. I have updated original post with newly added ACC test outputs along with other missing things. I think the PR is now in good shape for a review. Things I'd like to point out:
I also left some TODO items, which would be nice to do/improve. I will try to work on them while waiting for feedback. 🔧 |
Hello. I've addressed the TODO things and improved the PR, mainly in these areas:
I have been marinating this for 2-3 weeks, because after these improvements broke test case for TestAccAWSEksAddons_Tags. I've been pulling my hair out trying to find what could have caused this. I believe I've finally found it. Here are the details: I added aws_eks_addon to aws_eks_cluster deps: This caused the eks add-on deletion api to be called, before eks cluster deletion. Previously it would just delete the eks cluster. I believe that there might be some weird bug that will cause eks add-on to get stuck in DELETING state if the eks add-on had it's TAG values modified. This only happens if tag values were modified/set.
Opened question in AWS forum. Sadly I don't think there is much chance of getting an answer... I've since removed it from sweeper dependencies and all test are passing. Not sure what to do about this. |
Any chance we can review this PR again? Please. |
is this going to be merged? |
Can we get this merged in? It's impossible to configure a fully functioning EKS cluster with managed nodes using only terraform right now because you can't install the VPC CNI addon. Who needs to code review this? @shuheiktgw @bflad |
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.
Thanks for the PR, @juozasget. I've made some updates
Acceptance test results
--- PASS: TestAccAWSEksAddon_basic (772.00s)
--- PASS: TestAccAWSEksAddon_ServiceAccountRoleArn (830.59s)
--- PASS: TestAccAWSEksAddonDataSource_basic (857.39s)
--- PASS: TestAccAWSEksAddon_Tags (885.01s)
--- PASS: TestAccAWSEksAddon_disappears_Cluster (891.55s)
--- PASS: TestAccAWSEksAddon_disappears (946.00s)
--- PASS: TestAccAWSEksAddon_ResolveConflicts (976.91s)
--- PASS: TestAccAWSEksAddon_AddonVersion (989.17s)
"addon_name": { | ||
Type: schema.TypeString, | ||
Required: true, | ||
ForceNew: true, |
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.
ForceNew
isn't needed on data sources
|
||
func dataSourceAwsEksAddon() *schema.Resource { | ||
return &schema.Resource{ | ||
ReadContext: dataSourceAwsEksAddonRead, |
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.
We're still working out the interactions between timeouts handled by the Terraform Context
and the AWS API. To work around the interactions, we use the <operation>WithoutTimeout
functions instead of <operation>Context
functions.
ReadContext: dataSourceAwsEksAddonRead, | |
ReadWithoutTimeout: dataSourceAwsEksAddonRead, |
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t); testAccPreCheckAWSEksAddon(t) }, | ||
ProviderFactories: testAccProviderFactories, |
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.
We've added a parameter to handle acceptance test errors in a cleaner manner: https://github.com/hashicorp/terraform-provider-aws/blob/main/docs/contributing/running-and-writing-acceptance-tests.md#errorchecks
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t); testAccPreCheckAWSEksAddon(t) }, | |
ProviderFactories: testAccProviderFactories, | |
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t); testAccPreCheckAWSEksAddon(t) }, | |
ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), | |
ProviderFactories: testAccProviderFactories, |
|
||
## Example Usage | ||
|
||
```hcl |
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.
We prefer using terraform
as the language name now
```hcl | |
```terraform |
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t); testAccPreCheckAWSEksAddon(t) }, | ||
ProviderFactories: testAccProviderFactories, |
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.
We've added a parameter to handle acceptance test errors in a cleaner manner: https://github.com/hashicorp/terraform-provider-aws/blob/main/docs/contributing/running-and-writing-acceptance-tests.md#errorchecks
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t); testAccPreCheckAWSEksAddon(t) }, | |
ProviderFactories: testAccProviderFactories, | |
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t); testAccPreCheckAWSEksAddon(t) }, | |
ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), | |
ProviderFactories: testAccProviderFactories, |
This has been released in version 3.37.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! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
This is my first contribution - feedback is very much welcome.
Thank you!
UPDATED & removed WIP mention
Community Note
Closes #16542
Release note for CHANGELOG:
Output from acceptance testing: