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.
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
}
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.
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.
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.
Fixed it, sorry for spam, GitHub mobile won't let me edit. #11770 is ready with ACC tests passing.
Any update on this? Sure could use this right about now :D
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 馃憤
Also in need of this feature.
Reiterating we have a real life need for this feature.
Also depending on this. Do we have an ETA for @Ricool06 PR to be merged?
Thanks in advance!
@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. 馃槄
We have a real life need for this feature, Adding my support to increase visibility for this item.
Does anyone have a workaround to this? Maybe using CloudFormation or something?
@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.
Also need this.
Also need this.
If you can get @bflad or any other terraform maintainer to review and merge this PR (#11770): https://github.com/terraform-providers/terraform-provider-aws/pull/11770 then we can have it. 馃憤
'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.
also need this
+1! blocking one of our major infra changes :(
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.
Hi all! :wave: 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!
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.
yup, as @Ricool06 mentioned, the number seems wrong on the roadmap. @breathingdust can you look into it?
Fixed, thanks for pointing that out @Ricool06 / @jacoor 馃帀
phew :-)
Most helpful comment
Fixed it, sorry for spam, GitHub mobile won't let me edit. #11770 is ready with ACC tests passing.