Managed Policies vs Inline Policies
What you'll learn: You'll understand the three types of IAM policies—AWS-managed, customer-managed, and inline—and when to use each one.
The Core Distinction
In cloud IAM, policies can be managed (standalone, reusable documents) or inline (embedded directly into a single user, group, or role). Think of managed policies like templates you can attach to multiple identities, while inline policies are like custom notes written directly on one person's badge that only they can use.
AWS-Managed Policies
These are pre-built policies created and maintained by AWS. Examples include ReadOnlyAccess or PowerUserAccess. AWS updates them automatically when new services launch or permissions evolve. Use these for common permission patterns—they're convenient and follow AWS best practices, but you cannot modify them.
Customer-Managed Policies
You create and maintain these yourself. They're standalone policy documents stored in your account that you can attach to multiple users, groups, or roles. When you update a customer-managed policy, the changes apply everywhere it's attached. This is ideal for organization-specific permission sets you'll reuse (like "DataScientistAccess" or "AuditRole"). They support versioning and rollback.
Inline Policies
Inline policies exist only within the identity they're attached to—if you delete the user or role, the policy disappears too. They create a strict 1:1 relationship between policy and identity. Use inline policies only when you need a permission that absolutely must not be accidentally attached to any other identity, ensuring tight coupling. They're harder to audit and don't support reuse.
When to Use Which
- AWS-managed: Standard patterns, quick setup, automatic updates
- Customer-managed: Custom, reusable permission sets across your organization
- Inline: Exceptional cases requiring guaranteed exclusivity
Key Takeaway: Managed policies (AWS or customer) promote reusability and central management; inline policies enforce strict 1:1 coupling but sacrifice flexibility—default to managed policies for maintainability.