Skip to content

Instantly share code, notes, and snippets.

@cam8001
Created September 29, 2020 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cam8001/5df6617543ce35d93b11210f35e6e327 to your computer and use it in GitHub Desktop.
Save cam8001/5df6617543ce35d93b11210f35e6e327 to your computer and use it in GitHub Desktop.
Filter IAM roles showing trust relationship, conditions, and principal
aws iam list-roles | jq '.Roles | .[] | { role_name: .RoleName, action: .AssumeRolePolicyDocument.Statement | .[] | .Action, principal: .AssumeRolePolicyDocument.Statement | .[] | .Principal, condition: .AssumeRolePolicyDocument.Statement | .[] | .Condition }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment