Bird
0
0

You want to automate creating multiple EC2 instances with different configurations using AWS CLI. Which approach is best?

hard📝 Best Practice Q8 of 15
AWS - CLI
You want to automate creating multiple EC2 instances with different configurations using AWS CLI. Which approach is best?
AUse AWS CLI once without parameters to create all instances
BWrite a shell script that loops over configurations and runs 'aws ec2 run-instances' with parameters
CManually run 'aws ec2 run-instances' for each instance in the console
DCreate instances only via AWS Management Console
Step-by-Step Solution
Solution:
  1. Step 1: Understand automation needs

    Automating multiple instance creation requires looping over configs and running CLI commands programmatically.
  2. Step 2: Evaluate options

    Write a shell script that loops over configurations and runs 'aws ec2 run-instances' with parameters uses scripting and CLI correctly; B and D are manual; A is invalid usage.
  3. Final Answer:

    Write a shell script that loops over configurations and runs 'aws ec2 run-instances' with parameters -> Option B
  4. Quick Check:

    Automate multiple instances = C [OK]
Quick Trick: Use scripts with loops to automate multiple CLI commands [OK]
Common Mistakes:
MISTAKES
  • Trying manual creation for many instances
  • Running CLI once without parameters
  • Ignoring scripting benefits

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes