Your DevOps study space

Real explanations. Videos with tests. Fresh exams every time. Keep the streak alive and watch the XP stack up.

Costs, the free tier & the AWS CLI · Cloud Docs · StackwisePlanDevOps Costs, the free tier & the AWS CLI · Cloud Docs · StackwiseCodePython Costs, the free tier & the AWS CLI · Cloud Docs · StackwiseBuildDocker Costs, the free tier & the AWS CLI · Cloud Docs · StackwiseTestDevOps Costs, the free tier & the AWS CLI · Cloud Docs · StackwiseReleaseGit Costs, the free tier & the AWS CLI · Cloud Docs · StackwiseDeployKubernetes Costs, the free tier & the AWS CLI · Cloud Docs · StackwiseOperateLinux Costs, the free tier & the AWS CLI · Cloud Docs · StackwiseMonitorDevOps

Pick a topic

Eight tracks, each with docs, a cheat sheet, videos and tests.

How it works

One loop, repeated until it sticks.

Jump back in

Picked up from where you left off.

Free forever

Your DevOps journey starts with one click.

Sign in with Google or GitHub to open every chapter, video, test and challenge. Your progress is saved wherever you learn.

Costs, the free tier & the AWS CLI

In the cloud, every resource you forget about keeps costing money, and a leaked key can cost a lot of it. This chapter explains how AWS charges, which discounts exist, what typically causes a surprise bill and how to catch one early. Then it sets up the AWS CLI properly, including profiles and --query, and ends with a checklist for the first hour on a new account.

How AWS charges

Almost everything is metered: compute by the second or hour while it runs, storage by GB-month, requests per thousand or million, and data transfer by GB. Data coming into AWS from the internet is generally free; data going out to the internet is charged; traffic between AZs and between regions is charged too. Prices differ by region. Most Linux EC2 instances are billed per second (with a one-minute minimum). A stopped instance costs nothing for compute, but its disks and any public IPv4 addresses still cost money. Estimate with the AWS Pricing Calculator and check each service's pricing page for current numbers.

internetusers, youAWS regionAZ aEC2 + EBSAZ bEC2 + EBSin: freeout: chargedchargedrunning: per second or hourstored: per GB-month requests: per milliona stopped instance still pays for its disk and IPv4
Most surprise bills come from things left running or from data leaving AWS. Check the pricing page for each service; prices differ by region.

Pricing models

ModelHow it worksBest for
On-DemandPay the list price for what runs, no commitmentLearning, new or unpredictable workloads, short experiments
Savings PlansCommit to spending a fixed amount per hour for 1 or 3 years in return for a lower rate. Compute Savings Plans apply across EC2 (any family, size or region), Fargate and Lambda; EC2 Instance Savings Plans are tied to one instance family in one region and discount more; Database Savings Plans (announced late 2025) cover managed databasesSteady baseline usage you're confident will continue
Reserved InstancesCommit to specific instance attributes (type, region, platform) for 1 or 3 years. The older model; for EC2, AWS now recommends Savings PlansServices and cases that Savings Plans don't cover
Spot InstancesUse AWS's spare EC2 capacity at a large discount; AWS can take it back with a two-minute warningInterruption-tolerant work: CI runners, batch jobs, stateless workers in an Auto Scaling group

Commitments can be paid all upfront, partially upfront or with no upfront payment; more upfront means a bigger discount. Never commit before you know your real usage: a Savings Plan is billed whether you use it or not.

The free tier (read the current page)

AWS changed its free tier on 15 July 2025. Accounts created since then get sign-up credits (with more earned by trying certain services) and choose between a free plan, which runs for a limited period (up to six months) or until the credits are used and doesn't charge your card, and a paid plan, where credits are used first and normal billing follows. Accounts created before that date keep the older model: 12 months of limited free usage for certain services, such as a small instance for a set number of hours per month. On both, some services have an always-free monthly allowance. The details (amounts, eligible instance types, which services are excluded) change, so check the AWS Free Tier page and the Free Tier and Credits pages in the Billing console for your own account. "Free tier eligible" in the console means eligible for your account's plan, within its limits, not free without limit.

What causes surprise bills

  • Forgotten resources: an instance, a database or a load balancer from last week's tutorial, often in a different region from the one the console is showing.
  • NAT gateways: an hourly charge per gateway plus a charge per GB processed, even when nothing interesting is happening. Tutorials create them readily. Add an S3 gateway endpoint so S3 traffic skips the NAT.
  • Data transfer out: large downloads, video, or a popular file served straight from S3 or EC2. A CDN helps, but transfer is never free at scale.
  • Leftover storage: unattached EBS volumes (status available), old snapshots, and AMIs (deregistering an AMI does not delete its snapshots).
  • Public IPv4 addresses: every one is billed hourly, including idle Elastic IPs.
  • Things that restart: a stopped RDS instance starts again automatically after seven days.
  • Logs kept forever: CloudWatch Logs groups default to "Never expire". Set a retention period.
  • Services with a base fee: EKS clusters, interface VPC endpoints, idle load balancers.
  • Leaked access keys: attackers launch expensive instances in every region within minutes. Use roles, never commit keys, and enable MFA.

Budgets and alerts

Set these up before you build anything:

  • AWS Budgets (Billing and Cost Management → Budgets): create a monthly cost budget with email alerts on actual spend (say at 80%) and forecasted spend (at 100%). The zero spend budget template alerts you the moment anything costs more than a cent. Budgets check a few times a day, so they warn you; they don't stop resources.
  • Cost Explorer: charts of spend by service, region, day and tag. The first place to look when a bill surprises you.
  • Cost Anomaly Detection: learns your normal spend and alerts on unusual jumps. Check that a monitor exists and that its alerts go to an address you read.
  • Billing preferences: turn on free tier usage alerts, and "Receive CloudWatch billing alerts" if you want CloudWatch alarms on the EstimatedCharges metric (billing metrics live in us-east-1).

A budget can also be created from the CLI:

# budget.json
{
  "BudgetName": "monthly-limit",
  "BudgetLimit": { "Amount": "10", "Unit": "USD" },
  "TimeUnit": "MONTHLY",
  "BudgetType": "COST"
}

# notifications.json
[
  {
    "Notification": { "NotificationType": "ACTUAL", "ComparisonOperator": "GREATER_THAN",
                      "Threshold": 80, "ThresholdType": "PERCENTAGE" },
    "Subscribers": [ { "SubscriptionType": "EMAIL", "Address": "[email protected]" } ]
  }
]

$ aws budgets create-budget --account-id 123456789012 \
    --budget file://budget.json --notifications-with-subscribers file://notifications.json

Tagging

Tags are key-value labels on resources, such as Project=practice, Env=dev, Owner=demee. Tag everything from day one (Terraform's default_tags makes this automatic). Tags let you find and delete everything belonging to one experiment, and, once you activate them as cost allocation tags in the Billing console, split the bill by project in Cost Explorer. Activation isn't retroactive: only costs from after activation are grouped by tag.

$ aws ec2 create-tags --resources i-0abc1234def567890 vol-0123456789abcdef0 \
    --tags Key=Project,Value=practice Key=Env,Value=dev
$ aws resourcegroupstaggingapi get-resources --tag-filters Key=Project,Values=practice \
    --query 'ResourceTagMappingList[].ResourceARN' --output text

Cleaning up

When an experiment is over, delete it the same way you built it: terraform destroy for Terraform projects, deleting the stack for CloudFormation, otherwise by hand in reverse order (instances and load balancers, then NAT gateways and Elastic IPs, then volumes, snapshots and buckets, and finally the VPC). Then sweep every region for leftovers:

$ for r in $(aws ec2 describe-regions --query 'Regions[].RegionName' --output text); do
    echo "== $r"
    aws ec2 describe-instances --region "$r" \
      --query 'Reservations[].Instances[].[InstanceId,State.Name,InstanceType]' --output text
  done

# unattached volumes and unassociated Elastic IPs in the current region
$ aws ec2 describe-volumes --filters Name=status,Values=available \
    --query 'Volumes[].[VolumeId,Size,CreateTime]' --output table
$ aws ec2 describe-addresses --query 'Addresses[?AssociationId==`null`].[PublicIp,AllocationId]' --output table

The Billing console's Bills page, broken down by service and region, is the final check: anything still charging shows up there.

Installing the AWS CLI v2

# Linux (x86_64; use awscli-exe-linux-aarch64.zip on ARM)
$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
$ unzip awscliv2.zip
$ sudo ./aws/install                 # add --update to upgrade an existing install
$ aws --version
aws-cli/2.x.x Python/3.x.x Linux/...

# macOS
$ curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
$ sudo installer -pkg AWSCLIV2.pkg -target /

# Windows (run in PowerShell or cmd)
$ msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi

Don't use pip install awscli: that installs the old version 1, which lacks v2 features such as aws login, SSO support and the --cli-binary-format option.

Credentials and profiles

The CLI needs credentials. From best to last resort:

  • aws login (CLI 2.32 or newer): signs you in through the browser with your normal console sign-in and gives the CLI short-lived credentials that refresh automatically. No keys stored on disk.
  • aws configure sso then aws sso login: for IAM Identity Center users.
  • aws configure with an IAM user's access key: long-lived keys in a plain-text file. If you use it, give that user only what it needs and rotate the key.
$ aws configure
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
AWS Secret Access Key [None]: ****************************************
Default region name [None]: eu-central-1
Default output format [None]: json

# ~/.aws/config: settings per profile
[default]
region = eu-central-1
output = json

[profile practice]
region = eu-west-1
output = table

# ~/.aws/credentials: keys per profile (no "profile " prefix here)
[default]
aws_access_key_id = AKIAIOSFODNN7EXAMPLE
aws_secret_access_key = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

$ aws configure --profile practice       # create or edit a named profile
$ aws s3 ls --profile practice            # use it for one command
$ export AWS_PROFILE=practice             # or for the whole shell session

Before doing anything, check who and where you are. Many "it doesn't work" moments are simply the wrong account or region:

$ aws sts get-caller-identity
{
    "UserId": "AIDAEXAMPLEUSERID1234",
    "Account": "123456789012",
    "Arn": "arn:aws:iam::123456789012:user/demee"
}
$ aws configure get region

Settings are resolved in this order: command-line options (--region, --profile, --output) beat environment variables (AWS_PROFILE, AWS_REGION, AWS_ACCESS_KEY_ID…), which beat the config and credentials files. A forgotten AWS_ACCESS_KEY_ID in your environment silently overrides your profile.

Output formats and --query

--output can be json (default), yaml, text (tab-separated, best for shell scripts) or table (for humans). --region eu-west-1 runs one command against another region. --query filters and reshapes the JSON response using JMESPath, on your machine after the response arrives; --filters, where a command supports it, filters on AWS's side before anything is sent.

# Running instances as a table: ID, type, AZ and the value of the Name tag
$ aws ec2 describe-instances --filters Name=instance-state-name,Values=running \
    --query "Reservations[].Instances[].{ID: InstanceId, Type: InstanceType, AZ: Placement.AvailabilityZone, Name: Tags[?Key=='Name'] | [0].Value}" \
    --output table

# Just the bucket names, one per line
$ aws s3api list-buckets --query 'Buckets[].Name' --output text

Reading the first query: Reservations[].Instances[] flattens the nested lists into one list of instances; {ID: InstanceId, …} builds a new object for each with the fields you choose; Tags[?Key=='Name'] keeps only tags whose key is Name, and | [0].Value takes the first one's value. Strings inside JMESPath go in single quotes, so wrap the whole query in double quotes in bash. Other handy settings: --no-cli-pager (or export AWS_PAGER="") stops output opening in less, and aws <command> help shows every option.

Your first hour on a new AWS account

  1. Sign in as root and turn on MFA (a passkey or an authenticator app). Make sure root has no access keys.
  2. Check the account email and set alternate contacts for billing and security, so AWS's warnings reach you.
  3. Create an everyday admin identity: an IAM Identity Center user, or an IAM user with MFA in an admins group. Sign out of root and use that from now on.
  4. Create a zero spend budget and a monthly budget with actual and forecasted alerts; turn on free tier usage alerts; check Cost Anomaly Detection is sending alerts to you.
  5. Pick a home region close to you and use it consistently.
  6. Install the CLI v2, run aws login (or aws configure sso), then aws sts get-caller-identity.
  7. Confirm S3 Block Public Access is on at account level and turn on EBS encryption by default in your region.
  8. Look at CloudTrail event history (the last 90 days of management events are visible by default); create a trail to S3 if you want a longer record.
  9. Decide on tags (at least Project) and, from the second experiment on, build with Terraform so that terraform destroy cleans up everything.

Common CLI errors

  • Unable to locate credentials: nothing configured for this profile. Run aws login, aws sso login or aws configure, or check AWS_PROFILE.
  • ExpiredToken or "The SSO session has expired": temporary credentials ran out; log in again.
  • InvalidClientTokenId / SignatureDoesNotMatch: a mistyped, deleted or deactivated access key, or a stale key in environment variables overriding the file.
  • Could not connect to the endpoint URL: usually a misspelled region (eu-central1 instead of eu-central-1).
  • An empty result when you know the resource exists: you're in the wrong region or account. Check aws sts get-caller-identity and --region.
  • Output opens in a pager and a script hangs: add --no-cli-pager or set AWS_PAGER="".

Questions

Pick an answer. Get it wrong and you can try again right away, no waiting. 10 questions per topic - pick a filter below, then use Recreate questions for a fresh set on that topic.

Fresh questions every time

Exam

A mixed test across the whole site, shuffled so you never know which topic comes next. When you submit, every mistake comes with the reason and a jump to the exact moment in the video that explains it.

30 questions 6 topics 20 minute limit Up to 70 XP
1–4 answer · ←→ move
History

Essay

0 / 200-250 words
Sample answer
History
0:00 / 0:00
Not started

on YouTube
Subscribe

Topic progress

Activity

Achievements

Settings

Your profile and your account.

Profile details

* Required. Saved in this browser until you sign in.

Letters, numbers, dots, dashes and underscores.
0 / 160

Account

Checking…

App

Install Stackwise on your phone or computer. It opens in its own window from your home screen, and the Docs and cheat sheets you've opened keep working without internet.

Only admins can see this

Dashboard

Sign-ups, activity, messages and reviews in one place.

Prove it

Certificates

Pass a topic's test and get a certificate with its own public page you can share or add to LinkedIn. Each test is 10 questions drawn at random and graded on the server; you need 8 right, you have 15 minutes, and you get one try per topic a day.

From first command to production

Linux for DevOps

A path through Linux the way DevOps engineers use it: ten stages, every command explained with its flags, examples, real output and mistakes, the combinations engineers chain together, and incidents worked through step by step. Practise everything in a safe lab folder.

Before the interview

Interview prep

Questions that come up in real DevOps interviews, with the kind of answer that lands. Say yours out loud first, then compare. Each one links to the chapter that goes deeper.

    Private to you

    My notes

    Everything you wrote down while watching and reading, in one place. Saved to your account, never shown to anyone.