Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/aws: Refresh aws_elasticsearch_domain from state when ResourceNotFoundException #8643

Merged
merged 2 commits into from
Sep 3, 2016

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Sep 3, 2016

Fixes #3967

When an ElasticSearch domain has been deleted outside of Terraform, the
next Terraform operation would return the following:

* aws_elasticsearch_domain.curvelogic_es: ResourceNotFoundException:
* Domain not found: curvelogic-es
    status code: 409, request id: 6e4b2371-8e1a-11e5-bd07-7741b705d65c

We now refresh the resource from state when it is no longer found

RecordNotFoundException

Fixes #3967

When an ElasticSearch domain has been deleted outside of Terraform, the
next Terraform operation would return the following:

```
* aws_elasticsearch_domain.curvelogic_es: ResourceNotFoundException:
* Domain not found: curvelogic-es
    status code: 409, request id: 6e4b2371-8e1a-11e5-bd07-7741b705d65c
```

We now refresh the resource from state when it is no longer found
@@ -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() == "RecordNotFoundException" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is the right error code?

http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-configuration-api.html#es-configuration-api-errors-resourcenotfound

the API reference says "ResourceNotFoundException", i.e. Resource not Record

@radeksimko radeksimko added bug provider/aws waiting-response An issue/pull request is waiting for a response from the community labels Sep 3, 2016
@stack72 stack72 changed the title provider/aws: Refresh aws_elasticsearch_domain from state when RecordNotFoundException provider/aws: Refresh aws_elasticsearch_domain from state when ResourceNotFoundException Sep 3, 2016
@radeksimko
Copy link
Member

LGTM.

@radeksimko radeksimko merged commit eaa4868 into master Sep 3, 2016
@radeksimko radeksimko deleted the b-aws-refresh-AES branch September 3, 2016 13:55
@ghost
Copy link

ghost commented Apr 22, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug provider/aws waiting-response An issue/pull request is waiting for a response from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

terraform refresh of AES domain fails with RecordNotFoundException - stuck
2 participants