diff --git a/builtin/providers/aws/resource_aws_elasticache_parameter_group.go b/builtin/providers/aws/resource_aws_elasticache_parameter_group.go index 024db72a2..3574d5dcf 100644 --- a/builtin/providers/aws/resource_aws_elasticache_parameter_group.go +++ b/builtin/providers/aws/resource_aws_elasticache_parameter_group.go @@ -191,15 +191,12 @@ func resourceAwsElasticacheParameterGroupDeleteRefreshFunc( if _, err := conn.DeleteCacheParameterGroup(&deleteOpts); err != nil { elasticahceerr, ok := err.(awserr.Error) - if !ok { - return d, "error", err - } - - if elasticahceerr.Code() != "CacheParameterGroupNotFoundFault" { + if ok && elasticahceerr.Code() == "CacheParameterGroupNotFoundFault" { + d.SetId("") return d, "error", err } + return d, "error", err } - return d, "destroyed", nil } }