<p>There are a few ways to perform the action you're looking for.  I'll demonstrate how to accomplish this task from the command line and the console.  Using the SDK's (e.g. boto3) are an option too.</p>
<p>From the command line you can use:</p>
<pre><code>aws iam simulate-principal-policy --policy-source-arn &lt;arn of role or user&gt; --action-names eks:AccessKubernetesApi --query 'EvaluationResults[].EvalDecision'
</code></pre>
<p>It will return the following if you have access :</p>
<blockquote>
<p>[ &quot;allowed&quot; ]</p>
</blockquote>
<p>From the console use the <a href="https://policysim.aws.amazon.com/" rel="nofollow noreferrer">IAM Simulator</a><br />
Pick the Role/User/Group that you wish to test:</p>
<p><a href="https://i.sstatic.net/evT9M.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/evT9M.png" alt="enter image description here" /></a></p>
<p>Then choose the service:</p>
<p><a href="https://i.sstatic.net/AgZwx.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/AgZwx.png" alt="enter image description here" /></a></p>
<p>And the action(s):</p>
<p><a href="https://i.sstatic.net/hQJna.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/hQJna.png" alt="enter image description here" /></a></p>
<p>Click <code>Run Simulation</code> and the results will be published:</p>
<p><a href="https://i.sstatic.net/hTy0w.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/hTy0w.png" alt="enter image description here" /></a></p>
<p><strong>References</strong><br />
<a href="https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/simulate-principal-policy.html" rel="nofollow noreferrer">Simulate Principle Policy</a><br />
<a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_testing-policies.html" rel="nofollow noreferrer">Access Policies Testing Policies</a></p>

CC BY-SA 4.0
2022-04-06T15:36:19.593Z
2022-04-06T15:36:19.593Z
kenlukas
<p>I am logged in to AWS as the AWS Admin, with Administrator access.</p>
<p>How do I find out if this user has the <code>eks:AccessKubernetesApi</code> IAM permission?</p>

<amazon-web-services><aws-iam><eks>
Does the AWS Admin user have the eks:AccessKubernetesApi permission?
Snowcrash
# Does the AWS Admin user have the eks:AccessKubernetesApi permission?

(Asked by: username_0 on 2022-04-06)

I am logged in to AWS as the AWS Admin, with Administrator access.

How do I find out if this user has the `eks:AccessKubernetesApi` IAM permission?

**Tags:** amazon-web-services, aws-iam, eks


---

## 1 answers

### Answer by username_1 on 2022-04-06. Score: 1 | Accepted answer

There are a few ways to perform the action you're looking for.  I'll demonstrate how to accomplish this task from the command line and the console.  Using the SDK's (e.g. boto3) are an option too.
From the command line you can use:
aws iam simulate-principal-policy --policy-source-arn  --action-names eks:AccessKubernetesApi --query 'EvaluationResults[].EvalDecision'

It will return the following if you have access :

[ "allowed" ]

From the console use the IAM Simulator
Pick the Role/User/Group that you wish to test:

Then choose the service:

And the action(s):

Click Run Simulation and the results will be published:

References
Simulate Principle Policy
Access Policies Testing Policies


---

