i am unable to deal with the map variables and list variable together. Is is possible in terraform 1.3.9.
elb_listener = {
“alb_listener” = {
lb_arn = aws_lb.docshift-elb[“xyz_alb”].arn,
port = “80”,
protocol = “HTTP”,
action = “forward”,
tg_arn = aws_lb_target_group.docshift-elb-tg[“xyz_alb_tg”].arn
}
“nlb_listener” = {
lb_arn = aws_lb.docshift-elb[“abc_nlb”].arn,
port = [“1100”, “1099”],
protocol = “TCP”,
action = “forward”,
tg_arn = aws_lb_target_group.docshift-elb-tg[“abc_nlb_tg”].arn
}
maxb
May 19, 2023, 9:24am
2
Welcome to the HashiCorp Discuss forum!
This post is intended as a instructions for users about how to successfully include copy/pasted code, commands, and error messages in their posts here.
If you’ve been directed to it, it means the person sending you here would like you to take this information into account, and edit your post.
Very often, new users copy/paste these things into posts as-is … and the forum software then:
Removes all of the indentation, making them hard to read, and actua…
Additionally, nothing you’ve written in your post actually explains what the problem you are experiencing is?
so what needs to change in my query or post.
maxb
May 19, 2023, 9:28am
4
You need to explain what you need help with. So far you have not.
ok, i already mentioned that how to deal with complex variables in the one object. Like list and map comes in 1 object. On that basis how to use for_each or count.
maxb
May 19, 2023, 9:33am
6
Sorry, I tried, but there’s still not enough detail here for me to understand what you’re having trouble with.
ok let me explain you. Suppose in locals we have 2 variables like one is list(any) and other simple string and these under one object which using map. So i need to create 2 loops 1 is for map and other is for list as well.
Hope so i am able to explain you my query.