Skip to content

Commit

Permalink
Remove exists function
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Vendetta committed Apr 5, 2019
1 parent abcd9e8 commit 9d93f15
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions aws/resource_aws_glue_catalog_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ func resourceAwsGlueCatalogTable() *schema.Resource {
Read: resourceAwsGlueCatalogTableRead,
Update: resourceAwsGlueCatalogTableUpdate,
Delete: resourceAwsGlueCatalogTableDelete,
Exists: resourceAwsGlueCatalogTableExists,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Expand Down Expand Up @@ -339,33 +338,6 @@ func resourceAwsGlueCatalogTableDelete(d *schema.ResourceData, meta interface{})
return nil
}

func resourceAwsGlueCatalogTableExists(d *schema.ResourceData, meta interface{}) (bool, error) {
glueconn := meta.(*AWSClient).glueconn
catalogID, dbName, name, tableIdErr := readAwsGlueTableID(d.Id())
if tableIdErr != nil {
return false, tableIdErr
}

log.Printf("[DEBUG] Glue Catalog Table: %s:%s:%s", catalogID, dbName, name)

input := &glue.GetTableInput{
CatalogId: aws.String(catalogID),
DatabaseName: aws.String(dbName),
Name: aws.String(name),
}

_, err := glueconn.GetTable(input)

if err != nil {
if isAWSErr(err, glue.ErrCodeEntityNotFoundException, "") {
return false, nil
}
return false, err
}

return true, nil
}

func expandGlueTableInput(d *schema.ResourceData) *glue.TableInput {
tableInput := &glue.TableInput{
Name: aws.String(d.Get("name").(string)),
Expand Down

0 comments on commit 9d93f15

Please sign in to comment.