Comparisons / IAM User vs Role vs Policy
Security / IAM

IAM User vs Role vs Policy

IAM users and IAM roles are both principals representing "who or what" accesses AWS, but differ in the nature of their credentials. An IAM policy is the permission document attached to either one, defining "what is allowed."

AspectIAMユーザーIAMロール
CredentialsHolds long-term access keys or passwordsIssues temporary security credentials (STS) on each use
Typical principalExceptional workloads that cannot avoid long-term credentialsAWS services (EC2/Lambda), other accounts, and federated users such as IAM Identity Center users
Credential rotationRequires manual rotation (leak risk)Automatically issued and expired
How it's usedDirect login (password) or access keyTemporarily assumed via AssumeRole
Typical useExceptions such as legacy tools that cannot use roles or temporary credentialsGranting EC2/Lambda permissions, cross-account access, IAM Identity Center/federation

How to Choose

For human access, AWS recommends IAM Identity Center or federation with an external identity provider, using roles and temporary credentials. Reserve IAM users for exceptional cases where roles and temporary credentials are unsupported and long-term credentials are unavoidable. Use IAM roles for AWS resources such as EC2/Lambda and for cross-account access, attaching least-privilege IAM policies.

Exam Points

  • All exams commonly test "least privilege" and "prefer roles over long-term credentials" as core design principles
  • SAA frequently tests the anti-pattern "hardcoding access keys" vs the correct approach of attaching an IAM role to EC2 for S3 access
  • Policy evaluation logic (explicit Deny > explicit Allow > default Deny) and the distinction from SCPs (Service Control Policies) are recurring topics

Related Service Guides

Last updated: 2026-09-06

This page is created from AWS official documentation and reviewed/edited by the operator. See our editorial & quality policy for details.