Admissions & Licensing Exams English 6 Interactive Flashcard Decks

Multi-Cloud & DevOps Architecture Guide: Microsoft Azure (AZ-104 & AZ-305), Google Cloud (PCA & PDE), Kubernetes (CKA / CKAD) & Terraform Associate

Comprehensive technical preparation guide for multi-cloud and DevOps engineering certifications: Microsoft Azure Administrator (AZ-104) & Solutions Architect Expert (AZ-305), Google Cloud Professional Cloud Architect (PCA) & Data Engineer (PDE), CNCF Kubernetes (CKA/CKAD), and HashiCorp Terraform Associate.

This technical reference synthesizes the official 2025/2026 certification blueprints, architectural decision trees, CLI troubleshooting runbooks, and worked exam scenarios across the six core multi-cloud and platform engineering certifications:

  1. Microsoft Azure Administrator (AZ-104) & Azure Solutions Architect Expert (AZ-305)
  2. Google Cloud Professional Cloud Architect (PCA) & Professional Data Engineer (PDE)
  3. CNCF Certified Kubernetes Administrator (CKA) & Application Developer (CKAD)
  4. HashiCorp Certified: Terraform Associate (003 / 004)

1. Official Certification Blueprint Comparison Matrix

Certification Exam Code / Body Format & Item Count Duration Passing Score Primary Exam Weighting & Core Focus
Azure Administrator Associate AZ-104 (Microsoft) 40–60 MCQs, multi-select, drag-and-drop & case studies 100 min 700 / 1000 Identity & Governance (20–25%), Storage (15–20%), Compute (20–25%), Virtual Networking (15–20%), Monitoring & Backup (10–15%)
Azure Solutions Architect Expert AZ-305 (Microsoft; requires active AZ-104) 40–60 MCQs + 1–2 multi-question case studies 100 min 700 / 1000 Identity/Governance/Monitoring (25–30%), Data Storage Solutions (20–25%), Business Continuity (15–20%), Infrastructure Solutions (30–35%)
Google Cloud Professional Cloud Architect PCA (Google Cloud) 50–60 MCQs & multi-select (includes 4 official case studies) 120 min Pass / Fail (~70% est.) Designing & Planning Cloud Architecture, Managing & Provisioning Infrastructure, Security & Compliance, Analyzing/Optimizing Processes, Managing Implementation, Ensuring Solution Operations
Google Cloud Professional Data Engineer PDE (Google Cloud) 50–60 MCQs & multi-select 120 min Pass / Fail (~70% est.) Designing Data Processing Systems, Ingesting & Processing Data (Pub/Sub, Dataflow, Dataproc), Storing Data (BigQuery, Bigtable, Spanner), Preparing & Using Data for Analysis/ML (Vertex AI)
Certified Kubernetes Administrator / App Developer CKA / CKAD (CNCF / Linux Foundation) 15–20 live hands-on CLI tasks in remote terminal 120 min 66% CKA: Troubleshooting (30%), Cluster Architecture/Install/Upgrade (25%), Services & Networking (20%), Workloads & Scheduling (15%), Storage (10%)
HashiCorp Certified: Terraform Associate 003 / 004 (HashiCorp) 57 MCQs, multi-answer, true/false & text-match 60 min ~70% IaC Concepts, Terraform Purpose & Core Workflow (init/plan/apply), Modules, State & Remote Backends, HCL Config/Refactoring (import/moved/removed/check), HCP Terraform & Sentinel

2. Microsoft Azure Architecture (AZ-104 & AZ-305)

2.1 Identity, Governance & Access Control (Microsoft Entra ID vs. Azure RBAC)

flowchart TD
    Tenant["Microsoft Entra ID Tenant (Directory Objects: Users, Groups, Apps, AUs)"]
    RootMG["Root Management Group (Up to 6 Nested Levels below Root)"]
    MG1["Corp-Prod Management Group"]
    Sub1["Production Subscription (Trusts Exactly 1 Entra Tenant)"]
    RG1["Resource Group (ReadOnly vs. CanNotDelete Locks; Tags Do Not Auto-Inherit)"]
    Res1["Azure Resources (VMs, Storage, AKS, SQL, Key Vault)"]

    Tenant -.->|"Federates Identity & Tokens"| RootMG
    RootMG --> MG1 --> Sub1 --> RG1 --> Res1
  • Microsoft Entra ID vs. Azure RBAC:
    • Entra ID Roles (Global Administrator, User Administrator, Application Administrator) operate at the tenant scope (or scoped to an Administrative Unit) to govern directory identities, groups, and enterprise applications.
    • Azure RBAC Roles (Owner, Contributor, Reader, User Access Administrator) operate across the Azure Resource Manager (ARM) hierarchy: Management Group -> Subscription -> Resource Group -> Resource.
    • Elevating Access: If all Subscription Owners leave an organization, a Microsoft Entra Global Administrator can toggle "Access management for Azure resources" in Entra ID Properties to temporarily receive the User Access Administrator role at the Root scope (/).
  • Dynamic Groups & Privileged Identity Management (PIM):
    • Dynamic User and Dynamic Device groups require Microsoft Entra ID P1 and evaluate attribute rules automatically (cannot mix Users and Devices in the same dynamic rule).
    • PIM requires Microsoft Entra ID P2 and converts standing administrative access into Eligible assignments requiring Just-In-Time (JIT) activation with MFA, business justification, maximum duration, and approval workflows.
  • Conditional Access Evaluation Logic:
    • Conditional Access policies have no numeric priority order; all matching policies are evaluated together using logical AND for Grant/Session controls, and any matching Block Access control always overrides Allow.
    • Report-only Mode logs the evaluation result of a Conditional Access policy in Entra Sign-in logs without prompting or blocking users.
  • Azure Policy vs. Azure RBAC vs. Resource Locks:
    • Azure Policy Evaluation Order: Disabled $\rightarrow$ Append / Modify $\rightarrow$ Deny $\rightarrow$ Audit $\rightarrow$ AuditIfNotExists / DeployIfNotExists (DINE).
    • Because Append and Modify run before Deny, an Append policy can inject a required tag on a new resource request so that a subsequent Deny policy passes.
    • Modify and DeployIfNotExists require a Managed Identity on the policy assignment and a Remediation Task to fix pre-existing non-compliant resources.
    • Resource Locks: CanNotDelete allows reading and modifying a resource but blocks deletion; ReadOnly blocks all ARM PUT, PATCH, DELETE, and POST operations—meaning a ReadOnly lock on a Storage Account blocks POST .../listKeys and breaks applications or Portal blades that fetch account keys!

2.2 Azure Storage Redundancy, Blob Tiers & Security (AZ-104 Domain 2)

Redundancy SKU Synchronous Copies (Primary Region) Asynchronous Copies (Paired Secondary Region) Durability (Annual) Outage Protection & Secondary Read Access
LRS (Locally Redundant) 3 copies in 1 datacenter 0 11 nines ($99.999999999%$) Rack / drive hardware failure within one facility
ZRS (Zone-Redundant) 3 copies across 3 Availability Zones 0 12 nines ($99.9999999999%$) Entire datacenter (Availability Zone) failure
GRS / RA-GRS 3 copies in 1 datacenter (LRS) 3 LRS copies in paired region 16 nines Regional disaster; RA-GRS exposes <account>-secondary.<service>.core.windows.net
GZRS / RA-GZRS 3 copies across 3 AZs (ZRS) 3 LRS copies in paired region 16 nines Combines zonal resilience + regional disaster recovery (RA-GZRS adds secondary read)
  • Blob Access Tiers & Minimum Retention:
    • Hot (0 days, online), Cool (30-day minimum, online), Cold (90-day minimum, online), Archive (180-day minimum, offline).
    • Reading an Archive blob requires rehydration (changing its tier to Hot/Cool or running Copy Blob to a new online blob) using Standard priority ($<15\text{ hours}$) or High priority ($<1\text{ hour}$ for blobs $<10\text{ GB}$).
  • SAS Tokens & Stored Access Policies:
    • User Delegation SAS (signed with Microsoft Entra ID credentials; supported for Blob and ADLS Gen2) is Microsoft's recommended best practice over Service SAS (single service, signed with account key) and Account SAS (multi-service/account-level, signed with account key).
    • To revoke a Service SAS immediately without rotating the storage account key, bind it to a container-level Stored Access Policy (max 5 per container) and modify or delete that policy.

2.3 Virtual Networking, Load Balancing & Cosmos DB (AZ-104 & AZ-305)

  • VNet Peering & Hub-and-Spoke Routing:
    • VNet Peering is non-transitive. To route Spoke-to-Spoke traffic through a Hub Azure Firewall or Network Virtual Appliance (NVA), enable IP Forwarding on the NVA, attach User-Defined Routes (UDRs) (0.0.0.0/0 or spoke prefixes $\rightarrow$ VirtualAppliance), and configure Allow Gateway Transit on the Hub peering link paired with Use Remote Gateways on each Spoke peering link.
  • NSG Evaluation Order:
    • Inbound: Subnet NSG $\rightarrow$ NIC NSG (must be allowed by both).
    • Outbound: NIC NSG $\rightarrow$ Subnet NSG (must be allowed by both).
  • Service Endpoints vs. Private Endpoints (Azure Private Link):
    • Service Endpoints keep the PaaS resource's public IP and cannot be used from on-premises over VPN/ExpressRoute.
    • Private Endpoints create a private NIC IP inside your VNet subnet (privatelink.<service> Private DNS Zone) and work seamlessly across Peering, VPN, and ExpressRoute while blocking data exfiltration.
  • Azure Load Balancing Decision Matrix:
    • Regional Layer 4 (TCP/UDP): Azure Load Balancer (Note: Standard Internal Load Balancers block default outbound SNAT unless an Azure NAT Gateway, Outbound Rule, or instance Public IP is attached).
    • Regional Layer 7 (HTTP/HTTPS + WAF): Azure Application Gateway.
    • Global Layer 7 (HTTP/HTTPS + Anycast CDN + WAF): Azure Front Door.
    • Global DNS Routing: Azure Traffic Manager.
  • Azure Cosmos DB Five Consistency Levels (Strongest to Weakest):
    1. Strong: Linearizable reads (RPO = 0), single-region writes only, $2\times$ read RU cost.
    2. Bounded Staleness: Reads lag behind writes by at most $K$ versions or $T$ time interval ($2\times$ read RU cost).
    3. Session (Default): Guarantees Read-Your-Writes, Monotonic Reads, and Monotonic Writes within a client session at $1\times$ read RU cost.
    4. Consistent Prefix: Readers never see out-of-order writes (if writes are A, B, C, readers see A, A,B, or A,B,C).
    5. Eventual: Lowest latency and highest throughput; replicas converge asynchronously without ordering guarantees.

