AWS Deep Dive
This chapter designs a secure AWS backend across identity, network boundaries, compute, object and relational storage, event sources, queues, fan-out, NoSQL access patterns, user identity, workflows, and edge protection.
- Explain Core services by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Serverless by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain SQS, SNS & data services by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Cognito & Step Functions by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Additional backend services by naming its input, guarantee, internal lifecycle, important failure, and proof.
How to use this chapter
For AWS Deep Dive, read the explanations first and predict every example before running it. Keep a learning repository containing code, tests, command output, and the short written submission. The roadmap checklist at the end audits coverage; the chapter itself follows the operations learning arc appropriate to this subject.
The problem this chapter solves
This chapter designs a secure AWS backend across identity, network boundaries, compute, object and relational storage, event sources, queues, fan-out, NoSQL access patterns, user identity, workflows, and edge protection.
Automation reduces configuration drift and makes deployments, rollbacks, capacity, permissions, and incident response reproducible.
Learning outcomes
- Explain Core services by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Serverless by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain SQS, SNS & data services by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Cognito & Step Functions by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Additional backend services by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Trace the chapter's complete execution path and identify where memory, I/O, concurrency, persistence, or rendering cost accumulates.
- Build the worked example, make one failure visible, and defend the design in a review.
Chapter progression
The order below is intentional: later sections depend on guarantees established earlier.
Runtime or system overview
A container is an isolated process using kernel namespaces and cgroups, not a virtual machine. Kubernetes controllers continuously compare desired and observed state. CI runners execute an immutable workflow revision. Observability correlates metrics, logs, and traces across those layers. In AWS Deep Dive, use that execution model to decide where the chapter's validation, state ownership, cleanup, and evidence belong.
Execution trace
- A versioned manifest or workflow is parsed and validated, and authentication plus authorization determines which control-plane operations are allowed.
- The platform records desired state; controllers, runners, or cloud services reconcile it by creating artifacts, workloads, routes, identities, and telemetry pipelines.
- Readiness and health gates control traffic while resource requests, limits, quotas, pools, and autoscaling signals bound capacity.
- A failed rollout, hook, job, or health condition follows the documented retry, pause, rollback, or incident path without changing immutable artifact identity.
- Deployment verification checks the user path, version/digest, metrics, logs, traces, alerts, permissions, and recovery procedure rather than only command exit status.
Memory and performance lens
Resource requests drive scheduling; limits constrain cgroups and may trigger throttling or OOM termination. Build layers, image caches, log buffers, telemetry cardinality, and unbounded queues consume storage or memory even when application code appears stable. For AWS Deep Dive, connect those costs to the concrete operations in the topic sections rather than assuming the friendly surface syntax is cheap.
When tuning AWS Deep Dive, measure build duration, artifact size, rollout health, CPU/memory saturation, restart/OOM rate, telemetry cardinality, and rollback time rather than optimizing from source-code appearance.
1. Core services
The Core services unit begins with EC2: instance types/AMIs/user data/instance profiles: AWS core design combines identity policies, routed network segments, compute, object storage, and managed relational databases. Use roles and short-lived STS credentials, private subnets for data, endpoint policies, encryption, and Multi-AZ for availability. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
Desired state and operational contract: Core services
| Concept | Meaning | Engineering decision |
|---|---|---|
| EC2: instance types/AMIs/user data/instance profiles | AWS core design combines identity policies, routed network segments, compute, object storage, and managed relational databases. | Use roles and short-lived STS credentials, private subnets for data, endpoint policies, encryption, and Multi-AZ for availability. |
| VPC: subnets (public/private)/route tables/IGW/NAT | AWS core design combines identity policies, routed network segments, compute, object storage, and managed relational databases. | Use roles and short-lived STS credentials, private subnets for data, endpoint policies, encryption, and Multi-AZ for availability. |
| S3: bucket policies/presigned URLs/lifecycle/versioning | AWS core design combines identity policies, routed network segments, compute, object storage, and managed relational databases. | Use roles and short-lived STS credentials, private subnets for data, endpoint policies, encryption, and Multi-AZ for availability. |
| RDS: Multi-AZ/read replicas/parameter groups | AWS core design combines identity policies, routed network segments, compute, object storage, and managed relational databases. | Use roles and short-lived STS credentials, private subnets for data, endpoint policies, encryption, and Multi-AZ for availability. |
| IAM: users/groups/roles/policies/STS assume role | AWS core design combines identity policies, routed network segments, compute, object storage, and managed relational databases. | Use roles and short-lived STS credentials, private subnets for data, endpoint policies, encryption, and Multi-AZ for availability. |
What the platform reconciles: Core services
EC2: instance types/AMIs/user data/instance profiles. A route table selects a target, security groups filter statefully, IAM evaluates identity/resource policies and explicit denies, S3 authorizes each request, and RDS separates primary availability from read scaling.
VPC: subnets (public/private)/route tables/IGW/NAT. A route table selects a target, security groups filter statefully, IAM evaluates identity/resource policies and explicit denies, S3 authorizes each request, and RDS separates primary availability from read scaling.
S3: bucket policies/presigned URLs/lifecycle/versioning. A route table selects a target, security groups filter statefully, IAM evaluates identity/resource policies and explicit denies, S3 authorizes each request, and RDS separates primary availability from read scaling.
RDS: Multi-AZ/read replicas/parameter groups. A route table selects a target, security groups filter statefully, IAM evaluates identity/resource policies and explicit denies, S3 authorizes each request, and RDS separates primary availability from read scaling.
IAM: users/groups/roles/policies/STS assume role. A route table selects a target, security groups filter statefully, IAM evaluates identity/resource policies and explicit denies, S3 authorizes each request, and RDS separates primary availability from read scaling.
Read these as one system: EC2: instance types/AMIs/user data/instance profiles establishes the starting contract, VPC: subnets (public/private)/route tables/IGW/NAT changes how that contract is executed or represented, and IAM: users/groups/roles/policies/STS assume role exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
Failure and security boundaries: Core services
| Risk | Why it matters |
|---|---|
| EC2: instance types/AMIs/user data/instance profiles | A public subnet is defined by routing, not by its name; a read replica is not the same as a synchronous standby. |
| VPC: subnets (public/private)/route tables/IGW/NAT | A public subnet is defined by routing, not by its name; a read replica is not the same as a synchronous standby. |
| S3: bucket policies/presigned URLs/lifecycle/versioning | A public subnet is defined by routing, not by its name; a read replica is not the same as a synchronous standby. |
| RDS: Multi-AZ/read replicas/parameter groups | A public subnet is defined by routing, not by its name; a read replica is not the same as a synchronous standby. |
| IAM: users/groups/roles/policies/STS assume role | A public subnet is defined by routing, not by its name; a read replica is not the same as a synchronous standby. |
Operations drill: Core services
- Foundation: implement or demonstrate EC2: instance types/AMIs/user data/instance profiles with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine EC2: instance types/AMIs/user data/instance profiles with VPC: subnets (public/private)/route tables/IGW/NAT. Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for IAM: users/groups/roles/policies/STS assume role. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
2. Serverless
The Serverless unit begins with Lambda: handler/event/context, layers, cold start optimization: Context distributes a value through a subtree; useReducer centralizes deterministic state transitions. Split contexts by update frequency and separate state from actions. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
Desired state and operational contract: Serverless
| Concept | Meaning | Engineering decision |
|---|---|---|
| Lambda: handler/event/context, layers, cold start optimization | Context distributes a value through a subtree; useReducer centralizes deterministic state transitions. | Split contexts by update frequency and separate state from actions. |
| triggers: API GW/S3/SQS/EventBridge/Cognito | AWS core design combines identity policies, routed network segments, compute, object storage, and managed relational databases. | Use roles and short-lived STS credentials, private subnets for data, endpoint policies, encryption, and Multi-AZ for availability. |
| concurrency: reserved and provisioned | Lambda runs event handlers in reused execution environments; API Gateway exposes authenticated HTTP or WebSocket contracts and maps requests to integrations. | Initialize clients outside the handler, make handlers idempotent, and configure partial batch failure where supported. |
| API Gateway: REST vs HTTP API vs WebSocket API | Lambda runs event handlers in reused execution environments; API Gateway exposes authenticated HTTP or WebSocket contracts and maps requests to integrations. | Initialize clients outside the handler, make handlers idempotent, and configure partial batch failure where supported. |
What the platform reconciles: Serverless
Lambda: handler/event/context, layers, cold start optimization. Provider value identity causes consuming components to render; a reducer receives current state and an action and must return the next state without mutation.
triggers: API GW/S3/SQS/EventBridge/Cognito. A route table selects a target, security groups filter statefully, IAM evaluates identity/resource policies and explicit denies, S3 authorizes each request, and RDS separates primary availability from read scaling.
concurrency: reserved and provisioned. A cold start initializes a sandbox and module state. Reserved concurrency caps and reserves capacity; provisioned concurrency keeps initialized environments ready. Queue triggers poll and batch records.
API Gateway: REST vs HTTP API vs WebSocket API. A cold start initializes a sandbox and module state. Reserved concurrency caps and reserves capacity; provisioned concurrency keeps initialized environments ready. Queue triggers poll and batch records.
Read these as one system: Lambda: handler/event/context, layers, cold start optimization establishes the starting contract, triggers: API GW/S3/SQS/EventBridge/Cognito changes how that contract is executed or represented, and API Gateway: REST vs HTTP API vs WebSocket API exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
Configuration with an observable result: Serverless
1key=lambda item: item.scoreThis Serverless slice makes Lambda: handler/event/context, layers, cold start optimization observable. Read it from the boundary inward: identify the input, the validation point, the state or operation, and the value that proves the result. Before extending it toward API Gateway: REST vs HTTP API vs WebSocket API, predict its behavior for empty, invalid, repeated, and large input.
Failure and security boundaries: Serverless
| Risk | Why it matters |
|---|---|
| Lambda: handler/event/context, layers, cold start optimization | One giant frequently changing context causes broad re-renders. |
| triggers: API GW/S3/SQS/EventBridge/Cognito | A public subnet is defined by routing, not by its name; a read replica is not the same as a synchronous standby. |
| concurrency: reserved and provisioned | A longer visibility timeout and retry policy are required for batch work; global state is reusable but not durable. |
| API Gateway: REST vs HTTP API vs WebSocket API | A longer visibility timeout and retry policy are required for batch work; global state is reusable but not durable. |
Operations drill: Serverless
- Foundation: implement or demonstrate Lambda: handler/event/context, layers, cold start optimization with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine Lambda: handler/event/context, layers, cold start optimization with triggers: API GW/S3/SQS/EventBridge/Cognito. Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for API Gateway: REST vs HTTP API vs WebSocket API. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
3. SQS, SNS & data services
The SQS, SNS & data services unit begins with SQS standard vs FIFO, visibility timeout, DLQ: Queues buffer work, topics fan out notifications, and access-pattern databases require keys designed before code. Use DLQs, idempotent consumers, per-tenant hot-key analysis, and explicit ordering scope. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
Desired state and operational contract: SQS, SNS & data services
| Concept | Meaning | Engineering decision |
|---|---|---|
| SQS standard vs FIFO, visibility timeout, DLQ | Queues buffer work, topics fan out notifications, and access-pattern databases require keys designed before code. | Use DLQs, idempotent consumers, per-tenant hot-key analysis, and explicit ordering scope. |
| SNS fan-out: SNS → multiple SQS queues | Queues buffer work, topics fan out notifications, and access-pattern databases require keys designed before code. | Use DLQs, idempotent consumers, per-tenant hot-key analysis, and explicit ordering scope. |
| MSK (Managed Kafka) + ElastiCache (Redis Cluster) | Cluster shards keys across 16,384 hash slots; Sentinel monitors a primary-replica deployment and coordinates failover without sharding. | Use hash tags only for deliberate multi-key colocation and test failover behavior. |
| DynamoDB: partition key design/GSI/LSI/Streams | Queues buffer work, topics fan out notifications, and access-pattern databases require keys designed before code. | Use DLQs, idempotent consumers, per-tenant hot-key analysis, and explicit ordering scope. |
What the platform reconciles: SQS, SNS & data services
SQS standard vs FIFO, visibility timeout, DLQ. SQS hides a received message for the visibility interval until deletion; SNS copies a publish to subscriptions; DynamoDB hashes partition keys and maintains secondary indexes asynchronously with base writes.
SNS fan-out: SNS → multiple SQS queues. SQS hides a received message for the visibility interval until deletion; SNS copies a publish to subscriptions; DynamoDB hashes partition keys and maintains secondary indexes asynchronously with base writes.
MSK (Managed Kafka) + ElastiCache (Redis Cluster). Clients follow MOVED/ASK redirects in Cluster. Sentinel quorum detects failure and a majority authorization elects a new primary.
DynamoDB: partition key design/GSI/LSI/Streams. SQS hides a received message for the visibility interval until deletion; SNS copies a publish to subscriptions; DynamoDB hashes partition keys and maintains secondary indexes asynchronously with base writes.
Read these as one system: SQS standard vs FIFO, visibility timeout, DLQ establishes the starting contract, SNS fan-out: SNS → multiple SQS queues changes how that contract is executed or represented, and DynamoDB: partition key design/GSI/LSI/Streams exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
Failure and security boundaries: SQS, SNS & data services
| Risk | Why it matters |
|---|---|
| SQS standard vs FIFO, visibility timeout, DLQ | FIFO ordering is per message group and does not remove duplicate-delivery handling. |
| SNS fan-out: SNS → multiple SQS queues | FIFO ordering is per message group and does not remove duplicate-delivery handling. |
| MSK (Managed Kafka) + ElastiCache (Redis Cluster) | Asynchronous replication can lose acknowledged writes during failover. |
| DynamoDB: partition key design/GSI/LSI/Streams | FIFO ordering is per message group and does not remove duplicate-delivery handling. |
Operations drill: SQS, SNS & data services
- Foundation: implement or demonstrate SQS standard vs FIFO, visibility timeout, DLQ with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine SQS standard vs FIFO, visibility timeout, DLQ with SNS fan-out: SNS → multiple SQS queues. Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for DynamoDB: partition key design/GSI/LSI/Streams. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
4. Cognito & Step Functions
The Cognito & Step Functions unit begins with User Pools: JWT tokens + triggers: Token authentication proves possession of a signed credential; authorization separately decides whether that identity may perform an action. Enforce object ownership and roles on the server for every path. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
Desired state and operational contract: Cognito & Step Functions
| Concept | Meaning | Engineering decision |
|---|---|---|
| User Pools: JWT tokens + triggers | Token authentication proves possession of a signed credential; authorization separately decides whether that identity may perform an action. | Enforce object ownership and roles on the server for every path. |
| Cognito + API Gateway authorizer | Lambda runs event handlers in reused execution environments; API Gateway exposes authenticated HTTP or WebSocket contracts and maps requests to integrations. | Initialize clients outside the handler, make handlers idempotent, and configure partial batch failure where supported. |
| WAF: rate limiting + OWASP rules | Throttling bounds request rate; pagination bounds response and query work. Cursor pagination advances from a stable ordering key rather than a row offset. | Use deterministic unique ordering and return retry metadata. |
| Step Functions: states/error handling/Express vs Standard | Cognito issues user tokens, authorizers gate requests, WAF filters edge traffic, and Step Functions persist workflow state and retries. | Validate issuer/audience, use least-privilege task roles, and define catches/timeouts at each state. |
What the platform reconciles: Cognito & Step Functions
User Pools: JWT tokens + triggers. A server validates signature, issuer, audience, expiry, and claims. Short-lived access tokens limit exposure; rotating refresh tokens require server-side reuse detection or revocation state.
Cognito + API Gateway authorizer. A cold start initializes a sandbox and module state. Reserved concurrency caps and reserves capacity; provisioned concurrency keeps initialized environments ready. Queue triggers poll and batch records.
WAF: rate limiting + OWASP rules. Distributed limits use atomic counters or scripts. A cursor encodes ordering position and tie-breaker; Relay exposes edges, nodes, cursors, and pageInfo.
Step Functions: states/error handling/Express vs Standard. A state machine transitions JSON state across tasks and choices; Standard emphasizes durable exactly-once state transitions while Express targets high-volume shorter workflows with different semantics.
Read these as one system: User Pools: JWT tokens + triggers establishes the starting contract, Cognito + API Gateway authorizer changes how that contract is executed or represented, and Step Functions: states/error handling/Express vs Standard exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
Failure and security boundaries: Cognito & Step Functions
| Risk | Why it matters |
|---|---|
| User Pools: JWT tokens + triggers | Decoding is not validation, and a valid token does not grant every resource. |
| Cognito + API Gateway authorizer | A longer visibility timeout and retry policy are required for batch work; global state is reusable but not durable. |
| WAF: rate limiting + OWASP rules | Application throttles are not a substitute for edge protection, and offset pagination drifts under concurrent writes. |
| Step Functions: states/error handling/Express vs Standard | Authentication does not provide application object authorization. |
Operations drill: Cognito & Step Functions
- Foundation: implement or demonstrate User Pools: JWT tokens + triggers with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine User Pools: JWT tokens + triggers with Cognito + API Gateway authorizer. Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for Step Functions: states/error handling/Express vs Standard. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
5. Additional backend services
The Additional backend services unit begins with security groups vs network ACLs: AWS security groups are stateful allow rules attached to elastic network interfaces, while network ACLs are stateless ordered allow-and-deny rules applied at subnet boundaries. Use security groups as the primary workload firewall, keep rules identity-based where possible, and use NACLs as coarse subnet guardrails with tested return paths. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
Desired state and operational contract: Additional backend services
| Concept | Meaning | Engineering decision |
|---|---|---|
| security groups vs network ACLs | AWS security groups are stateful allow rules attached to elastic network interfaces, while network ACLs are stateless ordered allow-and-deny rules applied at subnet boundaries. | Use security groups as the primary workload firewall, keep rules identity-based where possible, and use NACLs as coarse subnet guardrails with tested return paths. |
| Lambda with RDS Proxy connection management | AWS core design combines identity policies, routed network segments, compute, object storage, and managed relational databases. | Use roles and short-lived STS credentials, private subnets for data, endpoint policies, encryption, and Multi-AZ for availability. |
| Athena query over partitioned S3 data | AWS core design combines identity policies, routed network segments, compute, object storage, and managed relational databases. | Use roles and short-lived STS credentials, private subnets for data, endpoint policies, encryption, and Multi-AZ for availability. |
| EventBridge bus/rule/archive/replay | Amazon EventBridge routes versioned events from producers to matching targets; archives retain selected events and replay republishes them over a chosen historical window. | Use custom buses and least-privilege resource policies, stable event IDs/schemas, DLQs, idempotent targets, and a reviewed replay runbook. |
| Route 53 routing policies and health checks | Route 53 routing policies choose DNS answers by simple, weighted, latency, failover, geolocation, geoproximity, or multi-value rules; health checks can remove unhealthy failover targets. | Choose policy from traffic and recovery goals, set TTLs deliberately, monitor health-check regions and dependencies, and test failover with cached clients. |
| CloudFront origin access control and cache policy | CloudFront origin access control signs requests to supported origins such as private S3, while a cache policy defines which headers, cookies, and query strings enter the cache key and reach caching decisions. | Keep origins private, include every representation-varying input but no unnecessary high-cardinality values, and separate cache policy from origin-request policy. |
| Bedrock model invocation basics | Amazon Bedrock provides managed access to foundation models through provider-specific or converged invocation APIs governed by IAM, region, quotas, and model access. | Wrap invocation behind an application adapter, validate output, set timeouts/budgets, redact sensitive inputs, and evaluate the selected model/version on real tasks. |
| SageMaker training vs managed inference basics | SageMaker training runs bounded jobs that read data and produce model artifacts; managed inference hosts an artifact behind real-time, serverless, asynchronous, or batch execution suited to different latency and volume. | Separate data/code/model versions, encrypt inputs and artifacts, size from measured latency/throughput, monitor drift/errors, and retain rollback models. |
What the platform reconciles: Additional backend services
security groups vs network ACLs. Return traffic is automatically recognized by a security group's connection state; a network ACL evaluates inbound and outbound traffic separately in rule-number order, including ephemeral ports.
Lambda with RDS Proxy connection management. A route table selects a target, security groups filter statefully, IAM evaluates identity/resource policies and explicit denies, S3 authorizes each request, and RDS separates primary availability from read scaling.
Athena query over partitioned S3 data. A route table selects a target, security groups filter statefully, IAM evaluates identity/resource policies and explicit denies, S3 authorizes each request, and RDS separates primary availability from read scaling.
EventBridge bus/rule/archive/replay. A producer puts an event on a bus, rules evaluate source/detail patterns, and targets receive independent deliveries with service-specific retry and dead-letter behavior. Replay creates new deliveries and does not reverse prior effects.
Route 53 routing policies and health checks. Authoritative DNS evaluates record policy and health state, returns records with a TTL, and recursive/client caches continue using an answer until expiry. DNS control therefore cannot instantly move every existing connection.
CloudFront origin access control and cache policy. An edge location derives a key, serves a fresh object or forwards to the origin, validates/authorizes origin access, and stores the response according to cache and origin policies. Invalidations or versioned URLs change what edges serve.
Bedrock model invocation basics. The client sends a model identifier, messages or prompt, inference parameters, and optional tool/guardrail configuration; the service authenticates the role, meters tokens, and returns a complete or streamed response with usage metadata.
SageMaker training vs managed inference basics. A training job provisions isolated compute, executes a versioned container, writes metrics/checkpoints/artifacts, and terminates. Deployment creates endpoint configuration and instances or serverless capacity that load the artifact and process requests.
Read these as one system: security groups vs network ACLs establishes the starting contract, Lambda with RDS Proxy connection management changes how that contract is executed or represented, and SageMaker training vs managed inference basics exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
Configuration with an observable result: Additional backend services
1key=lambda item: item.scoreThis Additional backend services slice makes security groups vs network ACLs observable. Read it from the boundary inward: identify the input, the validation point, the state or operation, and the value that proves the result. Before extending it toward SageMaker training vs managed inference basics, predict its behavior for empty, invalid, repeated, and large input.
Failure and security boundaries: Additional backend services
| Risk | Why it matters |
|---|---|
| security groups vs network ACLs | The letters ACL in NACL do not make this a Kafka ACL, and a permissive outbound or ephemeral-port rule can invalidate an apparently restrictive design. |
| Lambda with RDS Proxy connection management | A public subnet is defined by routing, not by its name; a read replica is not the same as a synchronous standby. |
| Athena query over partitioned S3 data | A public subnet is defined by routing, not by its name; a read replica is not the same as a synchronous standby. |
| EventBridge bus/rule/archive/replay | A broad rule can fan out sensitive or high-volume events unexpectedly, and replaying into non-idempotent consumers duplicates side effects. |
| Route 53 routing policies and health checks | A health check that depends on the same failed component or a very long TTL can keep directing users to an unavailable region. |
| CloudFront origin access control and cache policy | Omitting authorization/locale/query variation can serve the wrong content; including every cookie destroys cache efficiency. |
| Bedrock model invocation basics | IAM permission and a successful response do not guarantee factual, schema-valid, safe, or affordable output. |
| SageMaker training vs managed inference basics | Leaving endpoints idle creates cost, while promoting an artifact without data lineage and evaluation makes rollback and incident diagnosis unreliable. |
Operations drill: Additional backend services
- Foundation: implement or demonstrate security groups vs network ACLs with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine security groups vs network ACLs with Lambda with RDS Proxy connection management. Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for SageMaker training vs managed inference basics. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
Complete worked example
This example integrates the chapter rather than demonstrating an isolated method.
1import boto32
3s3 = boto3.client("s3")4sqs = boto3.client("sqs")5
6def handler(event, context):7 failures = []8 for record in event.get("Records", []):9 try:10 event_id = record["messageId"]11 payload = parse(record["body"])12 if claim_idempotency_key(event_id):13 transform_s3_object(s3, payload["bucket"], payload["key"])14 except Exception:15 failures.append({"itemIdentifier": record["messageId"]})16 return {"batchItemFailures": failures}Expected result
1An SQS-triggered Lambda retries only failed records and deduplicates successful side effects.Line-by-line reading
| Line | Code | Explanation |
|---|---|---|
| 1 | import boto3 | Imports the named dependency; import executes the module once per interpreter cache and binds selected names here. |
| 3 | s3 = boto3.client("s3") | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 4 | sqs = boto3.client("sqs") | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 6 | def handler(event, context): | Defines a function; its parameters form the explicit input boundary. |
| 7 | failures = [] | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 8 | for record in event.get("Records", []): | Consumes the iterable one item at a time through the iterator protocol. |
| 9 | try: | Defines failure translation or cleanup that must run around the protected operation. |
| 10 | event_id = record["messageId"] | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 11 | payload = parse(record["body"]) | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 12 | if claim_idempotency_key(event_id): | Evaluates the condition and enters this branch only when it is truthy. |
| 13 | transform_s3_object(s3, payload["bucket"], payload["key"]) | Implements the next python statement in the example's data flow. |
| 14 | except Exception: | Defines failure translation or cleanup that must run around the protected operation. |
| 15 | failures.append({"itemIdentifier": record["messageId"]}) | Implements the next python statement in the example's data flow. |
| 16 | return {"batchItemFailures": failures} | Returns the observable result to the caller and ends this invocation. |
Step-by-step execution
- A versioned manifest or workflow is parsed and validated, and authentication plus authorization determines which control-plane operations are allowed.
- The platform records desired state; controllers, runners, or cloud services reconcile it by creating artifacts, workloads, routes, identities, and telemetry pipelines.
- Readiness and health gates control traffic while resource requests, limits, quotas, pools, and autoscaling signals bound capacity.
- A failed rollout, hook, job, or health condition follows the documented retry, pause, rollback, or incident path without changing immutable artifact identity.
- Deployment verification checks the user path, version/digest, metrics, logs, traces, alerts, permissions, and recovery procedure rather than only command exit status.
Common mistakes and professional corrections
| Area | Common failure | Better engineering choice |
|---|---|---|
| Core services | A public subnet is defined by routing, not by its name; a read replica is not the same as a synchronous standby. | Use roles and short-lived STS credentials, private subnets for data, endpoint policies, encryption, and Multi-AZ for availability. |
| Serverless | One giant frequently changing context causes broad re-renders. | Split contexts by update frequency and separate state from actions. |
| SQS, SNS & data services | FIFO ordering is per message group and does not remove duplicate-delivery handling. | Use DLQs, idempotent consumers, per-tenant hot-key analysis, and explicit ordering scope. |
| Cognito & Step Functions | Decoding is not validation, and a valid token does not grant every resource. | Enforce object ownership and roles on the server for every path. |
| Additional backend services | The letters ACL in NACL do not make this a Kafka ACL, and a permissive outbound or ephemeral-port rule can invalidate an apparently restrictive design. | Use security groups as the primary workload firewall, keep rules identity-based where possible, and use NACLs as coarse subnet guardrails with tested return paths. |
Interview and review notes
- Define the central abstraction without naming a library function.
- Trace one request, call, query, message, render, or state transition from input to observable result.
- Compare two alternatives from this chapter by guarantee, cost, and failure behavior.
- Explain the most likely production bug and the test or metric that reveals it.
- State what remains authoritative after process loss, retry, reconnect, or deployment.
Practice set
Easy
- Define every bold term in the concept tables in one precise sentence.
- Reproduce the focused examples and annotate the value or state after each important line.
- Explain the chapter progression diagram aloud in two minutes.
Medium
- Replace one convenient default with an explicit policy for validation, timeout, ordering, pagination, cleanup, or error handling.
- Write a negative test for each topic group.
- Compare the measured behavior before and after one justified change.
Hard
- Combine all topic groups into one thin vertical slice.
- Inject a realistic failure at the most important external boundary and prove recovery.
- Write a one-page design note covering ownership, trade-offs, security, observability, and rollback.
Chapter submission
Submit:
- source code or reproducible commands;
- automated tests plus one deliberately failing-before-fix test;
- captured output, query plan, trace, screenshot, or metric;
- a 300–500 word explanation of the execution flow and one rejected alternative;
- a short README with setup, versions, limitations, and cleanup steps.
- Continue with the Serverless Thumbnail Generator project workshop.
Self-review rubric
| Dimension | Beginning | Competent | Professional |
|---|---|---|---|
| Explanation | Names APIs | Explains behavior | Connects guarantees, internals, and trade-offs |
| Implementation | Happy path only | Validated and tested | Clear ownership, failure recovery, and cleanup |
| Evidence | Manual claim | Repeatable output | Tests plus meaningful measurement or inspection |
| Communication | Steps missing | Reproducible README | Decisions, limits, and alternatives are explicit |
Roadmap coverage checklist
- To do: Core services: EC2: instance types/AMIs/user data/instance profiles
- To do: Core services: VPC: subnets (public/private)/route tables/IGW/NAT
- To do: Core services: S3: bucket policies/presigned URLs/lifecycle/versioning
- To do: Core services: RDS: Multi-AZ/read replicas/parameter groups
- To do: Core services: IAM: users/groups/roles/policies/STS assume role
- To do: Serverless: Lambda: handler/event/context, layers, cold start optimization
- To do: Serverless: triggers: API GW/S3/SQS/EventBridge/Cognito
- To do: Serverless: concurrency: reserved and provisioned
- To do: Serverless: API Gateway: REST vs HTTP API vs WebSocket API
- To do: SQS, SNS & data services: SQS standard vs FIFO, visibility timeout, DLQ
- To do: SQS, SNS & data services: SNS fan-out: SNS → multiple SQS queues
- To do: SQS, SNS & data services: MSK (Managed Kafka) + ElastiCache (Redis Cluster)
- To do: SQS, SNS & data services: DynamoDB: partition key design/GSI/LSI/Streams
- To do: Cognito & Step Functions: User Pools: JWT tokens + triggers
- To do: Cognito & Step Functions: Cognito + API Gateway authorizer
- To do: Cognito & Step Functions: WAF: rate limiting + OWASP rules
- To do: Cognito & Step Functions: Step Functions: states/error handling/Express vs Standard
- To do: Additional backend services: security groups vs network ACLs
- To do: Additional backend services: Lambda with RDS Proxy connection management
- To do: Additional backend services: Athena query over partitioned S3 data
- To do: Additional backend services: EventBridge bus/rule/archive/replay
- To do: Additional backend services: Route 53 routing policies and health checks
- To do: Additional backend services: CloudFront origin access control and cache policy
- To do: Additional backend services: Bedrock model invocation basics
- To do: Additional backend services: SageMaker training vs managed inference basics
Quick revision
- Core services: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- Serverless: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- SQS, SNS & data services: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- Cognito & Step Functions: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- Additional backend services: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- Re-read the worked-example execution trace instead of memorizing isolated syntax.
- If you cannot name the owner of state and cleanup, the design is not yet complete.
Mastery check
How well can you recall this?
Finished this lesson?