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

Terraform fails to identify missing sns subscriptions #6625

Closed
MartinMeinhold opened this issue May 12, 2016 · 3 comments · Fixed by #6629
Closed

Terraform fails to identify missing sns subscriptions #6625

MartinMeinhold opened this issue May 12, 2016 · 3 comments · Fixed by #6629

Comments

@MartinMeinhold
Copy link

See #4888 for the original case which only addressed the aws_sns_topic resources but not the aws_sns_topic_subscription one. I can see the related PR #4891 updated aws_sns_topic but didn't touch the subscriptions.

Terraform Version

Terraform v0.6.16

Affected Resources

  • aws_sns_topic_subscription

Terraform Configuration Files

resource "aws_sns_topic" "testme" {
    name     = "testme"
    provider = "aws.us_east_1"
}

resource "aws_sns_topic_subscription" "testme" {
    topic_arn = "${aws_sns_topic.testme.arn}"
    protocol  = "lambda"
    endpoint  = "${aws_lambda_function.somefunction.arn}"
    provider  = "aws.us_east_1"
}

Expected Behavior

Terraform would translate the NotFound response code to a missing resource and try to create it.

Actual Behavior

Terraform bails out in planning mode with an unexpected error.

Steps to Reproduce

  1. Create a configuration with a aws_sns_topic and a aws_sns_topic_subscription and create an execution plan
  2. Apply the execution plan; terraform will create the sns topic and the subscription
  3. Delete subscription manually (e.g. via the Amazon Console or via the CLI)
  4. Create a new execution plan; terraform should discover the previously created subscription has been deleted ...

... but instead it bails out with

* aws_sns_topic_subscription.testme: NotFound: Subscription does not exist
    status code: 404, request id: a22e7ed7-3630-5a8a-b767-317ac1440e24

References

stack72 added a commit that referenced this issue May 12, 2016
missing

Fixes #6625

When an SNS topic subscription was created with TF and then removed via
the AWS Console, Terraform threw an error:

```
* aws_sns_topic_subscription.testme: NotFound: Subscription does not
* exist
    status code: 404, request id: a22e7ed7-3630-5a8a-b767-317ac1440e24
```

This PR will remove the topic subscription from state on a NotFound and
will then readd the subscripton
@stack72
Copy link
Contributor

stack72 commented May 12, 2016

Hi @MartinMeinhold

apologies for not picking this up in the first fix - I have just opened another PR which fixes the issue in the topic subscription this time

Paul

stack72 added a commit that referenced this issue May 12, 2016
)

missing

Fixes #6625

When an SNS topic subscription was created with TF and then removed via
the AWS Console, Terraform threw an error:

```
* aws_sns_topic_subscription.testme: NotFound: Subscription does not
* exist
    status code: 404, request id: a22e7ed7-3630-5a8a-b767-317ac1440e24
```

This PR will remove the topic subscription from state on a NotFound and
will then readd the subscripton
@MartinMeinhold
Copy link
Author

No worries, all good. Thanks for the quick response.

cristicalin pushed a commit to cristicalin/terraform that referenced this issue May 24, 2016
…shicorp#6629)

missing

Fixes hashicorp#6625

When an SNS topic subscription was created with TF and then removed via
the AWS Console, Terraform threw an error:

```
* aws_sns_topic_subscription.testme: NotFound: Subscription does not
* exist
    status code: 404, request id: a22e7ed7-3630-5a8a-b767-317ac1440e24
```

This PR will remove the topic subscription from state on a NotFound and
will then readd the subscripton
@ghost
Copy link

ghost commented Apr 25, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants