I try to migrate from v0.11 to v0.12 of terraform and I have some troubles with the condition tag.
This it's my resource:
resource "aws_lb_listener_rule" "static" {
listener_arn = var.alb_int_arn
priority = index(var.priority_load, count.index)
action {
type = "forward"
target_group_arn = aws_alb_target_group.alb_target_group.arn
}
count = var.count_path
condition {
host_header {
values = index(var.path_to_service, count.index)
}
}
}
var.path_to_service it's a list of string and var.priority_load it's a list of numbers.
My problem it's when I try to apply my terraform files always say me the command the same error:
Inappropriate value for attribute "values": set of string required.
I try to put a string directly and I have the same error.
My IDE (IntelliJ) said me that I have an error into the condition tag when it inspected the code, the error said:
Report blocks with unknown type(first literal)
I maked a test and I changed the condition tag for a block, like this:
condition = {
host_header {
values = index(var.path_to_service, count.index)
}
}
To terraform this it's a syntactic error, but for my IDE it's a right configuration... obviously not work
Any idea for me?