CloudVol. 7 · Part VII
0 / 0

Shelves / Cloud

CL·00

Start Here: What the Cloud Actually Is

For readers who have run software on their own machines but never in the cloud: what you rent and what you still own, regions and availability zones, infrastructure as API calls demonstrated with the real AWS SDK against a local emulator, how the meter runs, the vocabulary of the volume, and how to study it.

10 topics · ~7 min read · 10-question quiz
Updated Suggest a correction

Start here: how to use this volume

Two reading paths

This volume is about running systems on cloud platforms: what the cloud is, compute, networking, storage, identity, architecture across AWS, Azure and Google Cloud, and the Well-Architected way of reviewing a design. Every chapter has the same shape: a plain-language Start here section with small, verified experiments; a How deep to go ladder; the full-depth sections; a Lab of real measurements; and a Revision sheet.

  • New to the cloud? Read this chapter, then the chapters in order. Answer Check yourself before opening the answers, and take each quiz.
  • Experienced? Skip this chapter. In each chapter read the revision sheet first, take its quiz, then use How deep to go to choose the sections and lab experiments to study.

How the experiments were run (read this once)

A textbook lab can't create real cloud resources on your account, so the experiments use three honest substitutes, and each lab says which one it uses:

  1. The real AWS SDK against an emulator. boto3 (the official AWS SDK for Python) talks to moto 5.2, an open-source emulator of AWS APIs running locally. The calls and responses have the real shapes; what happens behind them is simulated, so the labs never report emulator speed as cloud speed.
  2. Real Linux networking that mirrors cloud networking. A VPC with public and private subnets, route tables, a NAT gateway and security groups is built from network namespaces, routes and firewall rules on one machine. It is what a cloud provider's virtual network does, minus the scale.
  3. Real arithmetic with published numbers. Availability, durability, cost and capacity calculations use the providers' published prices and service-level agreements, looked up for this edition (October 2026) and cited where used. Prices change, so treat them as examples and check the current pricing pages.

When you have a cloud account, every experiment has a "try it on the real cloud" version, with the free-tier-friendly settings noted.

Mastery levels

Every chapter uses the same six levels:

Level Name You can… Example for cloud networking
L1 Recognition define it and spot it "that's a private subnet"
L2 Working use it correctly build a VPC with public and private subnets from code
L3 Internals explain why it works explain route tables, NAT and stateful security groups
L4 Debugging diagnose failures find why an instance can't reach the internet
L5 Design choose between approaches design a multi-account, multi-region network
L6 Production run it at scale operate a network across hundreds of accounts with central egress

What the cloud is

Renting the layers you built in Volume 6

In Volume 6 you ran your service as a process, a container, a Kubernetes pod and behind a proxy, all on one machine you controlled. A cloud provider rents you each of those layers, on hardware in its own data centres, through an API: you ask for a virtual machine, a network, a disk, a database or a function, and seconds later it exists, billed by the second, hour or request. You give it back when you're done. Three properties make that different from renting servers the old way:

  • On demand and self-service: no purchase orders or waiting for hardware; an API call creates it.
  • Elastic: capacity grows and shrinks with load, and you pay for what you use.
  • Managed: the provider runs more of the stack (hardware, hypervisors, databases, Kubernetes control planes), so you run less.

How much you rent decides how much you still operate:

You manage… On-premises IaaS (VMs) Containers/Kubernetes service PaaS / serverless SaaS
Application code and data You You You You Provider (you manage your data and users)
Runtime, OS patches You You Partly Provider Provider
Virtualisation, servers, network, facilities You Provider Provider Provider Provider

This is the shared responsibility model: the provider secures the cloud itself; you secure what you put in it (your data, identities, configuration and code). Most cloud breaches are on the customer's side of that line, usually misconfiguration.

Regions and availability zones

A region (for example ap-south-1, Mumbai) is a geographic area with several availability zones (AZs): separate data centres (or groups of them) with independent power, cooling and networking, close enough for fast connections (single-digit milliseconds) and far enough apart that a fire or flood shouldn't take out two. You put copies of your service in at least two AZs so one zone's failure doesn't take you down; some services (object storage, DNS) are spread across zones for you.

region ap-south-1 (Mumbai) VPC 10.20.0.0/16 AZ ap-south-1a subnet 10.20.0.0/24 instance 10.20.0.4 AZ ap-south-1b subnet 10.20.1.0/24 instance 10.20.1.4 S3 buckettiffin-menusregional,copies inseveral AZs
One region with two availability zones. Each zone has its own subnet and instance; the VPC spans the region; object storage is a regional service replicated across zones by the provider.

Infrastructure as API calls

Here is the diagram above, created with the AWS SDK for Python (against the local emulator, as described above):

Python
vpc = ec2.create_vpc(CidrBlock="10.20.0.0/16")["Vpc"]["VpcId"]
for i, az in enumerate(["ap-south-1a", "ap-south-1b"]):
    ec2.create_subnet(VpcId=vpc, CidrBlock=f"10.20.{i}.0/24", AvailabilityZone=az)
sg = ec2.create_security_group(GroupName="tiffin-web", Description="HTTPS from anywhere", VpcId=vpc)["GroupId"]
ec2.authorize_security_group_ingress(GroupId=sg, IpPermissions=[{"IpProtocol": "tcp", "FromPort": 443, "ToPort": 443,
                                                                 "IpRanges": [{"CidrIp": "0.0.0.0/0"}]}])
ec2.run_instances(ImageId="ami-12c6146b", InstanceType="t4g.small", MinCount=1, MaxCount=1, SubnetId=sn, SecurityGroupIds=[sg])
s3.create_bucket(Bucket="tiffin-menus", CreateBucketConfiguration={"LocationConstraint": "ap-south-1"})
Text
create_vpc            -> vpc-552d29688b194f5b5 10.20.0.0/16
create_subnet         -> subnet-84d9f37037c17106e 10.20.0.0/24 ap-south-1a (251 usable addresses)
create_subnet         -> subnet-2bd1e51844fe769b9 10.20.1.0/24 ap-south-1b (251 usable addresses)
create_security_group -> sg-08201d5f5aaf09759 allow tcp/443 from 0.0.0.0/0
run_instances         -> i-098a4a95cd6b315b3 t4g.small ap-south-1a 10.20.0.4 pending
run_instances         -> i-ff303d0457d36c73c t4g.small ap-south-1b 10.20.1.4 pending
put_object x2         -> versions 303d0167… 81ae27d7…
presigned URL         -> http://127.0.0.1:5000/tiffin-menus/menu.json?X-Amz-Algorithm=AWS4-HMAC-S…
plain HTTP GET of it  -> {"dosa": 95}
get_object(version 1) -> {"dosa": 80}

Every resource has an ID and lives in a region (and, for subnets and instances, a zone). A /24 subnet has 251 usable addresses, not 256: AWS reserves five per subnet (network, router, DNS, future use, broadcast). The bucket kept both versions of menu.json, and a presigned URL let a plain HTTP client fetch a private object for five minutes without any credentials of its own. In practice you rarely write these calls by hand: infrastructure as code tools (Terraform/OpenTofu, AWS CDK, Pulumi, Bicep, CloudFormation) declare the desired resources, and like Kubernetes, compute and apply the difference.

The meter is always running

Everything you create costs money while it exists, including things doing nothing: a stopped VM's disk, an idle NAT gateway, an unattached IP address, logs kept forever, data transferred out to the internet. Cloud skills include cost awareness: tagging resources with owners, setting budgets and alerts, deleting what you don't use, and choosing pricing models (on-demand, savings plans/committed use, spot) deliberately (chapters 86 and 91).

How to study the cloud

A routine that works

  1. Learn one provider deeply, then map the others. The concepts transfer; the names don't (chapter 90 has the map).
  2. Read the documentation's concept pages, not just tutorials: the VPC, IAM and S3 user guides are the real textbooks.
  3. Build with code from day one (Terraform/OpenTofu or the CDK), and destroy everything when you finish.
  4. Set a budget alert before your first experiment, and use free tiers.
  5. Draw every architecture as regions, zones, networks, trust boundaries and data flows.

Warm-up exercises

  1. List the regions near you for AWS, Azure and Google Cloud, and how many zones each has.
  2. Split 10.20.0.0/16 into four /18 subnets and into 256 /24 subnets. How many usable addresses does each have in AWS?
  3. For the shared responsibility table, name one thing you'd still have to do yourself with a managed database.
  4. Run this chapter's script against moto (pip install "moto[server]" boto3, then moto_server), and change it to create a third subnet in another zone.

Glossary

  • Region: a geographic area containing several availability zones.
  • Availability zone: an isolated data-centre location within a region.
  • VPC / VNet: a private virtual network in the cloud.
  • Subnet: a range of a VPC's addresses, placed in one zone.
  • Security group: a stateful firewall attached to network interfaces.
  • Instance: a virtual machine.
  • Bucket: a container of objects in object storage.
  • Infrastructure as code (IaC): declaring cloud resources in versioned files applied by a tool.
  • Shared responsibility: the split of security duties between provider and customer.