Skip to content
RED SAGSkills
easyCloud Engineer interview question

Explain IAM users, groups, roles and policies. When would you use a role instead of a user?

What the interviewer wants to hear

  • Users are long-term identities for people or legacy apps
  • Groups collect users to share permissions
  • Roles are assumed and give temporary credentials
  • Policies are JSON documents defining allowed or denied actions on resources
  • Use roles for services, cross-account access and federated human access

Model answer

IAM controls who can do what in a cloud account. A user is a long-term identity with a password or access keys. A group is a collection of users so you can attach permissions once, for example a Developers group. A policy is a JSON document listing allowed or denied actions on specific resources, with optional conditions. A role is an identity with permissions but no permanent credentials; a trusted principal assumes it and receives temporary credentials. I use roles almost everywhere: for EC2 instances and Lambda functions, for CI pipelines using OIDC federation, for cross-account access, and for engineers who log in through SSO with IAM Identity Center. Temporary credentials expire automatically, so there are no long-lived keys to leak. In all cases I follow least privilege and review unused permissions regularly.

Can you answer it under time pressure?

Take a timed easy round and get scored on every answer.

Start mock interview

More easy Cloud Engineer questions