Interview Prep/AWS/IAM, Organizations and Multi-Account

What is the difference between an IAM role and an IAM user, and when do you pick each?

BeginnerScenarioIAM, Organizations and Multi-Account
Answer

Situation read → A user is a long-lived identity with static credentials; a role is an assumable identity with temporary credentials.

What I'd do →

  1. Use roles for EC2, Lambda, ECS tasks, cross-account access and CI
  2. Use SSO-federated roles for humans
  3. Reserve IAM users for rare cases like a third-party tool that cannot federate, and then rotate keys and restrict by condition
  4. Audit with the credential report: aws iam generate-credential-report

Why → Temporary credentials shrink the window of a leak from forever to hours.

Interview tip → One-line answer: "roles for everything, users almost never".

aws All AWS questions Roadmap: AWS core services

More on IAM, Organizations and Multi-Account