Course contentsShow
← Cloud and Infrastructure
Lesson 352 of 2,9897. Identity and Access ManagementFree lesson

Roles vs Policies

Understand the difference between roles as identity containers and policies as permission definitions.

Roles vs Policies

What you'll learn: How roles and policies differ as two distinct parts of IAM's permission system.

The Core Difference

Think of roles as job titles and policies as job descriptions. A role is a container or identity that can be assumed by users, applications, or services. A policy is a document that defines what permissions (actions) are allowed or denied.

Roles answer the question: Who or what is performing actions?
Policies answer the question: What actions are they allowed to perform?

How They Work Together

Policies don't do anything on their own—they must be attached to something. That something can be:

  • A user (direct attachment)
  • A group (inherited by members)
  • A role (activated when the role is assumed)

Roles become powerful because they can be temporarily assumed by different identities. For example, an application running on a server can assume a role to gain the permissions defined in that role's attached policies—without needing permanent credentials.

A Simple Analogy

Imagine a hospital:

  • Role: "Night Shift Nurse" (an identity anyone can step into)
  • Policy: "Can access patient records, administer medication, but cannot approve surgeries" (the permissions document)

When Sarah assumes the "Night Shift Nurse" role, she inherits all permissions defined in the attached policy. When her shift ends, she stops assuming that role—and loses those permissions.

Why This Matters

Separating roles from policies makes permission management flexible and reusable. You write a policy once, then attach it to multiple roles or users. You can also change what a role can do by swapping its attached policies—without recreating the role itself.

Key Takeaway: Roles are identity containers that can be assumed; policies are permission definitions that get attached to roles, users, or groups to grant access.