Fix NotFound not detected during a read on aws sns platform applications #6436
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We've seen some issues with terraform where the sns platform application has been created via Terraform, but deleted via another mean (ie: webui).
Terraform wouldn't detect that the SNS platform application has been deleted and would error out. To fix this we had to manually remove the impacted resources from the state.
This error was already present on other resources, but have been fixed a while ago : hashicorp/terraform#4891
Code can now be found at :
https://github.com/terraform-providers/terraform-provider-aws/blob/20151d7b332763952f44209e7356ebb661d9add0/aws/resource_aws_sns_topic.go#L198-L202
Looking at how it is done for the SNS topics, I figured it wouldn't be super difficult to fix and could make a small PR to help.
Tests are running fine