Skip to content

Commit

Permalink
Replace usage of Delete field with DeleteContext in resource_id (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
bendbennett committed Apr 12, 2022
1 parent d262d66 commit c63329b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/provider/resource_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ exist concurrently.
`,
CreateContext: CreateID,
ReadContext: RepopulateEncodings,
Delete: schema.RemoveFromState,
DeleteContext: DeleteID,
Importer: &schema.ResourceImporter{
State: ImportID,
},
Expand Down Expand Up @@ -146,6 +146,11 @@ func RepopulateEncodings(_ context.Context, d *schema.ResourceData, _ interface{
return nil
}

func DeleteID(_ context.Context, d *schema.ResourceData, _ interface{}) diag.Diagnostics {
d.SetId("")
return nil
}

func ImportID(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
id := d.Id()

Expand Down

0 comments on commit c63329b

Please sign in to comment.