-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Address issue with maxReceiveCount
key in subscription redrive policy
#56
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
37df062
to
b18b161
Compare
main.tf
Outdated
var.redrive_policy_max_receiver_count != null ? { | ||
deadLetterTargetArn = join("", aws_sqs_queue.dead_letter_queue.*.arn) | ||
maxReceiveCount = var.redrive_policy_max_receiver_count | ||
} : { | ||
deadLetterTargetArn = join("", aws_sqs_queue.dead_letter_queue.*.arn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is simpler.
var.redrive_policy_max_receiver_count != null ? { | |
deadLetterTargetArn = join("", aws_sqs_queue.dead_letter_queue.*.arn) | |
maxReceiveCount = var.redrive_policy_max_receiver_count | |
} : { | |
deadLetterTargetArn = join("", aws_sqs_queue.dead_letter_queue.*.arn) | |
deadLetterTargetArn = join("", aws_sqs_queue.dead_letter_queue.*.arn) | |
maxReceiveCount = var.redrive_policy_max_receiver_count |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using anything other than what I have here still raises this error:
Error: error creating SNS Topic Subscription: InvalidParameter: Invalid parameter: Attributes Reason: RedrivePolicy: invalid JSON. Attribute maxReceiveCount is unknown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this redrive policy may need to be added directly to the sqs queue
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sqs_queue
Then the redrive policy for sns topic subscription may only support the deadLetterTargetArn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this lines up with these findings:
The only reference I could find for it in the AWS api docs was here, its suspiciously not called out in the boto3 documentation for SNS topic subscriptions nor in the api docs for SNS Subscribe
So are we back to removing the redrive_policy_max_receiver_count
input var? And I suppose simplifying the redrive_policy
input in aws_sns_topic_subscription.this
is in order as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to remove redrive_policy_max_receiver_count
. I think we need to add the appropriate redrive_policy
to the appropriate resource.
aws_sqs_queue
has both deadLetterTargetArn
and maxReceiveCount
aws_sns_topic_subscription
has only deadLetterTargetArn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aws_sqs_queue has both deadLetterTargetArn and maxReceiveCount
right, but the only sqs queue we're defining in the root module is the dlq - are you saying you want to include a redrive policy on it? That seems a little redundant, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
went ahead and removed input_redrive_policy_max_receiver_count
and by extension the maxRecieveCount
key from the aws_sns_topic_subscription
redrive policy, if you want me add it to the dlq please lmk
maxReceiveCount
key in subscription redrive policy
Please merge from the default branch in order for passing tests |
5bccaed
to
5dff3d5
Compare
/terratest |
Hmm, not sure why this was closed, but the PR did get stale. Maybe we just remove this argument as another person ran into the same issue. PR #89 will supersede this PR 56 |
what
maxReceiveCount
key in subscription redrive policywhy
maxReceiveCount
when providedreferences