<% subnets.each do |subnet| -%> resource "aws_subnet" "<%= module_name_of(subnet) %>" { vpc_id = "<%= subnet.vpc_id %>" cidr_block = "<%= subnet.cidr_block %>" availability_zone = "<%= subnet.availability_zone %>" map_public_ip_on_launch = <%= subnet.map_public_ip_on_launch %> tags { <% subnet.tags.each do |tag| -%> <%= tag.key %> = "<%= tag.value %>" <% end -%> } } <% end -%>