Lesson 1 of 11 · 12 min · Cloud basics
Cloud fundamentals and compute options
What you will learn
- What "the cloud" means and why companies use it
- IaaS, PaaS, SaaS and serverless
- Regions, availability zones and where to run in India
- The shared responsibility model
- Compute options: virtual machines, containers, serverless, and how to choose
- EC2 basics: instance types, images, pricing models
In simple words
The cloud means renting computers from a company such as Amazon instead of buying your own, the way you take a cab instead of buying a car. You pay for what you use and can get more within minutes. This lesson explains the main kinds of things you can rent and who is responsible for what.
Words to know
- Cloud provider: a company that rents out computing over the internet: AWS, Azure, Google Cloud.
- Region: a part of the world where the provider has data centres, such as Mumbai or Hyderabad.
- Availability zone: one separate data centre, or a group of them, inside a region.
- Virtual machine (EC2): a computer you rent by the hour. On AWS it is called an EC2 instance.
- Serverless: you hand over only your code. The provider runs it and bills you per use.
What the cloud is
Cloud computing is renting computing resources (servers, storage, databases, networking, and higher-level services) over the internet, on demand, paid by usage, instead of buying and running your own hardware. Key characteristics:
- On-demand self-service: create a server in a minute with an API call.
- Elasticity: scale up for a sale or a launch, scale down afterwards.
- Pay as you go: operating expense instead of capital expense; per-second or per-hour billing.
- Global reach: deploy near users in many regions.
- Managed services: the provider runs databases, queues, load balancers and more, so you operate less.
The three big providers: Amazon Web Services (AWS), Microsoft Azure and Google Cloud (GCP). Others: Oracle Cloud (with a generous always-free tier), DigitalOcean and similar for simpler needs. The concepts here are the same everywhere; we use AWS as the worked example and name equivalents.
Service models
| Model | You manage | Provider manages | Examples |
|---|---|---|---|
| IaaS (infrastructure) | OS, runtime, application, data, security config | hardware, virtualisation, network | EC2, Azure Virtual Machines, Compute Engine |
| PaaS (platform) | application and data | OS, runtime, scaling, patching | Elastic Beanstalk, App Runner, Azure App Service, Cloud Run |
| FaaS / serverless | function code | everything else, scaling to zero | AWS Lambda, Azure Functions, Cloud Functions |
| SaaS (software) | your configuration and data | the whole application | Gmail, Salesforce, Microsoft 365 |
The more the provider manages, the less you operate (and the less control you have). A common pattern is to use the highest-level service that fits and drop down only when you must.
Regions and availability zones
- A region is a geographic area with several data centre groups. AWS regions in India: Mumbai (
ap-south-1) and Hyderabad (ap-south-2); Azure has Central India (Pune), South India (Chennai) and West India (Mumbai); Google Cloud has Mumbai (asia-south1) and Delhi (asia-south2). Pick regions for latency to users, data residency/legal requirements, service availability (new services reach some regions first) and price (varies by region). - An availability zone (AZ) is one or more separate data centres inside a region with independent power, cooling and networking, connected by fast low-latency links. Zones are named like
ap-south-1a,ap-south-1b,ap-south-1c. Deploying across at least two zones protects you from the failure of one data centre (details in the availability lesson). - Regions are isolated from each other. Data does not leave a region unless you copy it; services are mostly regional. A few are global (IAM, Route 53, CloudFront).
- Edge locations (CDN, DNS) are many more, near users.
Zone names are mapped per account (your 1a may be another account's 1b) to spread load, so use zone IDs (aps1-az1) when coordinating across accounts.
The shared responsibility model
Security and operations are split:
- The provider is responsible for security of the cloud: physical data centres, hardware, the virtualisation layer, and the managed services' infrastructure.
- You are responsible for security in the cloud: your data, identity and access (IAM), network configuration (security groups, public exposure), operating-system patching on IaaS servers, application security, encryption choices, and backups.
The more managed the service, the more the provider takes (with RDS the provider patches the database engine; on an EC2 instance running your own database, you do). The most common cloud breaches are customer misconfigurations: a public S3 bucket, an open database port, leaked access keys, over-permissive IAM roles. Most of this course's security lessons address exactly those.
EC2 in more detail
An EC2 instance is a virtual machine. You choose:
- Image (AMI, Amazon Machine Image): the OS and pre-installed software (Amazon Linux, Ubuntu, Windows, or your own "golden image" built with Packer). The root disk comes from the AMI.
- Instance type: CPU, memory, network, storage. Names encode them:
m7g.large= familym(general purpose), generation 7,g= Graviton (ARM) processor, sizelarge. Families: t burstable (cheap, bursts above a baseline using credits; fine for small or dev workloads), m general purpose, c compute optimised, r/x memory optimised, i/d storage optimised, g/p/inf/trn GPU and ML accelerators. Graviton instances usually give better price/performance for Linux workloads if your software runs on ARM (containers must be built forarm64: Docker course). - Storage: EBS volumes (next lesson), optionally instance store.
- Network: VPC, subnet, security groups, public or private IP.
- IAM role (instance profile): the identity your code uses to call AWS APIs, instead of storing keys on the machine (IAM lesson).
- User data: a script that runs at first boot (install packages, join a cluster). Use configuration management or immutable images rather than manual SSH setup.
- Key pair or no key: SSH keys, or better, AWS Systems Manager Session Manager (no open port 22, audited access).
Purchase options
| Option | Idea | Typical saving | Trade-off |
|---|---|---|---|
| On-Demand | pay per second, no commitment | baseline | most expensive for steady use |
| Savings Plans / Reserved Instances | commit to 1 or 3 years of usage | large (often 30-70%) | commitment; unused commitment is wasted |
| Spot | spare capacity at a deep discount | up to roughly 90% | can be reclaimed with two minutes' notice; for fault-tolerant, stateless, batch or CI work |
| Dedicated hosts | physical server for you | none | licensing or compliance needs |
Right-size first, commit second (cost lesson).
Good practice for instances
- Treat servers as replaceable, not as pets: build from an image or user data, keep state in managed storage/databases, and be ready to terminate and recreate.
- Put them in an Auto Scaling group across zones (availability lesson), behind a load balancer.
- No public IPs on application servers: put them in private subnets (VPC lesson).
- Patch regularly (or replace with fresh images) and use IMDSv2 (the instance metadata service requiring tokens), which blocks a class of credential-theft attacks (SSRF).
- Monitor CPU, memory (needs the CloudWatch agent), disk, and status checks.
Common mistakes
- Choosing VMs for everything, inheriting all the operational work.
- Single instance, single zone, a single point of failure.
- Public IPs and open SSH on application servers.
- Leaving instances running (the most common cause of surprise bills).
- Oversized instances "to be safe" with no monitoring to right-size.
- Storing state on the instance disk that disappears with the instance.
- Ignoring the shared responsibility model ("AWS secures it").
Try it yourself
- Create a free-tier account (set a billing alert first), launch a
t3.microort4g.microLinux instance with a role and Session Manager access, and connect without SSH keys. Terminate it afterwards. - List the regions closest to you and compare the price of one instance type in two regions on the pricing page.
- Take an application you know and decide whether it should be VM, container, PaaS or function, and write down why.
- Find the shared-responsibility diagram in the AWS documentation and mark what you would be responsible for in EC2 versus RDS versus Lambda.
Check yourself
What is the difference between a region and an availability zone?
A region is a geographic area containing several isolated availability zones; a zone is one or more data centres with independent power and networking within the region. Spreading across zones gives resilience to a data-centre failure.
Under the shared responsibility model, who patches the operating system on an EC2 instance?
You do. The provider secures the underlying infrastructure; with managed services such as RDS or Lambda, the provider also patches the platform.
When is serverless a better fit than a VM?
For event-driven, spiky or low-volume workloads where you want to pay per execution, scale automatically (including to zero) and avoid managing servers; not for long-running, high-steady-load or special-hardware workloads.
What do the letters in m7g.large mean?
m is the general-purpose family, 7 the generation, g means Graviton (ARM) processors, and large is the size.
Interview questions
How do you choose between EC2, containers and Lambda?
Match the workload and operational burden: Lambda for event-driven short tasks, containers (ECS/EKS/Fargate or Cloud Run) for services needing portability and steady load, EC2 for workloads needing OS-level control or special software; prefer the most managed option that fits.
What are Spot instances and what are they good for?
Spare capacity sold at a deep discount that can be reclaimed at short notice; good for stateless, fault-tolerant, interruption-tolerant workloads like batch jobs, CI runners and worker fleets.
What does multi-AZ protect against and what does it not?
It protects against failure of a single data centre/zone; it does not protect against a region-wide outage, application bugs, bad deployments or data corruption (you need backups and possibly multi-region).
Summary
- The cloud is on-demand, pay-per-use, elastic infrastructure and services; service models range from IaaS to SaaS.
- Regions contain isolated availability zones; design across at least two zones; pick regions for latency, law and cost.
- Shared responsibility: the provider secures the cloud, you secure what you put in it.
- Choose the most managed compute that fits (functions, containers, PaaS, VMs); size, price and secure EC2 instances deliberately.
Going deeper
- AWS: What is cloud computing?: concepts and benefits.
- AWS Global Infrastructure: regions, zones and edge locations.
- AWS shared responsibility model: what AWS and customers each own.
- Amazon EC2 instance types: families and naming.
- Azure and Google Cloud: compare services with AWS: Microsoft's service mapping across clouds.
See how much of this you can explain
A free mock interview asks you new questions on Cloud platforms and AWS fundamentals for DevOps Engineer and scores every answer, with what to fix.