3. Google Cloud Architecture & Data Engineering (PCA & PDE)

3.1 IAM, Networking & Database Selection (PCA)

  • GCP Resource Hierarchy & Policy Inheritance:
    • Organization -> Folders -> Projects -> Resources.
    • IAM Allow policies are additive down the hierarchy, but an IAM Deny policy at any ancestor level overrides any Allow role.
    • Organization Policy Service constraints (e.g., constraints/gcp.resourceLocations, constraints/iam.disableServiceAccountKeyCreation) restrict what configurations can exist regardless of IAM permissions.
    • Workload Identity Federation exchanges external OIDC/SAML/AWS/Azure tokens for short-lived Google STS credentials, eliminating exported Service Account JSON keys.
  • VPC Architecture:
    • Google Cloud VPCs are global, and Subnets are regional (spanning all zones in a region).
    • Shared VPC centralizes subnets and firewall management in a Host Project while workload teams deploy VMs and GKE clusters in attached Service Projects within the same Organization.
    • VPC Service Controls (VPC-SC) wrap multitenant Google APIs (bigquery.googleapis.com, storage.googleapis.com) inside a security perimeter to prevent data exfiltration.
    • Private Service Connect (PSC) exposes managed services (AlloyDB, Cloud SQL, Apigee) or cross-VPC services via a local consumer IP without CIDR overlap or VPC Peering limits.
Workload Requirement Recommended Google Cloud Database / Storage Service
Global relational OLTP needing horizontal write scaling, external consistency (TrueTime), & up to 99.999% SLA Cloud Spanner
High-performance regional PostgreSQL ($4\times$ faster OLTP, $100\times$ faster analytical queries via columnar engine) AlloyDB for PostgreSQL
Standard regional relational OLTP (MySQL, PostgreSQL, SQL Server up to 64 TB) Cloud SQL
Petabyte-scale NoSQL wide-column time-series / IoT / financial tick streams requiring $<10\text{ ms}$ latency Cloud Bigtable
Serverless document NoSQL for mobile/web apps with offline sync & ACID multi-document transactions Firestore
Petabyte-scale serverless enterprise data warehouse & SQL analytics / BI / ML (BQML) BigQuery
Unstructured object storage across Standard (0d), Nearline (30d), Coldline (90d), & Archive (365d, ms latency!) Cloud Storage

3.2 PCA Official Case Studies Quick Reference

  1. EHR Healthcare (Healthcare SaaS migrating from on-prem colocation):
    • Key Drivers: Reliable hybrid connectivity, HIPAA compliance, centralized logging/monitoring, Active Directory identity sync, containerized microservices.
    • Target Architecture: Redundant Dedicated Interconnect (99.99% SLA across 2 metro edge availability domains), Google Cloud Directory Sync (GCDS) + SAML 2.0 SSO, GKE with container-native load balancing (Zonal NEGs), Cloud Armor + IAP, Secret Manager, AlloyDB / Cloud SQL (HA), Memorystore for Redis, and BigQuery + Vertex AI for clinical predictions.
  2. Helicopter Racing League (HRL) (Global sports streaming & real-time race telemetry):
    • Key Drivers: Ultra-low-latency global video delivery, real-time sensor telemetry ingestion at remote tracks, real-time ML crowd/race predictions.
    • Target Architecture: Edge video upload to regional Cloud Storage $\rightarrow$ Transcoder API $\rightarrow$ Media CDN / Cloud CDN; live sensor telemetry into Cloud Pub/Sub $\rightarrow$ Cloud Dataflow $\rightarrow$ Cloud Bigtable (low-latency track telemetry) & BigQuery + Vertex AI (analytics and predictions).
  3. Mountkirk Games (Multi-platform real-time multiplayer gaming backend):
    • Key Drivers: Rapid global scaling for viral game launches, global transactional player profiles, handling delayed/out-of-order mobile telemetry over flaky cellular connections.
    • Target Architecture: Game backend on GKE (or Agones on GKE) fronted by Global External Load Balancer; global ACID player state in Cloud Spanner; streaming analytics via Cloud Pub/Sub $\rightarrow$ Cloud Dataflow (using event-time windows, watermarks, and allowed lateness triggers) $\rightarrow$ BigQuery.
  4. TerramEarth (20 million agricultural/mining vehicles: 200k cellular + 19.8M batch maintenance uploads):
    • Key Drivers: Dual streaming + batch ingestion, predictive maintenance ML, partner developer API portal.
    • Target Architecture: Cellular vehicles stream MQTT/HTTPS $\rightarrow$ Pub/Sub $\rightarrow$ Dataflow; unconnected vehicles upload compressed bundles at dealerships directly to Cloud Storage via Signed URLs (with resumable uploads) $\rightarrow$ Dataflow batch (reusing unified Apache Beam code) $\rightarrow$ BigQuery & Vertex AI; partner APIs managed via Apigee API Management.

3.3 Data Engineering on Google Cloud (PDE: BigQuery, Pub/Sub, Dataflow, Bigtable & Vertex AI)

flowchart LR
    Src1["Streaming IoT / App Events"] --> PS["Cloud Pub/Sub (Ordering Keys, DLQ, Exactly-Once)"]
    Src2["Batch Files / CDC (Datastream)"] --> GCS["Cloud Storage (Avro / Parquet)"]
    PS --> DF["Cloud Dataflow (Apache Beam: Windows, Watermarks, Triggers)"]
    GCS --> DF
    DF --> BT["Cloud Bigtable (Sub-10ms Wide-Column)"]
    DF --> BQ["BigQuery (Capacitor + Colossus + Dremel)"]
    BQ --> VAI["Vertex AI (BQML, AutoML, Feature Store, Model Monitoring)"]
  • BigQuery Storage & Query Optimization:
    • Under the Hood: Capacitor (columnar format) on Colossus (distributed storage) connected via Jupiter (petabit network) to Dremel (distributed execution slots).
    • Partitioning vs. Clustering: Partition a table on 1 column (ingestion time _PARTITIONTIME, DATE/TIMESTAMP/DATETIME column, or integer range) and Cluster on up to 4 columns ordered by most frequently filtered/aggregated first. Enable require_partition_filter = true to block accidental full-table scans.
    • Why LIMIT 10 Doesn't Save Money: SELECT * FROM table LIMIT 10 on an unclustered table still scans 100% of every column in the matching partitions! Use explicit columns, partition filters, --dry_run, or free bq head -n 10 / Console Preview.
    • Batch vs. External Formats: Compressed Avro loads fastest into native BigQuery tables (row blocks split cleanly in parallel); Parquet or ORC queries fastest in-place for BigLake external tables and BigQuery Omni (cross-cloud queries in AWS S3 / Azure ADLS Gen2).
    • Zero-Copy Data Security: Combine Authorized Views / Routines, Row-Level Security (CREATE ROW ACCESS POLICY), and Column-Level Security via Data Catalog Policy Tags with Dynamic Data Masking (SHA256, DEFAULT_MASKING_VALUE).
  • Apache Beam on Cloud Dataflow:
    • Three Window Types: Fixed Windows (tumbling non-overlapping intervals), Sliding Windows (overlapping intervals with duration + period), and Session Windows (per-key dynamic activity windows separated by an inactivity gap).
    • Event Time vs. Processing Time: Watermarks track event-time completeness; Triggers (AfterWatermark.pastEndOfWindow()) emit window panes at the watermark plus optional early speculative firings (AfterProcessingTime) and late firings (AfterPane) within allowedLateness.
    • Joins & Hot Keys: Broadcast small lookup tables into workers via Side Inputs; join massive keyed streams via CoGroupByKey; mitigate skewed keys using Combine.perKey().withHotKeyFanout().
  • Cloud Bigtable Row-Key Design:
    • Bigtable sorts rows lexicographically by a single Row Key across contiguous key-range tablets.
    • Anti-Pattern (Hotspotting): Never start a row key with a monotonically increasing timestamp (20261111...), sequential numeric ID, or low-cardinality attribute—100% of writes will hammer a single tablet on one node!
    • Best Practice: Design compound row keys starting with a well-distributed prefix followed by a reverse timestamp (device_type#device_id#(MAX_LONG - timestamp)) and diagnose hot tablets with Key Visualizer (note: adding nodes does not fix a single-tablet hotspot).

4. Kubernetes Administration & Application Development (CKA & CKAD)

4.1 Control Plane Upgrades (kubeadm) & etcd Backup/Restore Runbook

# 1. CKA kubeadm Minor Version Upgrade Workflow (e.g., v1.30.x -> v1.31.0)
kubectl cordon cp-node && kubectl drain cp-node --ignore-daemonsets --delete-emptydir-data
sudo apt-mark unhold kubeadm && sudo apt-get update && sudo apt-get install -y kubeadm=1.31.0-1.1 && sudo apt-mark hold kubeadm
sudo kubeadm upgrade plan
sudo kubeadm upgrade apply v1.31.0
sudo apt-mark unhold kubelet kubectl && sudo apt-get install -y kubelet=1.31.0-1.1 kubectl=1.31.0-1.1 && sudo apt-mark hold kubelet kubectl
sudo systemctl daemon-reload && sudo systemctl restart kubelet
kubectl uncordon cp-node
# On each worker node: drain -> upgrade kubeadm -> `sudo kubeadm upgrade node` -> upgrade kubelet -> restart kubelet -> uncordon

# 2. etcd Snapshot Backup & Restore (inspect /etc/kubernetes/manifests/etcd.yaml for exact cert paths!)
ETCDCTL_API=3 etcdctl --endpoints=https://127.0.0.1:2379 \
  --cacert=/etc/kubernetes/pki/etcd/ca.crt \
  --cert=/etc/kubernetes/pki/etcd/server.crt \
  --key=/etc/kubernetes/pki/etcd/server.key \
  snapshot save /opt/etcd-backup.db

# Restore into a NEW data directory and update hostPath in /etc/kubernetes/manifests/etcd.yaml:
etcdutl snapshot restore /opt/etcd-backup.db --data-dir=/var/lib/etcd-from-backup

4.2 Scheduling, Storage, Networking & Troubleshooting Reference

  • Scheduling Controls:
    • Taints & Tolerations: NoSchedule (blocks new pods), PreferNoSchedule (soft block), NoExecute (blocks new pods AND evicts running pods unless tolerated; tolerationSeconds bounds survival time). Remove a taint with a trailing minus: kubectl taint nodes node1 key=val:NoSchedule-.
    • Node Affinity: requiredDuringSchedulingIgnoredDuringExecution (hard filter) vs. preferredDuringSchedulingIgnoredDuringExecution (weighted score 1..100).
    • Topology Spread Constraints: maxSkew sets max Pod difference across topologyKey domains (topology.kubernetes.io/zone) with whenUnsatisfiable: DoNotSchedule | ScheduleAnyway.
  • Storage (PV / PVC / StorageClass):
    • Access Modes: ReadWriteOnce (RWO — 1 node), ReadOnlyMany (ROX — many nodes read-only), ReadWriteMany (RWX — many nodes read-write), ReadWriteOncePod (RWOP — 1 single Pod).
    • Volume Binding Mode: Use WaitForFirstConsumer on zonal cloud block storage so the PV is created in the exact Availability Zone selected by the scheduler for the Pod.
  • Networking (Service, NetworkPolicy, Gateway API):
    • NetworkPolicy AND vs. OR Trap: Under ingress.from or egress.to, putting namespaceSelector and podSelector in the same list item (one -) means logical AND; putting them in separate list items (two - dashes) means logical OR!
    • Default Deny Egress: Always remember to allow Egress on UDP/TCP port 53 to kube-system CoreDNS pods!
    • Gateway API: Role-oriented successor to Ingress comprising GatewayClass (infra provider) $\rightarrow$ Gateway (cluster operator listeners/TLS) $\rightarrow$ HTTPRoute / GRPCRoute (app developer routing, header matching, and weighted canary splitting), with cross-namespace links secured by ReferenceGrant.
  • Systematic CKA Troubleshooting Checklist:
    1. Node NotReady: kubectl describe node <node> $\rightarrow$ SSH to node $\rightarrow$ systemctl status kubelet $\rightarrow$ journalctl -u kubelet -xe (check /var/lib/kubelet/config.yaml, 10-kubeadm.conf, expired certs, or stopped containerd: systemctl restart containerd && systemctl restart kubelet). Also verify CNI configs in /etc/cni/net.d/ and binaries in /opt/cni/bin/.
    2. Control Plane Down (kubectl connection refused): Check static Pod manifests in /etc/kubernetes/manifests/ (kube-apiserver.yaml, etcd.yaml, kube-controller-manager.yaml, kube-scheduler.yaml) and inspect runtime containers via crictl ps -a and crictl logs <id> (or /var/log/pods/).
    3. Service Unreachable: Run kubectl get endpointslices -l kubernetes.io/service-name=<svc> (or kubectl get ep <svc>). If empty, fix the Service's spec.selector to match Pod labels or fix a failing readinessProbe. Verify port vs. container targetPort and inspect NetworkPolicy objects.

5. HashiCorp Certified: Terraform Associate (003 / 004)

5.1 Core Workflow, State Refactoring & HCL Meta-Arguments

Terraform Feature / Command Technical Behavior & Exam Nuances (003 & 004)
terraform init Downloads providers/modules and initializes the backend. Use -upgrade to update .terraform.lock.hcl, -migrate-state to copy state to a new backend, or -reconfigure to ignore prior state.
terraform validate vs. plan validate checks HCL syntax and types offline without accessing state or cloud APIs; plan refreshes state against real cloud APIs and computes the desired diff.
.terraform.lock.hcl Locks exact versions and SHA-256 hashes of Providers only (never modules). Always commit .terraform.lock.hcl to Git; never commit .terraform/ or terraform.tfstate.
count vs. for_each count indexes by position ([0], [1]); for_each accepts a map or set(string) and indexes by stable key (["prod"]), preventing cascading recreations when removing list items.
lifecycle Block create_before_destroy = true, prevent_destroy = true (blocks destroy plans unless the resource block is deleted from HCL), ignore_changes = [tags], replace_triggered_by = [...].
import, moved & removed Declarative HCL blocks that replace imperative terraform import, terraform state mv, and terraform state rm. Use terraform plan -generate-config-out=gen.tf with import blocks.
terraform apply -replace Replaces the deprecated terraform taint command so resource replacement happens atomically inside a single reviewed plan/apply run.
check Blocks & terraform test check blocks perform non-blocking continuous post-apply assertions (warnings only), whereas validation/precondition/postcondition block failed runs. terraform test runs .tftest.hcl unit (mock_provider) and integration tests.
sensitive = true vs. ephemeral sensitive = true only redacts CLI/UI output—plaintext values still persist in terraform.tfstate! In Terraform 1.10+ (004), ephemeral blocks and write-only (_wo) attributes never write to state.
HCP Terraform & Sentinel / OPA Workspaces support Remote, Local, and Agent execution modes. Sentinel (advisory, soft-mandatory, hard-mandatory) and OPA policies evaluate between plan and apply.
  • Variable Precedence Order (Lowest $\rightarrow$ Highest Priority):
    1. default value in the variable declaration
    2. TF_VAR_<name> environment variables
    3. terraform.tfvars file
    4. terraform.tfvars.json file
    5. *.auto.tfvars or *.auto.tfvars.json files (processed in lexical/alphabetical order)
    6. -var and -var-file flags on the CLI (highest priority; last flag wins)

5.2 Declarative Refactoring & Testing HCL Snippets (Exam 004)

# 1. Config-Driven Import (Terraform 1.5+) & Moved Block (Terraform 1.1+)
import {
  to = azurerm_resource_group.core
  id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-core-prod"
}

moved {
  from = azurerm_linux_virtual_machine.vm[0]
  to   = azurerm_linux_virtual_machine.vm["web-primary"]
}

# 2. Removing a Resource from State Without Destroying the Cloud Object (Terraform 1.7+)
removed {
  from = google_storage_bucket.legacy_archive
  lifecycle {
    destroy = false
  }
}

# 3. Non-Blocking Post-Apply Health Assertion (check block)
check "api_gateway_live" {
  data "http" "healthz" {
    url = "https://${azurerm_linux_web_app.api.default_hostname}/healthz"
  }
  assert {
    condition     = data.http.healthz.status_code == 200
    error_message = "API health endpoint returned ${data.http.healthz.status_code} instead of 200."
  }
}

6. Multi-Cloud Service Equivalence Matrix (Azure vs. Google Cloud)

Architectural Capability Microsoft Azure (AZ-104 / AZ-305) Google Cloud (PCA / PDE) Key Exam Distinction
Workforce & Cloud Identity Microsoft Entra ID + Azure RBAC Cloud Identity / Google Workspace + Cloud IAM Azure separates Entra directory roles from ARM RBAC; GCP unifies IAM across the 4-level hierarchy.
Keyless External Federation Workload Identity Federation (Federated Credentials) Workload Identity Federation (STS OIDC/SAML/AWS) Both eliminate exported client secrets / JSON service account keys for CI/CD and multi-cloud calls.
Organization Guardrails Azure Management Groups + Azure Policy GCP Folders/Organization + Organization Policy Service Azure Policy evaluates Disabled -> Append/Modify -> Deny -> Audit -> DINE; GCP uses boolean/list constraints.
Virtual Network Scope Regional VNet + Regional Subnets Global VPC + Regional Subnets GCP VPCs span all regions natively without peering; Azure VNets require Global VNet Peering across regions.
Private PaaS Connectivity Azure Private Endpoint (Private Link) Private Service Connect (PSC) & VPC Service Controls Both assign a private consumer IP; GCP adds VPC Service Controls perimeters to stop API data exfiltration.
Dedicated Hybrid Links Azure ExpressRoute (50 Mbps–100 Gbps) + FastPath Dedicated (10G/100G) & Partner Interconnect (50M–50G) Both are private but unencrypted at Layer 3 by default unless paired with IPsec VPN / MACsec.
Global Layer 7 Load Balancing Azure Front Door + Azure WAF Global External Application Load Balancer + Cloud Armor Both terminate HTTP(S) at global anycast edge POPs with integrated WAF and CDN caching.
Serverless Containers Azure Container Apps (ACA — KEDA + Dapr + Envoy) Google Cloud Run (Services & Jobs) Both scale to zero; ACA includes built-in KEDA event scalers and Dapr sidecar integration.
Managed Kubernetes Azure Kubernetes Service (AKS / AKS Automatic) Google Kubernetes Engine (GKE Standard & GKE Autopilot) GKE Autopilot bills strictly per Pod resource requests and manages all worker nodes automatically.
Global Distributed DB Azure Cosmos DB (5 consistency levels, multi-region writes) Cloud Spanner (Relational ACID + TrueTime) & Bigtable (Wide-column) Cosmos DB is multi-model NoSQL (5 consistency levels); Cloud Spanner is global ANSI SQL relational.
Event Streaming & Messaging Event Grid (events), Event Hubs (streaming), Service Bus (enterprise) Eventarc (events) & Cloud Pub/Sub (unified messaging/streaming) GCP unifies enterprise messaging and streaming in Cloud Pub/Sub (with Ordering Keys and DLQs).

7. 20 Worked Multi-Cloud & DevOps Exam Scenarios

  1. Scenario 1 (AZ-104 — Storage Lock Trap): An administrator applies a ReadOnly lock to a production Resource Group containing an Azure Storage Account and a Virtual Machine. Soon after, a web app authenticating with Entra ID works, but a legacy function using listKeys fails with ScopeLocked. Why?
    • Solution: A ReadOnly lock blocks all ARM POST operations. Because Microsoft.Storage/storageAccounts/listKeys/action is an HTTP POST request on the ARM control plane, ReadOnly blocks it. Replace the ReadOnly lock with a CanNotDelete lock or migrate the function to a Managed Identity using DataActions RBAC.
  2. Scenario 2 (AZ-305 — Multi-Region Cosmos DB RPO=0): A financial platform requires zero data loss (RPO = 0) across eastus and westus in Azure Cosmos DB while enabling Multi-Region Writes. Is this supported?
    • Solution: No. Strong consistency (RPO = 0) cannot be combined with Multi-Region Writes in Cosmos DB. Use Single-Region Writes with Strong consistency (and automatic regional failover) or Multi-Region Writes with Bounded Staleness / Session consistency.
  3. Scenario 3 (AZ-104 — App Service Outbound vs. Inbound Private Networking): An Azure App Service must query an Azure SQL Database over a Private Endpoint (10.2.1.4) and must also block all inbound public internet traffic to the App Service itself.
    • Solution: Configure Regional VNet Integration on the App Service (into a delegated subnet) for outbound private routing to the SQL Private Endpoint, and create a Private Endpoint on the App Service for inbound private access.
  4. Scenario 4 (AZ-104 — Revoking an Ad-Hoc SAS Token): A contractor was given a Service SAS URI signed directly with the Storage Account key (without a Stored Access Policy). How can you revoke it immediately without breaking other SAS tokens signed by the other key?
    • Solution: Because the SAS is not bound to a Stored Access Policy, the only way to revoke it immediately is to rotate (regenerate) the specific Storage Account key (key1 or key2) used to sign it. For future tokens, bind them to a container-level Stored Access Policy.
  5. Scenario 5 (AZ-305 — SQL Server Lift-and-Shift with SQL Agent): An enterprise is migrating an on-premises SQL Server database that relies heavily on SQL Server Agent jobs, cross-database queries, Service Broker, and Database Mail, and wants a managed PaaS solution without OS patching.
    • Solution: Choose Azure SQL Managed Instance (SQL MI), which provides near-100% instance-level compatibility inside a dedicated VNet subnet.
  6. Scenario 6 (GCP PCA — Mountkirk Games Late Data & Global State): Mountkirk Games needs global ACID player inventory updates across continents and accurate session-level analytics even when mobile players upload match logs hours late after riding through subway tunnels.
    • Solution: Store transactional player inventory in Cloud Spanner (TrueTime external consistency) and ingest mobile game events through Cloud Pub/Sub into Cloud Dataflow using Apache Beam Session Windows on Event Time, Watermarks, and allowedLateness triggers writing to BigQuery.
  7. Scenario 7 (GCP PCA — TerramEarth Dealer Batch Uploads): TerramEarth's 19.8 million unconnected tractors have their maintenance logs downloaded at independent rural dealerships that do not have Google Cloud IAM accounts. How should dealership laptops upload 5 GB compressed sensor bundles?
    • Solution: Have an authenticated TerramEarth backend generate short-lived Cloud Storage Signed URLs configured for resumable PUT uploads, allowing dealer devices to upload directly to Cloud Storage edge endpoints.
  8. Scenario 8 (GCP PCA — Preventing BigQuery Exfiltration): A CISO worries that a malicious insider with roles/bigquery.dataViewer on a sensitive project could run SELECT * and copy rows into a BigQuery dataset in their personal GCP account.
    • Solution: Wrap the sensitive GCP Project inside a VPC Service Controls (VPC-SC) security perimeter restricting bigquery.googleapis.com and storage.googleapis.com, which blocks cross-perimeter data copies even when the user holds valid IAM permissions.
  9. Scenario 9 (GCP PDE — Bigtable Write Hotspotting): A telemetry team designs a Cloud Bigtable table using row key 20261111_153000#sensor_id. Write throughput plateaus at 12,000 ops/sec even after scaling the cluster from 3 nodes to 15 nodes. Why?
    • Solution: Leading with a monotonically increasing timestamp routes 100% of writes to the last lexicographical tablet on a single Bigtable node. Redesign the row key to sensor_type#sensor_id#reverse_timestamp and verify distribution in Key Visualizer.
  10. Scenario 10 (GCP PDE — Ephemeral Spark Modernization): A company runs a 50-node on-premises Hadoop/Spark cluster 24/7 for nightly 3-hour batch ETL jobs, storing 200 TB in local HDFS. How should they re-architect on Google Cloud?
    • Solution: Migrate persistent HDFS data to Google Cloud Storage (gs://) using the Cloud Storage connector and run job-scoped ephemeral Cloud Dataproc clusters (or Dataproc Serverless for Spark) orchestrated by Cloud Composer, deleting clusters immediately after job completion.
  11. Scenario 11 (GCP PDE — Reversible Credit Card Tokenization): A legacy payment processor requires credit card numbers stored in BigQuery to remain 16 numeric digits (0-9) for schema validation, and fraud investigators must be able to decrypt specific records with KMS audit logging.
    • Solution: Use Cloud Data Loss Prevention (Sensitive Data Protection) with Format-Preserving Encryption (CryptoReplaceFfxFpeConfig) wrapped by a Cloud KMS key.
  12. Scenario 12 (CKA — NetworkPolicy YAML Indentation Trap): A CKAD candidate writes an Ingress NetworkPolicy with - namespaceSelector: {matchLabels: {env: prod}} followed on the next line by - podSelector: {matchLabels: {role: frontend}}. Suddenly, every Pod in env: prod can reach the database! Why?
    • Solution: Using two - list items creates logical OR (any Pod in namespace env=prod OR any Pod with role=frontend in the target namespace). Removing the second - so both selectors sit inside the same list item enforces logical AND.
  13. Scenario 13 (CKA — Broken Control Plane Static Pod): After editing /etc/kubernetes/manifests/kube-apiserver.yaml to enable encryption at rest, kubectl get pods returns The connection to the server 10.0.0.10:6443 was refused. How do you debug and fix it?
    • Solution: Because kube-apiserver is down, kubectl cannot work. SSH to the control plane node, run sudo crictl ps -a and sudo crictl logs <container-id> (or check /var/log/pods/kube-system_kube-apiserver*), and fix the YAML indentation or missing hostPath volumeMount in /etc/kubernetes/manifests/kube-apiserver.yaml.
  14. Scenario 14 (CKAD — ConfigMap Environment Variable Not Updating): An engineer updates a ConfigMap via kubectl edit cm app-config, and a Pod mounting the ConfigMap at /etc/config updates within a minute, but another Pod reading APP_MODE via envFrom.configMapRef still shows the old value.
    • Solution: Kubernetes never hot-reloads environment variables (env/envFrom) or subPath volume mounts inside running containers. Run kubectl rollout restart deployment/<name> to recreate the Pods with the new environment variables.
  15. Scenario 15 (CKA — Zonal PV Scheduling Deadlock): A Pod requesting a dynamically provisioned AWS EBS / GCP Persistent Disk PVC stays stuck in Pending with volume node affinity conflict because the PV was created in zone-a while the Pod's nodeSelector requires zone-b.
    • Solution: Recreate the StorageClass with volumeBindingMode: WaitForFirstConsumer so dynamic PV provisioning waits until the scheduler selects a node in zone-b.
  16. Scenario 16 (Terraform Associate — Removing List Items Without Recreating Resources): Three VMs are provisioned using count = length(var.vm_names). When the first element of var.vm_names is removed, terraform plan proposes replacing or modifying all remaining VMs.
    • Solution: Refactor the resource from count to for_each = toset(var.vm_names) and add moved blocks (from = azurerm_linux_virtual_machine.vm[1], to = azurerm_linux_virtual_machine.vm["app-2"]) so existing state keys migrate cleanly without destroying running VMs.
  17. Scenario 17 (Terraform Associate — Sensitive Variable Exposure): A security engineer marks variable "db_password" { sensitive = true } and runs terraform apply using a local backend. Is the database password encrypted inside terraform.tfstate?
    • Solution: No! sensitive = true only masks CLI terminal and HCP UI log output; terraform.tfstate still stores the value in plaintext unless using an encrypted Remote Backend or Terraform 1.10+ ephemeral variables and write-only (_wo) resource attributes.
  18. Scenario 18 (Terraform Associate — Registry vs. Git Module Versioning): A developer writes module "vpc" { source = "git::https://example.com/vpc.git" version = "~> 2.0" } and terraform init fails with an unsupported argument error. Why?
    • Solution: The version argument inside a module block is only supported for modules loaded from a public or private Terraform Registry. For Git sources, remove version and pin the tag/branch in the URL query string: source = "git::https://example.com/vpc.git?ref=v2.0.0".
  19. Scenario 19 (Terraform Associate — Drift Inspection Without Overwriting State): An operator suspects someone manually altered firewall rules in the cloud console and wants to compare real cloud resources against terraform.tfstate without modifying infrastructure.
    • Solution: Run terraform plan -refresh-only (or terraform apply -refresh-only to interactively accept syncing the state file to match real-world drift), which replaces the deprecated, unsafe terraform refresh command.
  20. Scenario 20 (HCP Terraform — Enforcing Cost & Security Guardrails): An organization wants to automatically block any Terraform run whose estimated monthly cost increase exceeds $1,000, with no ability for workspace owners to bypass the block.
    • Solution: Configure a Sentinel policy at the hard-mandatory enforcement level (or a mandatory OPA policy) in HCP Terraform, which executes automatically after terraform plan and Cost Estimation complete, before terraform apply.

8. High-Yield Multi-Cloud CLI Cheat Sheet (az, gcloud, kubectl, terraform)

# Azure CLI (AZ-104 / AZ-305)
az account set --subscription "<sub-id>"
az role assignment create --assignee "<principal-id>" --role "Contributor" --scope "/subscriptions/<sub-id>/resourceGroups/<rg>"
az storage blob copy start --source-uri "<src-sas>" --destination-blob "report.pdf" --destination-container "hot" --account-name "<acct>" --rehydrate-priority High
az network watcher test-ip-flow --vm "<vm-name>" --resource-group "<rg>" --direction Inbound --protocol TCP --local 10.0.1.4:443 --remote 203.0.113.10:54321

# Google Cloud CLI & BigQuery CLI (PCA / PDE)
gcloud compute ssh "<vm-name>" --zone="us-central1-a" --tunnel-through-iap
gcloud compute networks subnets expand-ip-range "<subnet>" --region="us-central1" --prefix-length=20
bq query --use_legacy_sql=false --dry_run 'SELECT customer_id, SUM(amount) FROM `prod.sales` WHERE dt = "2026-11-11" GROUP BY 1'
bq cp prod.orders@-3600000 prod.orders_restored

# Kubernetes CLI (CKA / CKAD)
kubectl auth can-i create deployments --as=system:serviceaccount:dev:ci-bot -n dev
kubectl create networkpolicy allow-dns --namespace=prod --dry-run=client -o yaml
kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{.status.phase}{"\n"}{end}'

# Terraform CLI (003 / 004)
terraform init -migrate-state
terraform plan -generate-config-out=generated_resources.tf
terraform apply -replace="azurerm_linux_virtual_machine.web[0]"
terraform plan -refresh-only

9. Rapid-Fire Exam Day Checklist

  • AZ-104 / AZ-305: Verify Azure Policy order (Disabled -> Append/Modify -> Deny -> Audit -> DINE), NSG evaluation (Inbound: Subnet -> NIC; Outbound: NIC -> Subnet), VNet Peering gateway sharing (Allow gateway transit on Hub + Use remote gateways on Spoke), and Storage tiers (Hot 0d, Cool 30d, Cold 90d, Archive 180d offline).
  • GCP PCA / PDE: Remember Storage classes all have millisecond latency (even Archive 365d!), VPCs are global & subnets are regional, Workload Identity Federation replaces JSON keys, BigQuery supports 1 partition column + up to 4 clustering columns, and Bigtable row keys must never start with raw timestamps.
  • CKA / CKAD: Set up shell aliases (export do="--dry-run=client -o yaml"), always check /etc/kubernetes/manifests/ and journalctl -u kubelet -xe on broken nodes, include UDP/TCP 53 Egress to CoreDNS on egress NetworkPolicies, and use WaitForFirstConsumer on zonal StorageClasses.
  • Terraform Associate: Commit .terraform.lock.hcl (locks providers only), never commit terraform.tfstate, remember sensitive = true does not encrypt values in state, use terraform apply -replace instead of taint, and remember Sentinel/OPA runs between plan and apply.