-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Fixes #8173 #8174
Fixes #8173 #8174
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.
Hi @thomasv314 👋 Thanks so much for this fix and adding the test. Please see the two minor notes and we can get this in.
@@ -16,6 +16,7 @@ func resourceAwsGlueCatalogTable() *schema.Resource { | |||
Read: resourceAwsGlueCatalogTableRead, | |||
Update: resourceAwsGlueCatalogTableUpdate, | |||
Delete: resourceAwsGlueCatalogTableDelete, | |||
Exists: resourceAwsGlueCatalogTableExists, |
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.
Sorry this might not be clear since we have a few resources that implement it, but we are preferring to skip implementing the Exists
function in this provider. Could you remove this? It usually introduces unnecessary logic duplication as the beginning of each resource Read
function should handle the "existence" testing logic and triggering recreation via the d.SetId("")
and return nil
pattern. Thanks!
@@ -265,6 +266,7 @@ func resourceAwsGlueCatalogTableRead(d *schema.ResourceData, meta interface{}) e | |||
if isAWSErr(err, glue.ErrCodeEntityNotFoundException, "") { | |||
log.Printf("[WARN] Glue Catalog Table (%s) not found, removing from state", d.Id()) | |||
d.SetId("") | |||
return nil |
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.
💯 this should be the only fix required here.
Co-Authored-By: thomasv314 <thomas@vendetta.io>
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.
LGTM, thanks so much @thomasv314 🚀
Output from acceptance testing:
--- PASS: TestAccAWSGlueCatalogTable_full (10.59s)
--- PASS: TestAccAWSGlueCatalogTable_basic (10.61s)
--- PASS: TestAccAWSGlueCatalogTable_importBasic (12.12s)
--- PASS: TestAccAWSGlueCatalogTable_recreates (12.97s)
--- PASS: TestAccAWSGlueCatalogTable_update_addValues (16.20s)
--- PASS: TestAccAWSGlueCatalogTable_update_replaceValues (16.29s)
@bflad Sorry I totally blanked on updating the PR after I pushed, but just wanted to give you a shout out and thanks for the speedy response and triage! It's much appreciated 🙏 |
This has been released in version 2.6.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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! |
Community Note
Fixes #8173
Changes proposed in this pull request:
Output from acceptance testing: