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

Resource aws_sns_topic_subscription, new argument redrive_policy #10931

Closed
Cayce opened this issue Nov 19, 2019 · 30 comments · Fixed by #11770
Closed

Resource aws_sns_topic_subscription, new argument redrive_policy #10931

Cayce opened this issue Nov 19, 2019 · 30 comments · Fixed by #11770
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/sns Issues and PRs that pertain to the sns service.
Milestone

Comments

@Cayce
Copy link

Cayce commented Nov 19, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

AWS implemented a new feature for SNS subscription: support for Dead-Letter Queues
https://aws.amazon.com/about-aws/whats-new/2019/11/amazon-sns-adds-support-for-dead-letter-queues-dlq/
The request is to implement it in resource aws_sns_topic_subscription, please add redrive_policy as argument of this resource.

New or Affected Resource

  • aws_sns_topic_subscription

Potential Terraform Configuration

resource "aws_sns_topic_subscription" "lamda_function_sns_subscription" {
  topic_arn       = "arn:aws:sns:us-east-1:***:TOPIC_NAME"
  protocol        = "lambda"
  endpoint        = "arn:aws:lambda:us-east-1:***:function:function-name"
  redrive_policy = <<EOF
    {
      "deadLetterTargetArn": "arn:aws:sqs:us-east-1:***:queue-dlq"
    }
  EOF
}
@Cayce Cayce added the enhancement Requests to existing resources that expand the functionality or scope. label Nov 19, 2019
@ghost ghost added the service/sns Issues and PRs that pertain to the sns service. label Nov 19, 2019
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Nov 19, 2019
@Ricool06
Copy link
Contributor

PR #11770 can fix this, tested it manually, but never written Go before so unsure of how to unit and ACC test at the moment.

@Ricool06
Copy link
Contributor

Okay so I'm in the middle of writing tests for the PR, and it seems you cannot just remove the RedrivePolicy attribute from a subscription. Once set, it requires a redrive policy with a valid arn for the deadLetterTargetArn attribute. I'm going to push the commits so far without the attribute removal test to get some visibility on it.

@Ricool06
Copy link
Contributor

You can disable the redrive policy by making sure AttributeValue for RedrivePolicy is not set in the request. Just figuring out how to do that for the request to AWS.

@Ricool06
Copy link
Contributor

Fixed it, sorry for spam, GitHub mobile won't let me edit. #11770 is ready with ACC tests passing.

@kabo
Copy link

kabo commented Mar 24, 2020

Any update on this? Sure could use this right about now :D

@Ricool06
Copy link
Contributor

Any update on this? Sure could use this right about now :D

I've attached a pull request, ready to go, but I'm yet to get any of the terraform peeps to review. If you could show/tell me how to get their attention a bit, I would appreciate it. Happy to progress this 👍

@gageorsburn
Copy link

Also in need of this feature.

@jdrowne
Copy link

jdrowne commented Apr 17, 2020

Reiterating we have a real life need for this feature.

@amalbuquerque
Copy link

Also depending on this. Do we have an ETA for @Ricool06 PR to be merged?

Thanks in advance!

@Ricool06
Copy link
Contributor

Ricool06 commented Apr 24, 2020

@amalbuquerque I am waiting on a review from the terraform people, until then, I am unable to merge. ☹️

The PR has been ready for review for months.

EDIT: Misread your comment, thought you were asking me when I can merge it. 😅

@isikdos
Copy link

isikdos commented May 14, 2020

We have a real life need for this feature, Adding my support to increase visibility for this item.

@gustavoamigo
Copy link

Does anyone have a workaround to this? Maybe using CloudFormation or something?

@Ricool06
Copy link
Contributor

@gustavoamigo the workaround until my PR gets merged is to use a null resource + aws cli

resource "null_resource" "redrive_policy" {
  provisioner "local-exec" {
    command = "aws sns <put aws cli command here>"
  }
}

Make sure that it depends on your sns topic/subscription resource so the cli command runs only after the necessary resources are created.

@ssteuteville
Copy link

Also need this.

@Ricool06
Copy link
Contributor

Also need this.

If you can get @bflad or any other terraform maintainer to review and merge this PR (#11770): #11770 then we can have it. 👍

@rbcrwd
Copy link

rbcrwd commented Aug 20, 2020

'twould be nice to have this. the workaround a few comments up is helpful, but the need is real and it looks like we have a PR ready for this.

@davebrown211
Copy link

also need this

@shanecurran
Copy link

+1! blocking one of our major infra changes :(

@Ricool06
Copy link
Contributor

Okay, so I think the PR bot may have bugged out and that's why it's not getting any reviews. I'm going to open a new PR and hopefully it gets reviewed and merged.
Apologies if this goes against the rules a bit.

@Ricool06
Copy link
Contributor

#14800 hopefully resolves the issue with the PR bot.

@breathingdust
Copy link
Member

Hi all! 👋 Just wanted to direct you to our public roadmap for this quarter (Nov-Jan) in which this item has been mentioned.

Due to the significant community interest in support for this feature, we will be looking at merging existing contributions soon.

We appreciate all the contributions and feedback thus far.

Look out for support in the provider soon!

@Ricool06
Copy link
Contributor

Hi all! Just wanted to direct you to our public roadmap for this quarter (Nov-Jan) in which this item has been mentioned.

Due to the significant community interest in support for this feature, we will be looking at merging existing contributions soon.

We appreciate all the contributions and feedback thus far.

Look out for support in the provider soon!

Hey, it seems the roadmap references the wrong issue number. It is supposed to be #10931 but it says #1093.

@jacoor
Copy link
Contributor

jacoor commented Nov 17, 2020

yup, as @Ricool06 mentioned, the number seems wrong on the roadmap. @breathingdust can you look into it?

@breathingdust
Copy link
Member

Fixed, thanks for pointing that out @Ricool06 / @jacoor 🎉

@jacoor
Copy link
Contributor

jacoor commented Nov 17, 2020

phew :-)

@abhi-dwivedi
Copy link

Any Updates on this ??

@Ricool06
Copy link
Contributor

@abhi-dwivedi I'm resigned to the belief we're probably not gonna get anywhere with this. The PR I made is a year out of date and as much as I would like to update it, I get the feeling it may get forgotten again.

@yuming17
Copy link

yuming17 commented Feb 4, 2021

It would be nice if this can be supported

@anGie44 anGie44 removed the needs-triage Waiting for first response or review from a maintainer. label Feb 6, 2021
@anGie44 anGie44 added this to the v3.28.0 milestone Feb 6, 2021
anGie44 added a commit that referenced this issue Feb 6, 2021
…licy

resource/aws_sns_topic_subscription: Add redrive_policy argument fixes #10931
@ghost
Copy link

ghost commented Feb 12, 2021

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

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Mar 8, 2021

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 as resolved and limited conversation to collaborators Mar 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/sns Issues and PRs that pertain to the sns service.
Projects
None yet