<p>I'm creating three EKS clusters using <a href="https://registry.terraform.io/modules/terraform-aws-modules/eks/aws/latest" rel="nofollow noreferrer">this</a> module. Everything works fine, just that when I try to add the configmap to the clusters using <code>map_roles</code>, I face an issue.</p>
<p>My configuration looks like this which I have it within all three clusters</p>
<pre><code>map_roles = [{
    rolearn   = &quot;arn:aws:iam::${var.account_no}:role/argo-${var.environment}-${var.aws_region}&quot;
    username  = &quot;system:node:{{EC2PrivateDNSName}}&quot;
    groups    = [&quot;system:bootstrappers&quot;,&quot;system:nodes&quot;]
    },
    {
    rolearn   = &quot;arn:aws:sts::${var.account_no}:assumed-role/${var.assumed_role_1}&quot;
    username  = &quot;admin&quot;
    groups    = [&quot;system:masters&quot;,&quot;system:nodes&quot;,&quot;system:bootstrappers&quot;]
    },
    {
    rolearn  = &quot;arn:aws:sts::${var.account_no}:assumed-role/${var.assumed_role_2}&quot;
    username  = &quot;admin&quot;
    groups    = [&quot;system:masters&quot;,&quot;system:nodes&quot;,&quot;system:bootstrappers&quot;]
    }
]
</code></pre>
<p>The problem occurs while applying the template. It says</p>
<pre><code>configmaps &quot;aws-auth&quot; already exists
</code></pre>
<p>When I studied the error further I realised that when applying the template, the module creates three configmap resources of the same name like these</p>
<pre><code> resource &quot;kubernetes_config_map&quot; &quot;aws_auth&quot; {
   # ...
 }
 resource &quot;kubernetes_config_map&quot; &quot;aws_auth&quot; {
   # ...
 }
 resource &quot;kubernetes_config_map&quot; &quot;aws_auth&quot; {
   # ...
 }
</code></pre>
<p>This obviously is a problem. How do I fix this issue?</p>

<p>The aws-auth configmap is created by EKS, when you create a managed node pool. It has the configuration required for nodes to register with the control plane. If you want to control the contents of the configmap with Terraform you have two options.</p>
<p>Either make sure you create the config map before the managed node pools resource. Or import the existing config map into the Terraform state manually.</p>
