【发布时间】:2021-09-24 04:17:34
【问题描述】:
感谢您提前提供的帮助和时间。
我正在尝试为 AWS 网络防火墙配置创建 terraform 模块。
以下是我的代码:
firewall_arn = var.firewall_arn
logging_configuration {
dynamic "config" {
for_each = var.log_destination_configs
content {
log_destination {
bucketName = lookup(config.value, "bucketName", null)
prefix = lookup(config.value, "prefix", null)
logGroup = lookup(config.value, "logGroup", null)
deliveryStream = lookup(config.value, "deliveryStream", null)
}
log_destination_type = lookup(config.value, "log_destination_type", null)
log_type = lookup(config.value, "log_type", null)
}
}
}
}
但是,当我尝试编译时,出现以下错误:
Error: Unsupported block type
on ../../main.tf line 4, in resource "aws_networkfirewall_logging_configuration" "default":
4: dynamic "config" {
Blocks of type "config" are not expected here.
}
是不是因为我在 logging_configuration 中声明了块并且不允许这样做?
再次感谢。
【问题讨论】: