Skip to content

Commit

Permalink
Provider/aws - SNS Topics deleted from the UI were causing Terraform to
Browse files Browse the repository at this point in the history
throw an error:

* aws_sns_topic_subscription.checker: NotFound: Subscription does not
* exist
    status code: 404, request id: b8ca0c27-1a62-57b3-8b96-43038a0ead86

Terraform wasn't refreshing the state when the topic gave a 404
  • Loading branch information
stack72 committed Jan 28, 2016
1 parent 3792bd6 commit 91cb65d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions builtin/providers/aws/resource_aws_sns_topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ func resourceAwsSnsTopicRead(d *schema.ResourceData, meta interface{}) error {
})

if err != nil {
if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFound" {
log.Printf("[WARN] SNS Topic (%s) not found, error code (404)", d.Id())
d.SetId("")
return nil
}

return err
}

Expand Down

0 comments on commit 91cb65d

Please sign in to comment.