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

Fix NotFound not detected during a read on aws sns platform applications #6436

Merged
merged 2 commits into from
Nov 12, 2018

Conversation

MagicMicky
Copy link
Contributor

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.

Error: Error refreshing state: 2 error(s) occurred:

* module.redacted.aws_sns_platform_application.my_apn1: 1 error(s) occurred:

* module.redacted.aws_sns_platform_application.my_apn1: aws_sns_platform_application.my_apn1: NotFound: PlatformApplication does not exist
    status code: 404, request id: <redacted>
* module.redacted.aws_sns_platform_application.my_apn2: 1 error(s) occurred:

* module.redacted.aws_sns_platform_application.my_apn2: aws_sns_platform_application.my_apn2: NotFound: PlatformApplication does not exist
    status code: 404, request id: <redacted>

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

make test                                                                                                                                                                                                 bugfix-snsplatformapp-notfound
==> Checking that code complies with gofmt requirements...
go test ./... -timeout=30s -parallel=4
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1.994s

@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/sns Issues and PRs that pertain to the sns service. labels Nov 12, 2018
Co-Authored-By: MagicMicky <Micky0304@gmail.com>
@bflad bflad added this to the v1.44.0 milestone Nov 12, 2018
@bflad bflad added the bug Addresses a defect in current functionality. label Nov 12, 2018
@bflad bflad merged commit 3b1e9f4 into hashicorp:master Nov 12, 2018
@bflad
Copy link
Contributor

bflad commented Nov 12, 2018

LGTM, thanks @MagicMicky! 🚀

bflad added a commit that referenced this pull request Nov 12, 2018
@bflad
Copy link
Contributor

bflad commented Nov 15, 2018

This has been released in version 1.44.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 2, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 2, 2020
@MagicMicky MagicMicky deleted the bugfix-snsplatformapp-notfound branch August 6, 2020 09:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/sns Issues and PRs that pertain to the sns service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants