Bird
0
0

You want to run an AWS CLI command that uses the prod profile but also specify the region us-west-2 without changing your default region. Which command correctly does this?

hard📝 Best Practice Q15 of 15
AWS - CLI
You want to run an AWS CLI command that uses the prod profile but also specify the region us-west-2 without changing your default region. Which command correctly does this?
Aaws --profile prod --region us-west-2 s3 ls
Baws s3 ls --region us-west-2 --profile prod
Caws s3 ls --profile prod region us-west-2
Daws s3 ls prod --region us-west-2
Step-by-Step Solution
Solution:
  1. Step 1: Understand flag order and usage

    Global options like --profile and --region must be placed after aws but before the service name. Their relative order does not matter.
  2. Step 2: Check options for correctness

    Only aws --profile prod --region us-west-2 s3 ls correctly places both flags before the service.
  3. Final Answer:

    aws --profile prod --region us-west-2 s3 ls -> Option A
  4. Quick Check:

    Global flags before service = C [OK]
Quick Trick: Global flags (--profile, --region) after aws before service [OK]
Common Mistakes:
MISTAKES
  • Omitting --profile or --region flags
  • Placing profile name without --profile flag
  • Using incorrect flag syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes