我有以下基于这个官方模块的核心模块:
module "sqs" {
source = "github.com/terraform-aws-modules/terraform-aws-sqs?ref=0d48cbdb6bf924a278d3f7fa326a2a1c864447e2"
name = "${var.site_env}-sqs-${var.service_name}"
}
我想创建两个队列:xyz 和 xyz_dead。xyz 将其死信消息发送到 xyz_dead。
module "xyz_queue" {
source = "../helpers/sqs"
service_name = "xyz"
redrive_policy = <<POLICY {
"deadLetterTargetArn" : "${data.TODO.TODO.arn}",
"maxReceiveCount" : 5
}
POLICY
site_env = "${var.site_env}"
}
module "xyz_dead_queue" {
source = "../helpers/sqs"
service_name = "xyz_dead"
site_env = "${var.site_env}"
}
如何指定deadLetterTargetArn
依赖项?
如果我做:
data "aws_sqs_queue" "dead_queue" {
filter {
name = "tag:Name"
values = ["${var.site_env}-sqs-xyz_dead"]
}
}
并设置deadLetterTargetArn
为"${data.aws_sqs_queue.dead_queue.arn}"
,然后我收到此错误:
错误:data.aws_sqs_queue.thumbnail_requests_queue_dead:“名称”:未设置必填字段错误:data.aws_sqs_queue.thumbnail_requests_queue_dead::无效或未知键:过滤器