mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Provider/aws - SNS Topics deleted from the UI were causing Terraform to
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
This commit is contained in:
parent
3792bd6f6f
commit
91cb65dd05
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user