Bird
0
0

Which of the following is the correct JSON syntax to allow read-only access to S3 in an IAM policy?

easy📝 Syntax Q3 of 15
AWS - Identity and Access Management
Which of the following is the correct JSON syntax to allow read-only access to S3 in an IAM policy?
A{"Effect": "Allow", "Action": "s3:PutObject", "Resource": "arn:aws:s3:::example-bucket/*"}
B{"Effect": "Allow", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::example-bucket/*"}
C{"Effect": "Deny", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::example-bucket/*"}
D{"Effect": "Allow", "Action": "s3:DeleteObject", "Resource": "arn:aws:s3:::example-bucket/*"}
Step-by-Step Solution
Solution:
  1. Step 1: Identify read-only S3 actions

    The action 's3:GetObject' allows read-only access to objects in S3.
  2. Step 2: Check effect and resource

    The effect must be 'Allow' and resource should specify the bucket and all objects with /*.
  3. Final Answer:

    Allow s3:GetObject on example-bucket -> Option B
  4. Quick Check:

    Read-only S3 policy = A [OK]
Quick Trick: Use s3:GetObject for read-only access in policies [OK]
Common Mistakes:
  • Using PutObject or DeleteObject for read access
  • Setting Effect to Deny instead of Allow
  • Incorrect resource ARN format

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes