<p>I have a cluster in AWS EKS and 1 node group which has 1 node, how to display node and pods using aws api? I have credentials for service account, how to use these credentials in an API and get list of available nodes and pods?
when I try to execute command <code>kubectl get pods</code> it shows an error:</p>
<blockquote>
<p>An error occurred (AccessDenied) when calling the AssumeRole operation: User: &gt;arn:aws:iam:xxxx:user/xx is not authorized to perform: sts:AssumeRole on resource: &gt;arn:aws:iam::xx:user/xx</p>
</blockquote>

dev
<p>You need to do two things before accessing your cluster.</p>
<ol>
<li><p>Add your IAM Roles or Users to the <a href="https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html" rel="nofollow noreferrer">aws-auth ConfigMap</a> to configure who can access the cluster. The IAM role that was used for creating the cluster, already have access.</p>
</li>
<li><p>When accessing the cluster, you must authenticate and populate your <code>kubeconfig</code>. This can be done with <a href="https://docs.aws.amazon.com/cli/latest/reference/eks/update-kubeconfig.html#examples" rel="nofollow noreferrer">aws eks update-kubeconfig command</a>:</p>
<p><code>aws eks update-kubeconfig --name &lt;my-cluster-name&gt;</code></p>
</li>
</ol>
