Full Stack Engineering Day 5
Cloud & AI Agents Masterclass
Full Stack Engineering · Day 5

Cloud & AI Agents Masterclass

Understand what cloud is, where every major service belongs, how to design a secure solution, and how AWS, Microsoft and Google run production AI agents.

Cloud fundamentalsAWS · Azure · Google CloudArchitectureSecurityFinOpsAI agentsMCP & SDKs
01

Cloud turned infrastructure into an on-demand utility.

The revolution was programmable capacity: provision in minutes, pay for use, scale automatically and discard safely.

Evolution from data centers to AI-native cloud

Data center

Buy servers, predict peak demand and operate everything.

Virtualization

Share hardware across isolated virtual machines.

Public cloud

Rent compute, storage, networks and managed platforms through APIs.

Cloud native

Containers, serverless, automation, observability and managed AI.

Cloud is an operating model: self-service, network access, shared pools, rapid elasticity and measured usage.
02

Think in layers, locations and responsibility.

Cloud mental model

Service model

IaaS: control the OS. PaaS: deploy code. Serverless: run on demand. SaaS: use the application.

Deployment model

Public, private, hybrid or multi-cloud—chosen because of real constraints.

Location model

A region contains isolated availability zones; edge locations serve users nearby.

Managed does not mean responsibility-free. Providers secure the cloud; customers secure identities, configuration, applications and data in the cloud.
03

Every cloud catalog is built from familiar categories.

Compute

VMs, containers, Kubernetes, functions and app platforms.

Data

Object storage, relational, NoSQL, cache, warehouse and streaming.

Network

Virtual networks, DNS, load balancers, gateways, CDN and private links.

Platform

Identity, secrets, monitoring, messaging, DevOps, analytics and AI.

NeedStart withReason
Conventional or legacy serverVirtual machineOS-level control
Portable web/API serviceManaged containersContainer portability with less operations
Bursty event-driven codeFunction/serverlessScale to demand
Transactional system of recordManaged relational DBConstraints and transactions
Files, media, backups, lakeObject storageDurable blobs at massive scale
Decouple servicesQueue or pub/subSurvive spikes and temporary failures
04

Cloud is an ecosystem, not a rack of rented servers.

A successful platform joins governance, identity, networking, compute, data, delivery and operations into one repeatable operating model.

The complete cloud ecosystem from organization to operations
LayerCore questionCapabilities
Organization & governanceWho owns the platform and which rules apply?Account hierarchy, standards, policy, compliance and risk
Identity & securityWho or what can access which resource?Federation, MFA, roles, workload identity, secrets and threat detection
Network & edgeHow do users and services communicate?VPC/VNet, DNS, CDN, WAF, load balancing and private endpoints
Compute & integrationWhere does code run and how is work connected?VMs, containers, functions, APIs, queues and event buses
Data & AIWhere is truth stored and intelligence created?Databases, object stores, warehouses, models and vector search
Operations & FinOpsHow do we know it works and what it costs?Telemetry, SLOs, incidents, budgets and unit economics

Platform engineering

Paved roads, reusable IaC, approved images, golden CI/CD and a service catalog give teams safe self-service.

Partner ecosystem

Marketplaces, SaaS integrations, partners, training, certification and support affect adoption.

Data gravity

Existing identity, data and skills often matter more than a small difference in compute price.

Evaluate the complete operating ecosystem—not merely the service catalog.
05

Learn categories first; translate product names second.

AWS Azure Google Cloud equivalents
CategoryAWSMicrosoft AzureGoogle Cloud
Virtual machinesEC2Virtual MachinesCompute Engine
Object storageS3Blob StorageCloud Storage
KubernetesEKSAKSGKE
FunctionsLambdaAzure FunctionsCloud Run functions
Managed containersECS/Fargate, App RunnerContainer AppsCloud Run
Relational DBRDS/AuroraAzure SQLCloud SQL/AlloyDB
NoSQLDynamoDBCosmos DBFirestore/Bigtable
WarehouseRedshiftFabric/SynapseBigQuery
MessagingSQS/SNS/EventBridgeService Bus/Event GridPub/Sub/Eventarc
SecretsSecrets ManagerKey VaultSecret Manager
MonitoringCloudWatch/X-RayAzure Monitor/App InsightsCloud Monitoring/Trace
Foundation modelsAmazon BedrockMicrosoft FoundryVertex AI
Equivalent does not mean identical. Compare regions, quotas, identity, integration, operating effort, latency and total cost.
05

Choose the constraint, then the platform, then the service.

1. Constraints

Residency, compliance, latency, availability, contracts and team expertise.

2. Workload

Traffic shape, state, runtime, batch versus online, models and data gravity.

3. Operations

Prefer the highest-level managed service that meets the requirement safely.

Context signalNatural starting point—not a rule
Large existing AWS estateAWS
Microsoft 365, Entra, .NET and Azure dataMicrosoft Azure
BigQuery, data/AI, Kubernetes and Google ecosystemGoogle Cloud
Small team and uncertain trafficManaged app/container platform + managed database
Regulated workloadThe provider meeting residency, evidence, controls and support requirements
Multi-cloud duplicates identity, networking, observability and skills. Use it only for a concrete business or risk reason.
06

Architect from user journey to failure modes.

Secure reference cloud architecture
UsersDNS + CDN + WAFGateway / load balancerStateless appDB + cache + object store

Synchronous

Keep user-facing requests short, bounded and observable.

Asynchronous

Queue durable work; make consumers idempotent and retry-safe.

Control plane

IaC, CI/CD, secrets, logs, metrics, traces, alerts and audit.

Draw trust boundaries, data flows, dependencies and recovery paths—not only product icons.
07

Design for failure, scale and cost together.

Reliability

Multi-zone deployment, health checks, timeouts, backups and tested recovery.

Performance

Measure latency, cache deliberately, batch calls and remove network hops.

Scale

Stateless compute, queues, partitioned work and backpressure.

Cost

Tag resources, budget, right-size, autoscale and delete idle environments.

QuestionArtifact
How much data can we lose?Recovery Point Objective (RPO)
How long can recovery take?Recovery Time Objective (RTO)
What does healthy mean?SLIs and SLOs
What if a dependency slows?Timeout, circuit breaker, queue, graceful degradation
Who owns the bill?Tags, budgets, dashboards and unit economics
08

Security is defense in depth, starting with identity.

Cloud security defense in depth

Identity

Short-lived credentials, least privilege, MFA and workload identities.

Data

Classify, encrypt, restrict, rotate secrets and audit access.

Detection

Central logs, configuration policy, threat signals and incident playbooks.

For AI systems, retrieved documents and tool responses are untrusted input. Defend against prompt injection, excessive agency, leakage and unsafe calls.
Agent riskPractical control
Destructive tool callAllowlist, scoped identity, policy check and human approval
Sensitive data in promptsClassification, redaction, access-aware retrieval and retention
Prompt injection from contentTreat content as data; validate tool arguments
Unexpected behaviorEvals, traces, versioned prompts, canary and rollback
10

IAM separates identity proof from permission.

Authentication proves who or what made the request. Authorization decides whether that principal may perform an action on a resource under the current conditions.

IAM request journey from human or workload to audit log
ConceptMeaningExample
IdentityHuman or workload known to the systemAlice; orders-api
PrincipalAuthenticated identity making this requestAlice's temporary role session
GroupAdministrative collection of peopleFinanceTeam
RoleAssumable set of permissionsBillingReadOnly
Workload identityNon-human identity without embedded keysManaged identity/service account
PolicyRules over principal, action, resource and conditionsAllow read of one secret

Humans

Federate from the company identity provider, require MFA, assume temporary roles and use privileged-access workflows.

Workloads

