Bird
0
0

You want to automate AWS CLI commands in a script without storing credentials in files. Which method is best practice?

hard📝 Application Q8 of 15
AWS - CLI
You want to automate AWS CLI commands in a script without storing credentials in files. Which method is best practice?
AUse environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
BHardcode credentials in the script
CUse the default profile credentials file
DRun aws configure interactively inside the script
Step-by-Step Solution
Solution:
  1. Step 1: Understand secure credential handling in automation

    Hardcoding credentials or interactive prompts are insecure or impractical for automation.
  2. Step 2: Identify best practice for scripts

    Setting environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY is secure and script-friendly.
  3. Final Answer:

    Use environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY -> Option A
  4. Quick Check:

    Environment variables are best for automated credential use [OK]
Quick Trick: Use environment variables for credentials in automation scripts [OK]
Common Mistakes:
MISTAKES
  • Hardcoding credentials in scripts
  • Using interactive commands in automation
  • Relying on default profile files in scripts

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes