Sub topic 1
Three ways to work with AWS
Prerequisites
This chapter assumes you have the following:
- Basic familiarity with what AWS and a cloud service are.
- Comfort using a terminal and running shell commands.
- An AWS account and a sign-in with permission to view resources.
- Basic awareness of JSON as a data format.
One service API, three front doors
Every action in AWS is an API request. Creating a bucket, listing instances, and changing a security group all work this way. Each request is signed with credentials that identify who is asking, and AWS checks the permissions attached to that identity.
The Management Console, the AWS CLI, and AWS CloudShell are three ways to send those requests by hand. They differ in interface, in where they run, and in how they get credentials.
Because all three use the same APIs, anything you can do in one is generally possible in the others. Some features or new services may appear in one before another.
The Management Console
The Console is a web application. You sign in with a browser, pick a service, and work through forms, tables, and graphs. It suits exploration, one-off changes, and reading resource state at a glance.
Its weakness is repeatability. A sequence of clicks is hard to record, review, or run again the same way.
The AWS CLI
The AWS Command Line Interface (CLI) is a program you install on your own computer. Version 2 is the current major version. Commands follow one pattern: aws, then a service, then an operation, then options.
Check that it is installed:
aws --versionThe CLI reads credentials from configuration files, environment variables, or a single sign-on session. You set those up yourself, which gives you control but also means credentials exist on your machine. Later chapters cover installation, profiles, and sign-in in detail.
Typed commands can be saved in scripts, put in version control, and run on a schedule. That makes the CLI the usual choice for repeatable work.
AWS CloudShell
CloudShell is a shell that runs in your browser. You launch it from the Console. It comes with the AWS CLI already installed, and it uses the identity you are signed in to the Console with. You do not install anything or create access keys.
Its home directory persists between sessions, so files you keep there are still available next time. Other storage in the environment is temporary.
Comparing them
| Row | Console | AWS CLI | CloudShell |
|---|---|---|---|
| Runs in | Browser | Your terminal | Browser |
| Setup | None | Install and configure | None |
| Credentials | Your sign-in | Profiles, variables, or SSO | Inherited from your Console sign-in |
| Repeatable | Poorly | Well | Well, for scripts you save |
| Best for | Exploring, one-offs | Automation, daily work | Quick commands from any browser |
Choosing a starting point
Start in the Console to see what a service offers. When you notice yourself repeating a task, move it to the CLI. Use CloudShell when you want CLI commands without configuring a machine, such as on a borrowed computer.
Exercise
You need to run the same list-and-count command across your account every week, and you are signed in to the Console on a laptop where you cannot install software. Which tool fits, and why?
Show answer
CloudShell. It provides the CLI without installation, uses your Console identity so no access keys are needed, and you can save the command as a script in its persistent home directory to rerun each week.