Sub topic 16
Choosing the right tool for the task
This chapter assumes you have used the Management Console, installed and configured AWS CLI v2 with a profile, and opened CloudShell at least once. It pulls those pieces together into a decision you can make quickly.
What each tool is best at
All three tools call the same AWS APIs, so none of them can do something the others cannot in principle. They differ in how you authenticate, how repeatable your work is, and how much setup you need.
| Question | Console | AWS CLI on your machine | CloudShell |
|---|---|---|---|
| Setup | Sign-in only | Install, configure profiles, sign in | None. Opens from the Console |
| Authentication | Your console sign-in | Profiles, SSO, or environment variables | Your console session credentials |
| Repeatable | No, clicks are not recorded as a script | Yes, commands can be saved and scripted | Yes, with scripts in your home directory |
| Best for | Exploring, learning, visual checks | Automation, bulk work, many accounts | Quick commands on a machine you do not control |
| Local files | Browser upload and download | Direct access | Upload and download through the CloudShell menu |
Decision criteria
Ask these questions in order.
- Will you do this more than once? If yes, write a CLI command or script. A procedure of clicks is hard to repeat and hard to review.
- Do you need to see the shape of the service first? If you are new to a service, use the Console. Its forms show which options exist and which are required.
- Are you on a machine where you cannot or should not install tools or store credentials? Use CloudShell. It inherits your signed-in identity, so no access keys are stored on the machine.
- Do you need to work across many Regions or accounts? Use the CLI with
--regionand--profile, as in the loop below. - Do you need local tools, an editor setup, or a CI system? Use the CLI on your own machine or runner.
for r in $(aws ec2 describe-regions --query 'Regions[].RegionName' --output text); do
echo "$r: $(aws ec2 describe-vpcs --region "$r" --query 'length(Vpcs)' --output text)"
doneChecking this in the Console would mean switching the Region selector once for each Region. The loop does it in one step.
Common mixed workflows
Experienced users rarely pick one tool. Typical combinations are:
- Explore in the Console, then rebuild the same action as a CLI command once you understand the options.
- Run a one-off check in CloudShell, then move the command into a script on your machine if you need it again.
- Use the Console to confirm the result of a CLI change, such as a new bucket or a stopped instance.
Gotchas when switching tools
- The identity can differ between tools. Run
aws sts get-caller-identityin the CLI or CloudShell to confirm which identity you are using before you change anything. - The Region can differ too. The Console uses the Region selector, CloudShell starts in the Region you launched it from, and the CLI uses your profile or
--region. - Preview bulk changes before you run them. For example,
aws s3 sync ./site s3://amzn-s3-demo-bucket --dryrunlists what would upload without changing anything.
Exercise
You must list the running EC2 instances in 12 Regions every Monday, and a colleague must be able to review how you did it. Which tool do you choose, and why?
Show answer
The AWS CLI, in a script. The task repeats and spans many Regions, so a loop that sets --region on each call is faster than switching the Console Region selector. A saved script also gives your colleague something to review. CloudShell would also work if you have no configured machine, because you can keep the script in its persistent home directory.