☁ AWS Cloud Engineer JourneyBeginner → Cloud Practitioner → Solutions Architect

Day 4Concepts · Lab⏱ 1.5h

Global Infrastructure and the AWS CLI

By the end of today you can Explain Regions, Availability Zones and edge locations, choose a Region sensibly, and talk to AWS from your terminal with the CLI.

1. First principles: where does your app physically live?

Computers are in buildings. Buildings can lose power, flood or burn. Users far away experience delay (latency, because light takes time to travel). AWS solves both with geography:

Analogy: a pizza chainA Region is a city. An AZ is a separate kitchen in that city: if one has a power cut, the others still deliver. An edge location is a delivery scooter parked on your street holding popular pizzas ready to hand over.
Region: eu-west-1 AZ aserverdatabase AZ bserverstandby DB AZ cserver Region: af-south-1separate, isolated Edge locationscache near users
Spread across AZs for resilience; choose Regions for latency, law and price.

How to choose a Region (4 factors, an exam favourite)

  1. Compliance/data residency (laws on where data may live)
  2. Latency to your users
  3. Service availability (new services launch in some Regions first)
  4. Price (varies by Region)

2. Three ways to use AWS

WayGood for
Management Console (website)Learning, exploring
CLI (command line)Fast, scriptable, repeatable (and your Linux skills shine)
SDKs (Python, JS…)Code that talks to AWS

Behind all three is the same thing: an HTTPS API. Click or type, the same request goes to AWS.

3. Lab

  1. CloudShell first (zero setup): in the console click the >_ icon (CloudShell). It's a ready terminal already logged in as you. Run:
    aws sts get-caller-identity
    aws ec2 describe-regions --output table
    aws ec2 describe-availability-zones --region eu-west-1 --query 'AvailabilityZones[].ZoneName'
  2. Find out which Regions are closest to you and write down which of the 4 factors matter most for your future projects.
  3. Install the CLI v2 on your own Linux (your WSL/Ubuntu):
    curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o awscliv2.zip
    unzip awscliv2.zip && sudo ./aws/install
    aws --version
  4. Create an access key for your admin IAM user (IAM → Users → you → Security credentials → Create access key → "CLI"). Then:
    aws configure --profile lab
    # paste key id, secret, region (e.g. eu-west-1), output json
    aws sts get-caller-identity --profile lab
  5. Try: aws s3 ls --profile lab (empty is fine) and aws iam list-users --profile lab --output table.
Key hygieneKeys live in ~/.aws/credentials, never in a Git repo. Add .aws/, *.pem and .env to your .gitignore. Before every push run git diff --staged and look for strings starting with AKIA. (A newer, safer option is IAM Identity Center with aws configure sso, which we'll adopt later.)
📸 Evidence: evidence/day04-sts-identity.png (hide the account ID digits)

4. Exam notes

Remember

5. Quiz

Q1. Protect against the failure of a single data center: what do you use?Multiple Availability Zones.
Q2. A law requires customer data to stay in Germany. Which factor decides your Region?Compliance / data residency (eu-central-1 Frankfurt).
Q3. What serves cached content from locations near users?CloudFront via edge locations.
Q4. You want to automate resource creation from a script. Which tool?CLI or SDK.

6. Checklist