Attach a managed identity, service account or role to the runtime. Never bake keys into code or images.

Audit

Record identity, session, requested action, target, decision, source and result in protected logs.

RequestAuthenticatePrincipalAuthorizeResourceAudit
11

IAM evaluates principal, action, resource and conditions.

IAM policy evaluation and least privilege feedback loop

Explicit deny

Any applicable explicit deny overrides an allow.

Explicit allow

With no deny, at least one applicable allow must match.

Implicit deny

If no policy grants access, the default decision is deny.

Effective permission is an intersection

Organization guardrails, resource policies, identity policies, permission boundaries and session policies combine to determine the maximum permission. Conditions can restrict network, device, time, region, tags, authentication strength and resource attributes.

Bad patternBetter design
Shared administrator accountNamed identity + federation + temporary privileged role
Long-lived key in CIOIDC/workload federation with short-lived token
Action:* Resource:*Exact actions on tagged or named resources
Direct user permissionsGroups and roles aligned to job functions
Permanent production accessJust-in-time, approved and expiring access
Least privilege is a loop: start narrow → observe legitimate denials → add the exact permission → review usage → expire what is no longer needed.
12

Build the secure foundation before deploying workloads.

Secure landing zone and Zero Trust architecture

A landing zone establishes account structure, identity federation, networking, centralized logging, encryption, budgets and policy guardrails before application teams deploy.

Verify explicitly

Evaluate identity, device, workload, location and risk for every request.

Least privilege

Use short-lived, just-in-time and just-enough access.

Assume breach

Segment networks, protect logs, limit blast radius and rehearse containment.

BoundaryPurpose
Organization / tenantCompany-wide governance, billing and policy
Management group / organizational unitPolicy inheritance by business purpose
Account / subscription / projectWorkload, billing and blast-radius isolation
Production / non-production / security / shared servicesSeparate duties and trust zones
Resource tags and foldersOwnership, environment, data class and cost attribution
Give each agent runtime and tool its own minimum identity. Never turn a model-facing identity into an all-powerful application identity.
13

Cloud is an API; the console is only one client.

Ways to access cloud

Explore

Console and Cloud Shell help humans discover and diagnose.

Automate

CLI, SDK and REST let scripts and applications call services.

Reproduce

Terraform and native IaC make infrastructure reviewable.

Operate

CI/CD uses workload identity to deploy approved changes.

Check current cloud identity
# AWS
aws sts get-caller-identity

# Microsoft Azure
az account show

# Google Cloud
gcloud auth list
gcloud config get-value project
Python SDK: upload to Amazon S3
import boto3

s3 = boto3.client("s3")
s3.upload_file("report.pdf", "workshop-files", "reports/report.pdf")
url = s3.generate_presigned_url(
    "get_object",
    Params={"Bucket": "workshop-files", "Key": "reports/report.pdf"},
    ExpiresIn=900,
)
print(url)
Infrastructure as code
resource "aws_s3_bucket" "workshop" {
  bucket = "company-workshop-files"
  tags = { environment = "training", owner = "platform-team" }
}

resource "aws_s3_bucket_versioning" "workshop" {
  bucket = aws_s3_bucket.workshop.id
  versioning_configuration { status = "Enabled" }
}
MCP standardizes how an agent discovers and invokes tools. It does not replace authentication, authorization, policy or audit.
10

A model predicts; an agent pursues a goal through tools and state.

Model

Understands context and proposes the next action.

Instructions

Define role, boundary, output and escalation.

Tools

Read or change the world through APIs and enterprise systems.

Loop

Observe → reason → act → inspect → stop, continue or ask.

Framework-neutral agent loop
state = {"goal": user_request, "messages": []}

while not state.get("done"):
    decision = model.decide(state, tools=allowed_tools)
    if decision.requires_approval:
        decision = human.review(decision)
    result = tools.call(decision.tool, decision.arguments)
    state["messages"].append({"decision": decision, "result": result})
    state["done"] = policy.stop(state)

