Skip to content

Commit

Permalink
r/aws_elasticache_parameter_group: reset ID if deleted outside of Ter…
Browse files Browse the repository at this point in the history
…raform
  • Loading branch information
tthompson-figma committed Jul 24, 2023
1 parent a932c7b commit f3b9fa0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/service/elasticache/parameter_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ func resourceParameterGroupRead(ctx context.Context, d *schema.ResourceData, met
conn := meta.(*conns.AWSClient).ElastiCacheConn(ctx)

parameterGroup, err := FindParameterGroupByName(ctx, conn, d.Id())
if !d.IsNewResource() && tfresource.NotFound(err) {
log.Printf("[WARN] ElastiCache Parameter Group (%s) not found, removing from state", d.Id())
d.SetId("")
return diags
}
if err != nil {
return sdkdiag.AppendErrorf(diags, "unable to find ElastiCache Parameter Group (%s): %s", d.Id(), err)
}
Expand Down

0 comments on commit f3b9fa0

Please sign in to comment.