Which role is attached to instance
<p>How to <strong>check which IAM roles and it's policy json, are attached to the running EC2</strong> instance?</p>

<p>Is it possible through AWS CLI?</p>

<p>Here the response for aws ec2 ddescribe-instances
<a href="https://i.stack.imgur.com/trxTv.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/trxTv.jpg" alt="enter image description here"></a></p>

<p>I tried firing the command - <strong>aws iam list-instance-profiles</strong>, <br>it gave me the following error - <br><br>An error occurred (AccessDenied) when calling the ListInstanceProfiles operation: User: is not authorized to perform: iam:ListInstanceProfiles on resource:</p>