diff --git a/builtin/providers/aws/resource_aws_elasticsearch_domain.go b/builtin/providers/aws/resource_aws_elasticsearch_domain.go index b7ba0a843..9b9adfaa8 100644 --- a/builtin/providers/aws/resource_aws_elasticsearch_domain.go +++ b/builtin/providers/aws/resource_aws_elasticsearch_domain.go @@ -256,6 +256,11 @@ func resourceAwsElasticSearchDomainRead(d *schema.ResourceData, meta interface{} DomainName: aws.String(d.Get("domain_name").(string)), }) if err != nil { + if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "ResourceNotFoundException" { + log.Printf("[INFO] ElasticSearch Domain %q not found", d.Get("domain_name").(string)) + d.SetId("") + return nil + } return err }