<p>I'm sure regarding YAML format and kubernetes (AWS EKS) as per validations of <a href="https://kubeval.instrumenta.dev/" rel="nofollow noreferrer">Kubeval</a> &amp; <a href="http://www.yamllint.com/" rel="nofollow noreferrer">Yamllint</a>.</p>
<p>The following is a aws-auth-patch.yml file.</p>
<p><a href="https://i.stack.imgur.com/FZPr3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FZPr3.png" alt="enter image description here" /></a></p>
<p>However... When I executed in CMD <strong>kubectl patch configmap/aws-auth -n kube-system --patch &quot;$(cat aws-auth-patch.yml)&quot;</strong></p>
<p><em>error: Error from server (BadRequest): json: cannot unmarshal string into Go value of type map[string]interface {}</em></p>
<p>Also in Windows PowerShell <strong>kubectl patch configmap/aws-auth -n kube-system --patch $(Get-Content aws-auth-patch.yml -Raw)</strong></p>
<p><em>error: The request is invalid: patch: Invalid value: &quot;map[apiVersion:v1 data:map[....etc...&quot;: cannot convert int64 to string</em></p>
<p>I think that YAML file format is normal.</p>
<p>What is causing this error?</p>

Fisal Assubaieye
<p>I've solved it by change my OS from Windows 10 to WSL (Windows Sub-system for Linux ) (ubuntu 20.04 LTS) and now the below command executed successfully.</p>
<pre><code>kubectl patch configmap/aws-auth -n kube-system --patch &quot;$(cat aws-auth-patch.yml)&quot;
</code></pre>
<p>and result is:</p>
<pre><code>configmap/aws-auth patched
</code></pre>
