What AWS CLI Command Can You Run to List Roles with EKS Access?

Problem scenario
You want to list IAM roles that have access to EKS. You have the AWS CLI installed and jq installed. What should you do?

Run this command:

aws iam list-roles | jq -r '.Roles[] | select(.AssumeRolePolicyDocument.Statement[].Principal.Service=="eks.amazonaws.com")'

Leave a comment

Your email address will not be published. Required fields are marked *