INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

Topic lessonTopic: IAM: roles and permission limits

IAM users vs roles: people, workloads and temporary credentials

An IAM user is a persistent identity in an account; an IAM role is an identity that authorized principals can assume. Assuming a role provides a session with expiring credentials. Rather than mapping every person to an IAM user and every app to an access key, compare how a staff member and a document app read reports.

What you will learn

Separate identities from credentials and explain suitable temporary-access paths and prerequisites for people and workloads.

Prerequisite

Authentication establishes who is requesting; authorization decides whether an operation is permitted. A workload is an application or collection of processing resources. Federation connects authentication by an external identity provider to AWS access. No real account is needed.

Separate identity, credentials and permissions

Compare users and roles by identity and credential behavior
DimensionIAM userIAM role
IdentityA persistent identity within an accountAn identity assumable by authorized principals
CredentialsCan have long-term access keys or a console password when configuredNo standard long-term password or access keys on the role itself
When usedRequests use credentials associated with that user or an applicable sessionRequests use temporary credentials for a role session
PermissionsAttached policies and applicable controlsRole, session, resource policies and other applicable controls

An IAM user does not necessarily represent one human, and a role is not exclusively for apps. People can use roles through federation, while services and applications also use roles. Naming an identity does not grant it access.

Choose an option to see the result and explanation.

Staff need AWS access. Must you create an IAM user for each person?
Read the answer and reason

Answer: No: first consider federation and temporary credentials · AWS recommends federated temporary access for people too. Check the identity provider and tool support instead of assigning identity types solely by whether the caller is human or an app.

One report, two kinds of caller

Human and workload access: two different paths
Human and workload access: two different paths1: Staff member — Human authentication leads to authorized account/role access. — Workforce role. 2: Document app — The workload uses its runtime role through a separate access path. — App role12Staff memberWorkforce roleDocument appApp roleHuman and workload access: two different paths1: Staff member — Human authentication leads to authorized account/role access. — Workforce role. 2: Document app — The workload uses its runtime role through a separate access path. — App role12Staff memberWorkforce roleDocument appApp role
  1. Staff member → Workforce roleHuman authentication leads to authorized account/role access.
  2. Document app → App roleThe workload uses its runtime role through a separate access path.
Staff member
Authenticates through the organization’s identity provider.
Workforce role
Access follows the Identity Center or federation configuration.
Document app
An EC2 workload in this example; no employee key is distributed.
App role
Uses temporary credentials through supported runtime and SDK mechanisms.

A staff member authenticates with an organizational identity; the document app uses its workload role. Even if both read the same monthly report, they do not need to share one access key. Their principals, actions and resource permissions can be designed separately.

Choose a path for people and workloads inside or outside AWS

Choose after checking the identity provider and execution environment
CallerFirst approach to considerPrerequisites to check
StaffFederation and temporary credentials; Identity Center for centralized accessIdentity provider, MFA, access assignments and tool support
App on EC2 or LambdaA role supported by the execution serviceRole attachment, trust, SDK credential discovery and refresh
External CI or workloadFederation such as OIDC, or IAM Roles AnywhereIdentity provider or certificates, trust conditions and tool support
An unsupported temporary-access use caseAssess whether an IAM user is justifiedRestricted purpose, storage, rotation, retirement and applicable MFA controls

OIDC means OpenID Connect, an identity-federation protocol. IAM Identity Center centrally manages workforce access to AWS accounts and applications. One method is not automatically supported by every tool; review the existing platform and product capabilities.

Choose an option to see the result and explanation.

Is copying an employee’s long-term key to the EC2 app the standard approach?
Read the answer and reason

Answer: Consider a runtime role and temporary SDK credentials · Prefer supported runtime delivery of temporary role credentials. Sharing a human key weakens identity separation and protection. Role support, trust and permissions still need review.

Temporary access still requires permission and credential controls

Role sessions expire; expired credentials cannot simply continue authorizing operations. Use supported credential discovery and refresh mechanisms rather than putting credential values in source code or lesson forms. Short-lived access and least privilege are separate properties.

A role’s trust policy governs who can assume it; its permissions policies describe operations available through the role. Being trusted does not automatically grant reading or deleting every report. The AssumeRole lesson separates these requests in detail.

Choose an option to see the result and explanation.

Do temporary credentials make broad administrator permissions least privilege?
Read the answer and reason

Answer: No: expiration and permission scope are separate · Expiration limits time, not the set of allowed operations. Narrow actions, resources and conditions independently; a short lifetime does not replace least privilege.

Checks before creating identities

  1. Separate human and workload callers.
  2. Check identity providers, execution environment and tool support.
  3. Choose a supported temporary-access path and identify its principal.
  4. Limit actions/resources/conditions; check expiration and refresh.
  5. Record the justification and ownership of any long-term credential exception.

Check, then explain in your own words

  1. Explain identities, credentials and permissions separately.
  2. Choose supported temporary-access paths for people and apps.
  3. Check prerequisites and exceptions instead of defaulting to long-term keys.
Check your understanding: Is “users for people, keys for apps” a sound rule?

Start with suitable temporary-access methods and their prerequisites.

Both people and workloads can use roles and federation. An identity type alone does not determine permissions or credential-management requirements.

Sources and conditions checked

The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.