<% iam_instance_profiles.each do |profile| -%> resource "aws_iam_instance_profile" "<%= module_name_of(profile) %>" { name = "<%= profile.instance_profile_name %>" path = "<%= profile.path %>" roles = <%= profile.roles.map { |role| role.role_name }.inspect %> } <% end -%>