From c92b7a980cd2874e587fe4866346032fc5f19307 Mon Sep 17 00:00:00 2001 From: Sam Clinckspoor Date: Fri, 26 Jun 2015 20:16:21 +0200 Subject: [PATCH] fixed possibly incorrectly returning destroyed --- .../aws/resource_aws_elasticache_parameter_group.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/builtin/providers/aws/resource_aws_elasticache_parameter_group.go b/builtin/providers/aws/resource_aws_elasticache_parameter_group.go index 024db72a2475..3574d5dcf64d 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 } }