<p>I am trying to associate users in a aws-auth config map using Helm. I'd like to loop through a nested map in our values file. My attempt to do this is as follows:</p>
<pre><code>  mapUsers: |
  {{- range $username := .Values.users }}
    - groups:
      - system:masters
      userarn: {{ $username.adminArn }}
      username: {{ $username }}
  {{- end }}
</code></pre>
<p>And the values file is as follows:</p>
<pre><code>users:
  username: user.name
    userArn: user/Arn
    adminArn: user/AdminArn
</code></pre>
<p>I'm not certain if this will solve my problem and would like some feedback.</p>

TravelingLex
<p>After taking feedback from @Andrew, I was able to get this to work by first changing the structure of my values file to:</p>
<pre><code>users:
  testuser:
    username: test.user
    userArn: testuser/arn
    adminArn: testuser/adminArn
</code></pre>
<p>I then was able to update my loop to:</p>
<pre><code>  {{- range $k := .Values.users }}
    - groups:
      - system:masters
      userarn: {{ .adminArn }}
      username: {{ .username }}
  {{- end }}
</code></pre>