return model.answer(state)
15

Use the least autonomous option that solves the problem.

Decision tree for choosing an AI agent implementation option
NeedStart withYou operate
One request and responseModel APIPrompt, validation and call
Fixed predictable stepsWorkflow/orchestratorLogic, retries and integrations
Bounded tool-using assistantManaged agent serviceInstructions, tools, data and policy
Long-running/background agentManaged agent runtimeAgent code, deployment and evaluation
Coordinated specialistsCode-first multi-agent framework + runtimeTopology, state, handoffs and failures
Existing enterprise suiteSaaS copilot/studioConfiguration, connectors and governance

The autonomy ladder

AnswerRetrieveRecommendAct with approvalAct within policyCoordinate
Move upward only when the business value of autonomy exceeds the added security, evaluation and operational burden.

Runtime

Does it need streaming, long tasks, background work, durable state or isolation?

Interoperability

Are tools functions, REST APIs, MCP servers, enterprise connectors or other agents?

Control

Can identity propagate? Can traces and evals export? Can models and tools be versioned independently?

16

A production agent is a system, not a prompt.

Production AI agent stack

Runtime

Isolation, streaming, long-running work, scale, retries and deployment.

Context

Session state, memory, retrieval, files and enterprise knowledge.

Control

Identity, policy, approvals, guardrails, traces, evaluations and releases.

The model may be replaceable. Durable engineering value lives in tools, data, policy, evaluation and operations.
12

RAG, tools, memory, MCP and A2A solve different problems.

ConceptPurposeExample
RAGRetrieve relevant knowledge before generationFind the correct refund policy
Tool/functionPerform a bounded operationRead an order or issue a refund
MemoryCarry useful state across steps or sessionsRemember language with consent
MCPStandard agent-to-tool/context interfaceExpose CRM search through an MCP server
A2AAgent-to-agent collaborationDelegate fraud review to a specialist agent
Protocols improve interoperability. Production still needs identity propagation, least privilege, schema validation, rate limits, audit and failure handling.
13

The safe path separates reasoning from execution.

Production agent runtime architecture
ChannelIdentity + gatewayAgent runtimePolicy / approvalTool

Read path

Identity-aware retrieval returns only permitted information.

Write path

Validate arguments, enforce policy, approve and record.

Learning path

Traces feed evaluations, incident analysis and controlled releases.

14

All three clouds provide the pieces; they package them differently.

Cloud AI agent platform comparison
LayerAWSMicrosoftGoogle Cloud
Model platformAmazon BedrockMicrosoft FoundryVertex AI
Managed agent pathBedrock Agents / AgentCoreFoundry Agent ServiceAgent Builder / Agent Engine
Code-firstFramework-flexible; Strands commonMicrosoft Agent FrameworkAgent Development Kit
Enterprise toolsAgentCore Gateway, Lambda, APIsFoundry tools, Functions, Logic AppsADK tools, Cloud Run, APIs
IdentityIAM + AgentCore IdentityEntra ID + managed identityCloud IAM + service accounts
ObservabilityCloudWatch + AgentCoreApp Insights / Azure MonitorCloud Trace/Logging + Agent Engine
Feature maturity changes quickly. Verify region availability, quotas, preview status and pricing before committing.
15

AWS: Bedrock for models; AgentCore for operating agents.

Build

Use Bedrock models, Bedrock Agents or a code-first framework.

Run

AgentCore Runtime hosts isolated agent workloads and long-running interactions.

Govern

Gateway, Identity, Memory, Policy, Guardrails, Observability and evaluations.

AppAPI + identityAgentCore RuntimeBedrock modelGateway → APIs
Natural fit for an existing AWS estate wanting model choice and modular, framework-flexible agent infrastructure.
16

Microsoft: Foundry agents connected to the enterprise identity plane.

Build

Microsoft Agent Framework orchestrates code-first workflows; Foundry also supports prompt agents.

Run

Foundry Agent Service manages agents; hosted agents run custom agent code where available.

Connect

Foundry tools, Toolbox/MCP, Functions and Logic Apps with Entra and App Insights.

Teams / appEntra + API ManagementFoundry Agent ServiceModels + AI SearchTools / MCP
Natural fit when Microsoft 365, Entra, Azure data services and enterprise governance are central.
17

Google Cloud: ADK to build, Agent Engine to operate.

Build

ADK is a code-first framework for agents, workflows, tools, sessions and multi-agent patterns.

Run

Vertex AI Agent Engine provides runtime, sessions, memory, evaluation and observability.

Connect

Vertex models and grounding, BigQuery, Search, Cloud Run tools, MCP and A2A.

AppIAM + gatewayAgent EngineGemini / Vertex AIBigQuery / tools
Natural fit for Google data/AI ecosystems, code-first agent development and open interoperability.
23

Agents require a continuous build–evaluate–release–operate loop.

Production AI agent build evaluate release and operate lifecycle
Metric laneMeasure
Task qualityCorrectness, relevance, groundedness and completion
Tool behaviorCorrect tool, parameter accuracy, success, idempotency and side effects
RetrievalRecall, ranking, permission filtering, citation and freshness
SafetyPolicy violations, injection success, leakage and harmful action rate
RuntimeP50/P95 latency, timeout, retry and availability
EconomicsTokens, model/tool calls and cost per completed task
BusinessResolution, containment, satisfaction and human workload

Golden cases

Normal, ambiguous, denied, missing-data, timeout, duplicate, hostile-content and escalation scenarios.

Correlated traces

Link model, retrieval, tools, policy and approval with exact version metadata.

Progressive release

Offline gates, canary cohort, online comparison, human oversight and tested rollback.

Evaluate the complete trajectory and business outcome—not just whether the final answer sounds good.
24

Select the smallest platform that safely closes the loop.

QuestionA strong answer contains
Where is authoritative data?Systems, residency, permissions and freshness
What may the agent do?Allowlisted tools, read/write boundary, approval and rollback
What must persist?Session state, durable memory, consent and retention
How do we know it works?Golden tasks, tool correctness, quality, safety, latency and cost
How will it run?Runtime, identity, network, secrets, observability and recovery

Complete example: customer-support agent

Customer + SSOAgentPolicy RAGOrder toolRefund approval

Read safely

Retrieve policies and orders using caller permissions; cite source and freshness.

Act safely

Validate limits, approve sensitive actions and make retries idempotent.

Improve safely

Trace, evaluate representative cases, canary releases and keep rollback ready.

Final mental model: Cloud gives programmable building blocks. Architecture connects them around requirements. Security limits every identity and data path. Agents add a reasoning loop—but production quality comes from tools, policy, evaluation and operations.
  1. Name the workload and constraints.
  2. Choose the category before the product name.
  3. Prefer managed services when their limits fit.
  4. Draw user, data, trust and failure flows.
  5. Automate infrastructure and deployment.
  6. Measure reliability, security, quality and unit cost continuously.
25

Put everything together with the cloud.

Frontend, mobile, backend, databases and AI agents are deployed, connected, secured, scaled and observed through one cloud operating foundation.

Complete full-stack product architecture connecting web mobile backend data cloud and AI agents
LayerPrimary responsibilityMust not own
Web frontendRendering, interaction, client state and accessibilitySecrets or authoritative business rules
Mobile appNavigation, lifecycle, offline cache and device APIsTrusted authorization decisions
Edge and gatewayTLS, WAF, routing, throttling and token checksCore business workflow
Backend servicesAuthorization, validation, transactions, APIs and eventsPresentation-specific rendering
Relational databaseOrders, payments, users, constraints and ACID changesUI state or semantic search
NoSQL, cache and object storageFast lookups, sessions, documents, media and filesReplacing the system of record without design
Vector databaseEmbeddings, similarity search and RAG metadataAuthoritative permissions or transactions
AI agent runtimeReasoning, orchestration, memory and governed toolsUnlimited database or infrastructure access
Cloud platformIAM, network, secrets, deployment, resilience, telemetry and costApplication requirements and domain meaning

One architecture, three cloud implementations

Architecture capabilityAWS exampleMicrosoft Azure exampleGoogle Cloud example
Web frontend and CDNS3 + CloudFrontStatic Web Apps/Storage + Front DoorCloud Storage/Firebase Hosting + Cloud CDN
API entryAPI Gateway + WAFAPI Management + Front Door WAFAPI Gateway/Apigee + Cloud Armor
Backend runtimeECS/Fargate, Lambda or EKSContainer Apps, Functions or AKSCloud Run, functions or GKE
Transactional databaseRDS/AuroraAzure SQL Database/PostgreSQLCloud SQL/AlloyDB
Cache and messagingElastiCache + SQS/EventBridgeAzure Cache + Service Bus/Event GridMemorystore + Pub/Sub/Eventarc
Object storageS3Blob StorageCloud Storage
AI model and agentBedrock + AgentCoreMicrosoft Foundry + Agent ServiceVertex AI + Agent Engine
Identity and secretsIAM + Secrets ManagerEntra/Managed Identity + Key VaultCloud IAM + Secret Manager
ObservabilityCloudWatch/X-RayAzure Monitor/Application InsightsCloud Monitoring/Logging/Trace
These are concrete implementations of the same logical architecture. Select services by constraints, workload shape and operating maturity—not by copying every row blindly.

The architecture in one sentence

Web / mobile presentsGateway protectsBackend decidesDatabases rememberAgent reasons through toolsCloud operates
The backend remains the policy and transaction boundary. The frontend requests; the database persists; the agent invokes bounded tools; cloud IAM decides whether every call is permitted.

One user action across the complete stack

End-to-end journey of a customer asking where an order is
  1. Frontend or mobile: captures “Where is my order?”, carries the access token and displays loading state.
  2. Cloud edge: DNS/CDN/WAF receives the request; the gateway validates, throttles and routes it.
  3. Backend: authenticates the principal, authorizes order access and loads transactional data.
  4. Databases: relational storage remains authoritative; a cache may accelerate safe repeat reads.
  5. AI agent: retrieves permitted policy context from vector search and calls a narrowly scoped shipment tool.
  6. Backend response: validates tool output, applies policy, redacts sensitive data and returns a stable contract.
  7. UI: updates state and renders success, empty, error or retry behavior.
  8. Operations: correlated logs, metrics, traces, audits and costs describe the journey.

Identity flows

User identity reaches the backend; services and tools use separate workload identities.

Data has owners

Transactional truth, cached copies, files, vector knowledge and agent memory have different roles.

Failures are normal

Timeouts, bounded retries, idempotency, queues and graceful UI states contain failure.

Everything is observable

One correlation ID connects browser, gateway, backend, database, agent and tool traces.

The API contract connecting every layer
GET /api/orders/ORD-1042/status
Authorization: Bearer <user-token>
X-Correlation-ID: 7f4a...

{
  "orderId": "ORD-1042",
  "status": "IN_TRANSIT",
  "estimatedDelivery": "2026-08-28",
  "explanation": "Your parcel has left the Bengaluru hub.",
  "source": "shipment-tracking",
  "asOf": "2026-08-26T14:40:00Z"
}
Never connect the frontend or model directly to production databases. Route access through authenticated, authorized and observable backend capabilities.

Final six-question architecture review

  1. Who is the user or workload principal?
  2. Which backend capability owns this action?
  3. Which data store is authoritative, and which stores are derived?
  4. What may the agent read or change—and where is approval required?
  5. What happens when a dependency is slow, unavailable or called twice?
  6. How will telemetry, audits and cost prove what happened?