Я пытаюсь получить значения с карты карты и ошибка, указанная ниже.
Ошибка:
Error: Incorrect attribute value type
on ../../modules/lb-rules/rules.tf line 71, in resource "aws_alb_listener_rule" "http_header":
71: http_header_name = keys(lookup(var.listener_rules, "http_header_name", null))
|----------------
| var.listener_rules is object with 3 attributes
Inappropriate value for attribute "http_header_name": string required.
main.tf
module example {
...
...
listener_rules = {
...
"http_header_name" = {
"x-header" = "sample_server"
}
}
...
}
правила .tf
resource "aws_alb_listener_rule" http_header {
listener_arn = var.public_alb_listener_arn
priority = var.priority_number
action {
type = "forward"
target_group_arn = aws_alb_target_group.default.id
}
dynamic "condition" {
for_each = lookup(var.listener_rules, "http_header_name", null)
content {
http_header {
http_header_name = keys(lookup(var.listener_rules, "http_header_name", null))
values = ["hi"]
}
}
}
}