Among the devops community there are multiple discussions about using count + index functions instead of loops. While count does work I lean toward for_each loops.