Anyone know how to for_each over a list that does not have a flat shape and looks like the following? I want to create multiple resources. Unable to find anything in the for_each docs except simple examples.
hosts = [
{
hostname = "host1"
interface = {
leafs = [{
device = "en0”
ip = "X.X.X.X"
netmask = "/24"
gateway = "10.X.X.1"
},
{ device = "en1"
ip = "X.X.X.X"
netmask = "/24"
gateway = "10.X.X.1"
}],
lom = { ip = "X.X.X.X" },
management = {
device = "en2"
ip = "X.X.X.X"
netmask = "/24"
gateway = "X.X.X.1"
mac = "aa:bb:cc:dd:ee:ff"
},
stable = {
device = "lo"
ip = "x.x.x.x"
},
}
another_variable = "value1”,
a_list = [ "value1", "value2" ]
},
{
..
..
..