0
0
AWScloud~10 mins

Managed vs inline policies in AWS - Visual Side-by-Side Comparison

Choose your learning style9 modes available
Process Flow - Managed vs inline policies
Start: Need to assign permissions
Choose policy type
Managed Policy
Attach to user/group/role
Permissions applied to identity
Use AWS resources with permissions
This flow shows choosing between managed and inline policies, attaching them to identities, and applying permissions.
Execution Sample
AWS
1. Create managed policy
2. Attach managed policy to user
3. Create inline policy
4. Attach inline policy to user
5. User gets permissions from both
This sequence shows creating and attaching managed and inline policies to a user to grant permissions.
Process Table
StepActionPolicy TypeAttachment TargetEffect on User Permissions
1Create policy 'ReadOnlyAccess'ManagedNoneNo effect yet
2Attach 'ReadOnlyAccess' to user AliceManagedUser AliceAlice gains ReadOnlyAccess permissions
3Create inline policy 'CustomWriteAccess' for AliceInlineUser AliceNo effect yet
4Attach inline policy 'CustomWriteAccess' to AliceInlineUser AliceAlice gains CustomWriteAccess permissions
5User Alice tries to read S3 bucketBothUser AliceAllowed by ReadOnlyAccess managed policy
6User Alice tries to write to S3 bucketBothUser AliceAllowed by CustomWriteAccess inline policy
7Detach managed policy from AliceManagedUser AliceAlice loses ReadOnlyAccess permissions
8User Alice tries to read S3 bucketInline onlyUser AliceDenied (no managed policy)
9Delete inline policy from AliceInlineUser AliceAlice loses CustomWriteAccess permissions
10User Alice tries to write to S3 bucketNo policiesUser AliceDenied (no permissions)
💡 Execution stops after all policies are detached and user has no permissions.
Status Tracker
VariableStartAfter Step 2After Step 4After Step 7After Step 9Final
User Alice PermissionsNoneReadOnlyAccessReadOnlyAccess + CustomWriteAccessCustomWriteAccessNoneNone
Key Moments - 3 Insights
Why does Alice lose read permissions after detaching the managed policy?
Because the managed policy 'ReadOnlyAccess' was the source of read permissions. After step 7 in the execution_table, detaching it removes those permissions.
Can inline policies be shared across multiple users?
No, inline policies are embedded directly in a single user, group, or role. This is shown in step 3 and 4 where the inline policy is created and attached only to Alice.
What happens if both managed and inline policies grant permissions?
Permissions are combined. In step 6, Alice can write because the inline policy grants write access, while managed policy grants read access.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what permissions does Alice have after step 4?
AOnly ReadOnlyAccess
BOnly CustomWriteAccess
CBoth ReadOnlyAccess and CustomWriteAccess
DNo permissions
💡 Hint
Check the 'Effect on User Permissions' column at step 4.
At which step does Alice lose all permissions?
AStep 9
BStep 10
CStep 7
DStep 8
💡 Hint
Look for when both managed and inline policies are detached and user is denied permissions.
If the inline policy was never attached, what would Alice's permissions be after step 2?
ANo permissions
BOnly ReadOnlyAccess
COnly CustomWriteAccess
DBoth ReadOnlyAccess and CustomWriteAccess
💡 Hint
Refer to step 2 where only the managed policy is attached.
Concept Snapshot
Managed vs Inline Policies:
- Managed policies are standalone and reusable.
- Inline policies are embedded in one identity.
- Attach managed or inline policies to users/groups/roles.
- Permissions from both combine.
- Detaching removes permissions granted by that policy.
Full Transcript
This visual execution shows how AWS managed and inline policies work. First, a managed policy is created and attached to a user, granting permissions. Then an inline policy is created and attached to the same user, adding more permissions. The user gains combined permissions from both. When the managed policy is detached, the user loses those permissions but keeps inline policy permissions. Finally, removing the inline policy leaves the user with no permissions. This demonstrates how managed policies are reusable and separate, while inline policies are embedded and specific to one identity.