diff --git a/CHANGELOG.md b/CHANGELOG.md index 220d08288..51103570d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ BUG FIXES: * provider/aws: Allow cluster name, not only ARN for `aws_ecs_service` [GH-3668] * provider/aws: ignore association not exist on route table destroy [GH-3615] * provider/aws: Fix policy encoding issue with SNS Topics [GH-3700] + * provider/aws: Tolerate ElastiCache clusters being deleted outside Terraform [GH-3767] * provider/azure: various bugfixes [GH-3695] * provider/digitalocean: fix issue preventing SSH fingerprints from working [GH-3633] * provider/openstack: Fix several issues causing unresolvable diffs [GH-3440] diff --git a/builtin/providers/aws/resource_aws_elasticache_cluster.go b/builtin/providers/aws/resource_aws_elasticache_cluster.go index 3460fb292..f2410dcd5 100644 --- a/builtin/providers/aws/resource_aws_elasticache_cluster.go +++ b/builtin/providers/aws/resource_aws_elasticache_cluster.go @@ -241,6 +241,12 @@ func resourceAwsElasticacheClusterRead(d *schema.ResourceData, meta interface{}) res, err := conn.DescribeCacheClusters(req) if err != nil { + if eccErr, ok := err.(awserr.Error); ok && eccErr.Code() == "CacheClusterNotFound" { + log.Printf("[WARN] ElastiCache Cluster (%s) not found", d.Id()) + d.SetId("") + return nil + } + return err }