Lessons/Your First AWS Calls

Your first AWS calls

The cloud is not a place you log into and click around — it's an API. Every button in the AWS console, every line of Terraform, every deploy script ends up making the same kind of request: "Hey AWS, do this thing," signed with your credentials. The aws command-line tool is the most direct way to make those requests yourself, and learning it makes everything above it (Terraform included) stop feeling like magic.

In this track you run real aws commands against a safe, throwaway mock AWS — so you can create and inspect things freely without a cloud bill or a real account. Type commands into the editor and press Run; the output appears in the console.

You'll build up a small script across the steps (each line stays as you go). Three commands to know right away:

  • aws sts get-caller-identity — "who am I?" The cloud version of whoami.
  • --output json — force machine-readable output you can parse.
  • | jq -r '.Field' — pull a single value out of a JSON response.

No endpoint flags needed. Normally you'd configure credentials and a region; here the platform points the CLI at the mock AWS for you. Focus on the commands.

Step 1

Ask AWS who you are

Every AWS command is really an API call to a service. Start with the simplest one: ask AWS who you're authenticated as. Add this line to the script and press Run:

aws sts get-caller-identity

You'll see an account id and an ARN come back as JSON.

Interview prep

Every cloud screen starts by confirming you can actually reach the account.

What does `aws sts get-caller-identity` tell you, and when would you reach for it?

It returns the account id, user id, and ARN of whoever the current credentials belong to — the cloud equivalent of `whoami`. It's the first thing to run when a command is mysteriously denied or hitting the wrong account: it confirms which identity and account you're actually authenticated as.

$ bash solution.sh
Loading...

Output

Run your solution to see its output here.