From 52251f824c832c0053399e523217d47a1dcad80a Mon Sep 17 00:00:00 2001 From: MagicMicky Date: Mon, 12 Nov 2018 18:08:11 +0100 Subject: [PATCH 1/2] Fix NotFound not detected during a read on aws sns platform applications --- aws/resource_aws_sns_platform_application.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_sns_platform_application.go b/aws/resource_aws_sns_platform_application.go index c425c458ec1..1c1be9d0a3f 100644 --- a/aws/resource_aws_sns_platform_application.go +++ b/aws/resource_aws_sns_platform_application.go @@ -203,6 +203,11 @@ func resourceAwsSnsPlatformApplicationRead(d *schema.ResourceData, meta interfac }) if err != nil { + if isAWSErr(err, sns.ErrCodeNotFoundException, "") { + log.Printf("[WARN] SNS Topic (%s) not found, error code (404)", d.Id()) + d.SetId("") + return nil + } return err } From 9780fcfd6ce779b9c45afef58a91a8967924dff6 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Mon, 12 Nov 2018 19:49:23 +0100 Subject: [PATCH 2/2] Fix copy/paste print issue Co-Authored-By: MagicMicky --- aws/resource_aws_sns_platform_application.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_sns_platform_application.go b/aws/resource_aws_sns_platform_application.go index 1c1be9d0a3f..c684e06cf86 100644 --- a/aws/resource_aws_sns_platform_application.go +++ b/aws/resource_aws_sns_platform_application.go @@ -204,7 +204,7 @@ func resourceAwsSnsPlatformApplicationRead(d *schema.ResourceData, meta interfac if err != nil { if isAWSErr(err, sns.ErrCodeNotFoundException, "") { - log.Printf("[WARN] SNS Topic (%s) not found, error code (404)", d.Id()) + log.Printf("[WARN] SNS Platform Application (%s) not found, removing from state", d.Id()) d.SetId("") return nil }