0
0
AWScloud~10 mins

Managed vs inline policies in AWS - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to attach a managed policy to an IAM user.

AWS
aws iam attach-user-policy --user-name MyUser --policy-arn [1]
Drag options to blanks, or click blank then click option'
AMyInlinePolicy
Barn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess
Carn:aws:iam::123456789012:policy/CustomPolicy
DMyUserPolicy
Attempts:
3 left
💡 Hint
Common Mistakes
Using the policy name instead of the ARN for managed policies.
Confusing inline policy names with managed policy ARNs.
2fill in blank
medium

Complete the code to create an inline policy for an IAM role.

AWS
aws iam put-role-policy --role-name MyRole --policy-name [1] --policy-document file://policy.json
Drag options to blanks, or click blank then click option'
AMyInlinePolicy
Barn:aws:iam::aws:policy/AdministratorAccess
CMyRolePolicyArn
Darn:aws:iam::123456789012:policy/CustomPolicy
Attempts:
3 left
💡 Hint
Common Mistakes
Using ARNs instead of policy names for inline policies.
Confusing managed policy ARNs with inline policy names.
3fill in blank
hard

Fix the error in the command to detach a managed policy from a user.

AWS
aws iam detach-user-policy --user-name MyUser --policy-arn [1]
Drag options to blanks, or click blank then click option'
Aarn:aws:iam::aws:policy/AmazonEC2ReadOnlyAccess
BMyUserPolicy
Carn:aws:iam::123456789012:policy/CustomPolicy
DMyInlinePolicy
Attempts:
3 left
💡 Hint
Common Mistakes
Using inline policy names instead of ARNs.
Trying to detach inline policies with this command.
4fill in blank
hard

Fill both blanks to create and attach an inline policy to a user.

AWS
aws iam put-user-policy --user-name MyUser --policy-name [1] --policy-document [2]
Drag options to blanks, or click blank then click option'
AMyInlinePolicy
Bfile://policy.json
Carn:aws:iam::aws:policy/ReadOnlyAccess
DMyManagedPolicy
Attempts:
3 left
💡 Hint
Common Mistakes
Using managed policy ARNs instead of a policy name.
Not specifying the policy document correctly.
5fill in blank
hard

Fill all three blanks to list all managed policies and filter by scope.

AWS
aws iam list-policies --scope [1] --only-attached [2] --max-items [3]
Drag options to blanks, or click blank then click option'
ALocal
Btrue
C10
DAWS
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Local' instead of 'AWS' for scope.
Omitting the '--only-attached' flag or using incorrect values.
Not setting 'max-items' or using non-numeric values.