📚 Module: Unit 12 • Cloud Infrastructure & Cloud Computing

Cloud Computing Fundamentals: Infrastructure, Architecture & Governance

A comprehensive engineering textbook on modern enterprise cloud computing. Master the NIST cloud definition, IaaS vs PaaS vs SaaS, the Cloud Shared Responsibility Model, Public/Private/Hybrid/Multi-Cloud deployment topologies, Hyperscaler comparison (AWS, Azure, GCP), Global Infrastructure (Regions, AZs, Edge PoPs), Type 1 Bare-Metal Hypervisors and AWS Nitro, Block vs Object vs File storage, Identity & Access Management (IAM Least Privilege), and FinOps cost governance.

⏱️ Estimated Mastery: 8 Hours
🛠️ Technologies: AWS (EC2, S3, IAM), Azure, GCP, Terraform / HCL, S3 SDK v3
🎯 Architectural Models: NIST SP 800-145, Shared Responsibility, Multi-AZ HA, FinOps Lifecycle

What is Cloud Computing? The NIST SP 800-145 Standard

According to the official standard formulated by the National Institute of Standards and Technology (NIST SP 800-145), cloud computing is defined as a model for enabling ubiquitous, convenient, on-demand network access to a shared pool of configurable computing resources (networks, servers, storage, applications, and services) that can be rapidly provisioned and released with minimal management effort or service provider interaction.

The Five Essential Characteristics of Cloud Computing (NIST Standard)
+---------------------------------------------------------------------------------------+ | 1. ON-DEMAND SELF-SERVICE: | | Consumers unilaterally provision compute, storage, and networking via automated | | APIs without requiring human intervention from the service provider. | +---------------------------------------------------------------------------------------+ | 2. BROAD NETWORK ACCESS: | | Capabilities are accessible over standard network protocols from heterogeneous | | thin or thick client platforms (workstations, mobile devices, servers). | +---------------------------------------------------------------------------------------+ | 3. RESOURCE POOLING: | | The provider's physical resources are pooled to serve multiple consumers using | | a multi-tenant model, dynamically assigning physical and virtual resources. | +---------------------------------------------------------------------------------------+ | 4. RAPID ELASTICITY: | | Capabilities can be elastically provisioned and released to scale rapidly outward | | and inward commensurate with instantaneous demand (Autoscaling). | +---------------------------------------------------------------------------------------+ | 5. MEASURED SERVICE: | | Resource usage is automatically monitored, controlled, and reported, providing | | transparent pay-as-you-go metering for both provider and consumer. | +---------------------------------------------------------------------------------------+

Capital Expenditure (CapEx) vs Operational Expenditure (OpEx)

Prior to cloud computing, organizations maintained on-premises datacenters requiring massive upfront capital investment (CapEx): purchasing physical blade servers, redundant uninterruptible power supplies (UPS), commercial HVAC cooling systems, and long-term real estate leases with procurement lead times spanning 3 to 6 months.

Cloud infrastructure shifts financial accounting to operational expenses (OpEx): organizations pay strictly for computational seconds, gigabytes transferred, and I/O operations consumed on a variable utility model. This eliminates over-provisioning waste (provisioning for peak Black Friday load that sits 90% idle the remainder of the year).

Cloud Service Models (IaaS, PaaS, SaaS) & Shared Responsibility

Cloud computing organizes abstractions into three foundational service models, differing by how much of the technology stack is managed by the cloud vendor versus the engineering organization:

The Cloud Stack Abstraction Hierarchy
Layer / Tier On-Premises IaaS PaaS SaaS +-----------------------+---------------+--------------+--------------+--------------+ | Applications | CUSTOMER | CUSTOMER | CUSTOMER | PROVIDER | | Data & State | CUSTOMER | CUSTOMER | CUSTOMER | PROVIDER | | Runtime & Middleware | CUSTOMER | CUSTOMER | PROVIDER | PROVIDER | | Operating System | CUSTOMER | CUSTOMER | PROVIDER | PROVIDER | | Virtualization | CUSTOMER | PROVIDER | PROVIDER | PROVIDER | | Physical Servers | CUSTOMER | PROVIDER | PROVIDER | PROVIDER | | Physical Storage | CUSTOMER | PROVIDER | PROVIDER | PROVIDER | | Physical Datacenter | CUSTOMER | PROVIDER | PROVIDER | PROVIDER | +-----------------------+---------------+--------------+--------------+--------------+ (Zero Cloud) (AWS EC2, (Render, (Gmail, Azure VMs) Elastic B'tk) Salesforce)

1. Infrastructure as a Service (IaaS)

The provider provisions raw virtualized hardware: virtual machines (VMs), raw block storage, virtual private clouds (VPCs), and subnets. The consumer retains absolute root control over the operating system, file system, networking security rules, software updates, and application runtimes. Examples: AWS EC2, Google Compute Engine, Azure Virtual Machines.

2. Platform as a Service (PaaS)

The provider abstracts away the physical servers, operating system patches, runtime installation (Node.js, Python), and hardware provisioning. Engineers simply deploy application source code or pre-packaged container images. The platform automatically handles provisioning, health checks, auto-scaling, and load balancing. Examples: AWS Elastic Beanstalk, Render, Heroku, Google App Engine.

3. Software as a Service (SaaS)

The provider delivers a complete, fully functioning software application accessed over the internet, typically via a web browser or API. The customer manages zero infrastructure or code, configuring only user accounts and enterprise settings. Examples: Google Workspace, Microsoft 365, Salesforce, Stripe Dashboard.

The Cloud Shared Responsibility Model

Security in the cloud is a joint obligation:

Cloud Deployment Models: Public, Private, Hybrid & Multi-Cloud

The choice of deployment model depends on regulatory compliance, data sovereignty, latency requirements, and existing enterprise investments:

Deployment Model Infrastructure Tenancy Primary Advantages Key Engineering Trade-offs
Public Cloud Multi-tenant infrastructure owned and operated by a third-party hyperscaler (AWS, Azure, GCP). Zero CapEx, infinite elastic scale, global geographical reach, massive catalog of managed AI/DB services. Potential noisy neighbor issues, variable data egress transfer costs, risk of provider vendor lock-in.
Private Cloud Single-tenant infrastructure dedicated exclusively to one organization (on-prem or hosted). Absolute physical control, custom hardware architectures, adherence to strict defense/banking regulations. High upfront CapEx, ongoing hardware maintenance, limited elasticity bounded by physical rack space.
Hybrid Cloud Interconnection of on-premises private infrastructure with one or more public clouds. Enables "cloud bursting" (running baseline workloads on-prem and bursting spike traffic to public cloud). Complex network plumbing: requires dedicated leased fiber (AWS Direct Connect / Azure ExpressRoute) and IP routing.
Multi-Cloud Distributing workloads across two or more distinct public cloud providers (e.g., AWS + GCP). Eliminates single-vendor lock-in, optimizes pricing leverage, leverages best-of-breed specialized engines. Massive operational complexity, distributed cross-cloud network egress fees, least-common-denominator tooling.

Hyperscale Cloud Providers: AWS vs Microsoft Azure vs GCP

The global cloud market is anchored by three hyperscalers, each possessing architectural distinctives:

Capability / Service Tier Amazon Web Services (AWS) Microsoft Azure Google Cloud Platform (GCP)
Virtual Machines (IaaS) Amazon EC2 (Elastic Compute Cloud) Azure Virtual Machines Google Compute Engine (GCE)
Managed Kubernetes Amazon EKS (Elastic Kubernetes Svc) Azure Kubernetes Service (AKS) Google Kubernetes Engine (GKE)
Serverless Compute AWS Lambda Azure Functions Google Cloud Run / Cloud Functions
Object Storage Amazon S3 (Simple Storage Service) Azure Blob Storage Google Cloud Storage (GCS)
Managed Relational DB Amazon RDS & Aurora Azure SQL Database Google Cloud SQL & AlloyDB
Identity Management AWS IAM Microsoft Entra ID (Azure AD) Google Cloud IAM
Core Strengths First-mover advantage, broadest service catalog, vast global community. Seamless Windows Server & Active Directory enterprise enterprise integration. Industry-leading Big Data (BigQuery), AI/ML (TPUs), and container networking.

Global Cloud Infrastructure: Regions, Availability Zones & PoPs

High-availability cloud engineering relies on hierarchical physical infrastructure topologies designed to prevent geographic catastrophes from causing total outages:

Cloud Infrastructure Hierarchy: Regions, Availability Zones & Edge PoPs
[GLOBAL NETWORK BACKBONE] | +---> [Region: us-east-1 (N. Virginia)] (Separated by > 500km from other regions) | | | +---> [Availability Zone A (us-east-1a)] (Discrete Datacenter with redundant power/fiber) | | ^ | | | (Sub-millisecond low-latency optical dark fiber loop < 2ms RTT) | | v | +---> [Availability Zone B (us-east-1b)] (Discrete Datacenter, flood plain isolated) | | ^ | | | | | v | +---> [Availability Zone C (us-east-1c)] (Discrete Datacenter, separate power grid) | +---> [Region: eu-west-1 (Ireland)] (Complies with European GDPR Data Sovereignty) | +---> [Edge Locations / Points of Presence (PoPs)] (> 450+ caching nodes worldwide) (Terminates TLS, caches static assets via Amazon CloudFront / Cloudflare)

Key operational rules for cloud architects:

Virtual Machines & Hypervisor Architectures

A virtual machine (VM) is an emulation of a physical computer system. Virtualization allows multiple isolated guest operating systems to execute concurrently on a single physical host server, mediated by a hypervisor (Virtual Machine Monitor - VMM).

Type 1 (Bare-Metal) vs Type 2 (Hosted) Hypervisors vs AWS Nitro
[TYPE 1: BARE-METAL HYPERVISOR] [TYPE 2: HOSTED HYPERVISOR] +-----------------------------------+ +-----------------------------------+ | Guest VM 1 | Guest VM 2 | VM 3 | | Guest VM 1 | Guest VM 2 | VM 3 | +-------------+-------------+-------+ +-------------+-------------+-------+ | Bare-Metal Hypervisor (KVM/ESXi) | | Hosted Hypervisor (VirtualBox) | +-----------------------------------+ +-----------------------------------+ | Physical Server Hardware (Bare) | | Host OS (Windows / macOS / Ubuntu)| +-----------------------------------+ +-----------------------------------+ | Physical Server Hardware | +-----------------------------------+ --------------------------------------------------------------------------------- [MODERN CLOUD: AWS NITRO SYSTEM ARCHITECTURE] +-------------------------------------------------------------------------------+ | GUEST VMS: Almost 100% of Host CPU & Memory allocated directly to Customers! | +-------------------------------------------------------------------------------+ | Lightweight Minimal Nitro Hypervisor (Near-zero CPU overhead) | +-------------------------------------------------------------------------------+ | Dedicated Physical ASIC Cards (Nitro Cards): | | - Nitro Card for VPC (Hardware-accelerated packet encryption & routing) | | - Nitro Card for EBS (Hardware NVMe storage controller) | | - Nitro Security Chip (Monitors and cryptographically validates firmware) | +-------------------------------------------------------------------------------+

Cloud VM instance classes are tailored for specific computational patterns:

Cloud Storage: Block, Object & File Storage

Cloud platforms provide three fundamental storage paradigms, each addressing distinct performance, consistency, and access characteristics:

Storage Type Storage Primitive Access Protocol Latency & Durability Primary Use Cases
Block Storage
(AWS EBS, Azure Managed Disk)
Raw unformatted blocks (e.g., 512-byte blocks). NVMe / iSCSI block protocol; mounted as physical disk drive to a single VM. Sub-millisecond latency; provisioned IOPS up to 256,000 IOPS. Boot volumes, Relational databases (PostgreSQL, MySQL), operating systems.
Object Storage
(AWS S3, GCP Cloud Storage)
Discrete immutable objects (Key + Value + Metadata). HTTP/HTTPS REST APIs (GET, PUT, DELETE). Tens of milliseconds; 99.999999999% (11 nines) durability. Unstructured media (images, videos), data lakes, backups, static websites.
File Storage
(AWS EFS, Azure Files)
Hierarchical file tree (Directories, files, permissions). NFSv4 / SMB network file share; mounted concurrently by thousands of VMs. Low single-digit millisecond latency; elastic growth. Shared content repositories, legacy enterprise app migration, Docker volumes.

The production TypeScript implementation below demonstrates generating an AWS S3 presigned upload URL with cryptographic expiration, allowing clients to upload directly to S3 without passing massive files through backend API servers.

TypeScript src/storage/s3-presigned-service.ts
import { S3Client, PutObjectCommand } from '@aws-sdk/client-s3';
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
import crypto from 'crypto';

const s3Client = new S3Client({
  region: process.env.AWS_REGION || 'us-east-1'
});

interface PresignedUploadTicket {
  uploadUrl: string;
  objectKey: string;
  expiresInSeconds: number;
}

export async function generatePresignedUploadUrl(
  tenantId: string,
  fileName: string,
  contentType: string
): Promise<PresignedUploadTicket> {
  // 1. Generate unique, collision-resistant object key
  const uniqueId = crypto.randomUUID();
  const objectKey = `uploads/${tenantId}/${uniqueId}-${fileName}`;
  const expiresInSeconds = 900; // 15 minutes validity

  // 2. Declare PutObject Command with Strict Content-Type Restriction
  const command = new PutObjectCommand({
    Bucket: process.env.S3_BUCKET_NAME!,
    Key: objectKey,
    ContentType: contentType,
    Metadata: {
      'uploaded-by-tenant': tenantId,
      'upload-timestamp': Date.now().toString()
    }
  });

  // 3. Cryptographically sign URL using AWS SigV4 credentials
  const uploadUrl = await getSignedUrl(s3Client, command, { expiresIn: expiresInSeconds });

  return { uploadUrl, objectKey, expiresInSeconds };
}

Identity and Access Management (IAM) & Least Privilege

Identity and Access Management (IAM) is the foundational security plane that controls authentication (who can access the cloud environment) and authorization (what actions they are permitted to perform on which cloud resources).

IAM Core Entities

The Principle of Least Privilege

Every user, service, and application container must be granted strictly the minimal permissions required to execute its explicit task—and nothing more. Wildcard permissions like "Action": "*" on "Resource": "*" represent an extreme security violation.

JSON policies/s3-least-privilege-policy.json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowTenantScopedReadWrite",
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:PutObject",
        "s3:DeleteObject"
      ],
      "Resource": "arn:aws:s3:::devascent-production-data/tenants/${aws:PrincipalTag/TenantId}/*"
    },
    {
      "Sid": "DenyUnencryptedTransit",
      "Effect": "Deny",
      "Action": "s3:*",
      "Resource": "arn:aws:s3:::devascent-production-data/*",
      "Condition": {
        "Bool": {
          "aws:SecureTransport": "false"
        }
      }
    }
  ]
}
IAM Policy Evaluation Precedence: When AWS evaluates an incoming API request, the engine begins with an implicit default DENY. If an explicit DENY matches any policy attached to the principal, the request is immediately rejected (an explicit Deny always trumps any number of explicit Allows). Only if an explicit ALLOW exists and zero explicit Denies match is the request authorized.

