Using data returned by jsondecode and iterate over the results in a for_each loop

I guess it would depend on how you would rather access objects in your resource! If you’d prefer it to be a list instead of a map (so you use index numbers instead of strings), I think something like this would work (I haven’t tested this):

serverlist = [for s in tolist(local.config.servers): s.vmName if s.type == "linux" || s.type == "windows"]

Then use the serverlist as your for_each, and use that vmName to index into the servermap (at this point there’s likely a more elegant solution that I’m not thinking of, so play around with it!)