Ad space (banner)
AD

Got the fundamentals? A structured AWS course is a fast way to level up.

Find AWS courses on Udemy

Affiliate link. Costs you nothing extra.

☁️AWS Lessons
Lesson 11 / 41

Listing Roles with aws iam list-roles

When you want to see the roles defined in the account, use aws iam list-roles. A role is an identity that can be assumed temporarily, rather than belonging to a person.

The syntax is aws iam list-roles.

Running it returns each role's name, ARN and the trust policy describing who is allowed to assume it.

A common stumble is not distinguishing roles from users. Users have long-lived credentials; roles hand out temporary ones — which is why roles are the safer choice.

In real work, roles are how an EC2 instance or a Lambda function gets permission to reach other services, without any access key being stored anywhere.

AWS
Try it (type this into the pseudo terminal)
aws iam list-roles

🧑‍💻 You can type this command into the AWS pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)