Billing, FinOps & Cloud Cost Management

Cloud elasticity without cost control can lead to catastrophic financial surprises. FinOps (Cloud Financial Operations) is the operational discipline of bringing financial accountability to the variable spend model of cloud computing.

1. Compute Purchasing Models

2. The FinOps Lifecycle

The Continuous FinOps Optimization Loop
+-------------------------------+ | 1. INFORM: | | - Enforce Cost Tags (Env/Svc)| | - Real-time Cost Dashboards | | - Automated Budget Alerts | +---------------+---------------+ | v +-------------------------------+ | 2. OPTIMIZE: | | - Right-size underused VMs | | - Purchase Savings Plans | | - Purge orphaned EBS volumes | +---------------+---------------+ | v +-------------------------------+ | 3. OPERATE: | | - Continuous automated audits| | - CI/CD Cost estimation gates| | - Culture of engineering ROI | +-------------------------------+
HCL (Terraform) infrastructure/budget-alarm.tf
# Production AWS CloudWatch Cost Budget Alert with SNS Notification
resource "aws_budgets_budget" "monthly_cost_budget" {
  name              = "monthly-production-budget"
  budget_type       = "COST"
  limit_amount      = "5000"
  limit_unit        = "USD"
  time_unit         = "MONTHLY"
  time_period_start = "2026-01-01_00:00"

  # Trigger alert when actual monthly spend exceeds 80%
  notification {
    comparison_operator        = "GREATER_THAN"
    threshold                  = 80
    threshold_type             = "PERCENTAGE"
    notification_type          = "ACTUAL"
    subscriber_email_addresses = ["finops-alerts@devascentacademy.me"]
  }

  # Trigger alert when forecasted monthly spend is projected to exceed 100%
  notification {
    comparison_operator        = "GREATER_THAN"
    threshold                  = 100
    threshold_type             = "PERCENTAGE"
    notification_type          = "FORECASTED"
    subscriber_email_addresses = ["oncall-leads@devascentacademy.me"]
  }
}

University & Industrial Examination Review

1. Deconstruct the Cloud Shared Responsibility Model for an AWS EC2 instance versus an AWS S3 bucket. Where does the security boundary lie in each?
Answer: For an AWS EC2 instance (IaaS), AWS is responsible for physical datacenter security, power, host hardware, and the virtualization hypervisor. The customer is responsible for guest operating system security patches, installed software runtimes, local firewall (Security Group/NACL) configuration, application code vulnerabilities, and network port management. For an AWS S3 bucket (managed Object Storage PaaS/SaaS tier), AWS manages the underlying disks, storage servers, file systems, operating systems, and physical multi-datacenter data replication. The customer is strictly responsible for configuring bucket policies, Access Control Lists (ACLs), ensuring data is encrypted at rest (KMS) and in transit (enforcing HTTPS), managing IAM access permissions, and preventing public read/write exposure.
2. Explain the architectural and physical difference between a Cloud Region and an Availability Zone (AZ). Why does a multi-AZ deployment protect against datacenter disasters?
Answer: A Cloud Region is a separate, geographic territory (e.g., us-east-1 in Virginia, eu-west-1 in Ireland) separated from other regions by hundreds or thousands of kilometers to isolate catastrophic weather, geopolitical, or power grid events. An Availability Zone (AZ) consists of one or more discrete, physically separated datacenters located within a region, connected to other AZs via dedicated, ultra-low latency optical dark fiber loops (<2ms latency). Each AZ possesses independent utility power feeds, on-site backup generators, and flood plane isolation. Deploying an application in a Multi-AZ active-active configuration ensures that if an entire datacenter suffers an unrecoverable structural fire or localized power grid failure, the surviving AZs instantly absorb the load without service downtime.
3. Compare Block Storage (AWS EBS) with Object Storage (AWS S3) in terms of data hierarchy, access methods, latency, and maximum storage capacity.
Answer: Block Storage treats storage as raw, unformatted sectors/blocks accessed over low-latency block-level protocols (NVMe/iSCSI) and mounted directly to an individual operating system as a local disk drive (e.g., /dev/xvda). It provides sub-millisecond latencies required for transactional database engines (PostgreSQL/MySQL), but has fixed volume sizing and is typically restricted to a single VM in a single AZ. Object Storage treats data as discrete, immutable units (objects) stored in a flat namespace without a folder tree. Objects are accessed globally over HTTP/HTTPS REST APIs (GET/PUT/DELETE) with latencies of 10 to 50 milliseconds. Object storage provides virtually infinite elastic scale, automated multi-AZ durability (11 nines), and fine-grained HTTP metadata tagging.
4. How do AWS IAM Roles improve security compared to IAM Users with static Access Key IDs and Secret Access Keys?
Answer: IAM Users possess static, long-term access credentials that never expire unless manually rotated. These keys are frequently leaked by developers committing configuration files to public Git repositories, or compromised via malware on developer laptops. IAM Roles issue temporary, cryptographically signed session tokens via the AWS Security Token Service (STS) that expire automatically (typically after 1 hour). When an EC2 instance, Lambda function, or container is assigned an IAM Role, the AWS instance metadata service automatically injects and rotates temporary credentials transparently into the environment. Even if a memory dump or log leaks the temporary credential, it becomes useless once its 60-minute lifetime elapses.
5. Detail how Spot Instances achieve up to 90% cost savings compared to On-Demand compute. What architectural requirements must an application satisfy to run on Spot?
Answer: Cloud providers maintain massive fleets of physical servers to accommodate peak customer demand; during normal periods, substantial compute capacity sits idle. Cloud providers sell this surplus capacity as Spot Instances at steep discounts (up to 90% off On-Demand rates). However, if an On-Demand customer requires that capacity, the cloud provider issues a two-minute termination notice before abruptly shutting down the Spot VM. To safely run on Spot Instances, applications must be completely stateless, horizontally scalable, and fault-tolerant. Workloads must support checkpointing (saving state to S3 or a database), graceful shutdown within 120 seconds, and quick handoff to surviving nodes. Spot instances are ideal for queue worker pools, batch data processing (Spark/Hadoop), video transcoding, and continuous integration runners.