Bird
0
0

If your AWS CLI default profile is set to dev but you run a script intended for the prod profile without specifying --profile prod, what will happen?

hard📝 Application Q8 of 15
AWS - CLI
If your AWS CLI default profile is set to dev but you run a script intended for the prod profile without specifying --profile prod, what will happen?
AThe script will fail immediately with a profile not found error
BThe AWS CLI will automatically switch to the <code>prod</code> profile
CThe script will run using the <code>dev</code> profile credentials, possibly causing permission errors
DThe AWS CLI will prompt you to select a profile before running
Step-by-Step Solution
Solution:
  1. Step 1: Understand default profile behavior

    If no profile is specified, AWS CLI uses the default profile configured.
  2. Step 2: Impact on script execution

    Running a script intended for prod with dev credentials may cause permission or resource access errors.
  3. Final Answer:

    The script will run using the dev profile credentials, possibly causing permission errors -> Option C
  4. Quick Check:

    Default profile is used if none specified [OK]
Quick Trick: Default profile runs if no --profile given [OK]
Common Mistakes:
  • Assuming CLI auto-switches profiles
  • Expecting immediate failure without profile
  • Thinking CLI prompts for profile selection

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes