Bird
0
0

If you run aws s3 ls --profile prod on a machine where the prod profile is configured but lacks S3 permissions, what will happen?

medium📝 service behavior Q4 of 15
AWS - CLI
If you run aws s3 ls --profile prod on a machine where the prod profile is configured but lacks S3 permissions, what will happen?
AThe command will prompt to enter credentials interactively
BThe command will list all S3 buckets in the prod account
CThe command will use the default profile instead
DThe command will fail with an AccessDenied error
Step-by-Step Solution
Solution:
  1. Step 1: Profile exists but lacks permissions

    If the profile is configured but does not have S3 permissions, AWS denies access.
  2. Step 2: Expected CLI behavior

    The CLI returns an AccessDenied error indicating insufficient permissions.
  3. Final Answer:

    The command will fail with an AccessDenied error -> Option D
  4. Quick Check:

    Permissions determine command success, not just profile existence [OK]
Quick Trick: Profile must have permissions or command fails [OK]
Common Mistakes:
  • Assuming default profile is used automatically
  • Expecting interactive credential prompt
  • Believing command lists buckets without permissions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes