Bird
0
0

Which JSON snippet correctly attaches an inline policy to an IAM user named 'Alice'?

easy📝 Configuration Q3 of 15
AWS - Identity and Access Management
Which JSON snippet correctly attaches an inline policy to an IAM user named 'Alice'?
A{"UserName": "Alice", "ManagedPolicyArn": "arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess"}
B{"UserName": "Alice", "PolicyArn": "arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess"}
C{"PolicyName": "MyPolicy", "PolicyDocument": {"Statement": [{"Effect": "Allow", "Action": "s3:ListBucket", "Resource": "*"}]}}
D{"UserName": "Alice", "PolicyName": "MyPolicy", "PolicyDocument": {"Statement": [{"Effect": "Allow", "Action": "s3:ListBucket", "Resource": "*"}]}}
Step-by-Step Solution
Solution:
  1. Step 1: Identify inline policy structure

    Inline policies require UserName, PolicyName, and PolicyDocument fields.
  2. Step 2: Check options for correct fields

    {"UserName": "Alice", "PolicyName": "MyPolicy", "PolicyDocument": {"Statement": [{"Effect": "Allow", "Action": "s3:ListBucket", "Resource": "*"}]}} includes all required fields for inline policy attachment to a user.
  3. Final Answer:

    JSON with UserName, PolicyName, and PolicyDocument is correct. -> Option D
  4. Quick Check:

    Inline policy JSON structure = B [OK]
Quick Trick: Inline policy needs PolicyName and PolicyDocument with UserName [OK]
Common Mistakes:
  • Using ManagedPolicyArn for inline policies
  • Missing PolicyName or PolicyDocument fields
  • Confusing PolicyArn with ManagedPolicyArn

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes