How can a SQS-queue be provisioned to specify a policy like maxReceiveCount for its dead letter queue, when neither the queue nor the dead letter queue exist?
The documentation suggests its possible:
resource "aws_sqs_queue" "terraform_queue" {
# ...
redrive_policy = "{\"deadLetterTargetArn\":\"${aws_sqs_queue.terraform_queue_deadletter.arn}\",\"maxReceiveCount\":4}"
}
And I'm inclined to think that folks must have given this some thought and gotten it to work before adding it into the docs.
Therefore, I'm looking for insights about what I'm missing and what I should do to get around reasonable error messages like this one:
unknown resource 'aws_sqs_queue.terraform_queue_deadletter'
referenced in variable aws_sqs_queue.terraform_queue_deadletter.arn