Skip to content

Commit

Permalink
Merge pull request #21227 from DrFaust92/r/glue_catalog_delete
Browse files Browse the repository at this point in the history
r/glue_catalog_table - ignore not exists errors on delete
  • Loading branch information
ewbankkit authored Oct 13, 2021
2 parents 9a75560 + 70268d1 commit 6199529
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/21227.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/glue_catalog_table: Ignore not exists errors on delete
```
3 changes: 3 additions & 0 deletions aws/resource_aws_glue_catalog_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,9 @@ func resourceAwsGlueCatalogTableDelete(d *schema.ResourceData, meta interface{})
DatabaseName: aws.String(dbName),
})
if err != nil {
if isAWSErr(err, glue.ErrCodeEntityNotFoundException, "") {
return nil
}
return fmt.Errorf("Error deleting Glue Catalog Table: %w", err)
}
return nil
Expand Down
2 changes: 2 additions & 0 deletions aws/resource_aws_glue_catalog_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ func TestAccAWSGlueCatalogTable_disappears_database(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testAccCheckGlueCatalogTableExists(resourceName),
testAccCheckResourceDisappears(testAccProvider, resourceAwsGlueCatalogDatabase(), "aws_glue_catalog_database.test"),
testAccCheckResourceDisappears(testAccProvider, resourceAwsGlueCatalogTable(), resourceName),
),
ExpectNonEmptyPlan: true,
},
Expand Down Expand Up @@ -650,6 +651,7 @@ func TestAccAWSGlueCatalogTable_disappears(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testAccCheckGlueCatalogTableExists(resourceName),
testAccCheckResourceDisappears(testAccProvider, resourceAwsGlueCatalogTable(), resourceName),
testAccCheckResourceDisappears(testAccProvider, resourceAwsGlueCatalogTable(), resourceName),
),
ExpectNonEmptyPlan: true,
},
Expand Down

0 comments on commit 6199529

Please sign in to comment.