The previous module ended with MercadoFresco's architecture complete: elastic, secure, observable, deployable from a pipeline, described in code and spread across five working accounts. And with an uncomfortable question waiting for Monday morning. Before answering how much it costs, it is worth answering something that comes first: is it well built? Not "does it work?" — it works — but "would it survive an honest audit?".
This lesson introduces the method AWS publishes for running that audit: the Well-Architected Framework. You will see what it is and what it is not, the six pillars with their design principles and their key questions, the real review of MercadoFresco pillar by pillar with its findings and their risk, the trade-offs between pillars that nobody can avoid, the Well-Architected Tool for running the review with some method, and the conversation that almost never gets written down: RTO, RPO and the four disaster recovery strategies. At the end you will have a prioritised improvement plan, and the first item on that plan is the one that opens the next five lessons.
Cost warning. The AWS Well-Architected Tool is free: it charges nothing for workloads, reviews, milestones or lenses. What costs money are the actions that come out of the improvement plan — a replica in another region, a load test, a higher support plan — and that is exactly what this lesson teaches you to prioritise instead of buying the lot. Fictitious data, accounts and identifiers.
Contents
- What the Well-Architected Framework is and what it is not
- The anatomy of the framework: pillars, questions, best practices and improvement plan
- Pillar 1: operational excellence
- Pillar 2: security
- Pillar 3: reliability
- Pillar 4: performance efficiency
- Pillar 5: cost optimisation
- Pillar 6: sustainability
- The trade-offs between pillars and how they are documented
- The architecture decision record
- RTO, RPO and the four disaster recovery strategies
- MercadoFresco's recovery decision
- The AWS Well-Architected Tool: workloads, milestones and lenses
- The routine: who reviews, how often and what happens to the findings
- Periodic review versus continuous checking: Trusted Advisor and Config
- MercadoFresco's prioritised improvement plan
- Common mistakes and tips
- Exercises
- Conclusion
What the Well-Architected Framework is and what it is not
The AWS Well-Architected Framework is a public document — a set of documents, in fact — that gathers what AWS has learned from reviewing tens of thousands of customer architectures. Its format is not a list of recommended services but a collection of questions grouped into six pillars, each one with its associated best practices.
The shape of the questions is always the same: "How do you do X?". Not "Do you use service Y?". That difference is the whole value of the framework:
- "How do you protect data at rest?" can be answered with KMS, with client-side encryption, or with a justification of why that data does not need encryption. All three are valid answers if they are reasoned.
- "Do you use KMS?" only admits yes or no, and turns the architecture into a shopping list.
It is worth stating clearly what it is not:
- It is not a certification. Nobody passes or fails. There is no "Well-Architected" badge to hang on your website.
- It is not a shopping list of AWS services. Many of the best answers cost no money at all: writing a procedure, running a drill, deleting a permission.
- It is not a compliance audit. It does not replace an ISO 27001, a national security scheme or the review of a data protection professional. There is overlap, but the goal is different.
- It is not an afternoon's work, nor a one-off. An architecture that was fine a year ago may not be fine today: it has grown, the business has changed and new services have appeared.
- It does not demand that you fix everything. The output is a prioritised list of consciously accepted risks and risks you are going to mitigate. Accepting a risk in writing is a professional answer; ignoring it is not.
What it is: a structured way of finding what you did not know you were missing, and of turning it into a conversation with the business that does not depend on the intuition of whoever speaks loudest.
The anatomy of the framework: pillars, questions, best practices and improvement plan
The structure is hierarchical and it is worth having it clear before opening the tool:
graph TD M["Well-Architected Framework"] --> P1["6 pillars"] P1 --> A["Each pillar:<br/>design principles"] P1 --> B["Each pillar:<br/>improvement areas"] B --> Q["Questions<br/>'How do you do X?'"] Q --> BP["Best practices<br/>you select"] BP --> R["Risk per question:<br/>high / medium / none"] R --> PM["Prioritised<br/>improvement plan"] PM --> HI["Milestone<br/>frozen snapshot"] HI --> PM
The elements:
| Element | What it is | Example in MercadoFresco |
|---|---|---|
| Pillar | A dimension of architectural quality | Reliability |
| Design principle | A guiding idea of the pillar | "Recover automatically from failure" |
| Question | The unit of the review | "How do you test reliability?" |
| Best practice | A concrete answer you either tick or not | "Load tests are run regularly" |
| Risk | What the tool infers from what you did not tick | High: there are no load tests |
| Improvement item | The action that brings that risk down | "Load test of the Friday peak before December" |
| Milestone | A frozen snapshot of the review on a date | "Initial review, August" |
| Lens | An extra set of questions for a domain | Serverless lens |
The six pillars — and their order matters little, because no pillar is more important than another in the abstract, only in your context — are:
| Pillar | One-sentence question |
|---|---|
| Operational excellence | Do you know how to run, observe and improve the workload day to day? |
| Security | Do you protect data, systems and assets, and do you know what happened when it happened? |
| Reliability | Does it recover from failure on its own and does it deliver what it promises? |
| Performance efficiency | Do you use the right resources, in the right amount, and keep doing so when the load changes? |
| Cost optimisation | Do you get the maximum business value out of every dollar? |
| Sustainability | Do you minimise the environmental impact of running the workload? |
One practical detail before starting: the review is done on a specific workload, not on "the company". MercadoFresco defines a workload called mercadofresco-tienda-produccion, covering the shop, the catalogue, orders and delivery in account 111122223333. Sara's analytics will be a second workload with its own review, because it has different requirements, different risk and a different owner.
Pillar 1: operational excellence
This is about how the workload is run and improved: procedures, observability, incident response and learning.
Design principles:
- Perform operations as code: if it is done twice by hand, it gets automated.
- Make frequent, small, reversible changes.
- Refine procedures often, rather than leaving them fossilised in a two-year-old document.
- Anticipate failure: rehearse it before suffering it.
- Learn from all operational failures with blameless post mortems.
- Use observability to gain actionable insight, not pretty charts.
Key questions: how priorities are determined; how teams are structured to support the business outcome; how the workload is designed so it can be understood while running; how the risk of changes is reduced; how you know it is ready for production; how you know it is healthy; how operational events are managed; and how what you learn is turned into evolution.
MercadoFresco review:
| Finding | Status | Risk | Proposed action |
|---|---|---|---|
Pipeline pipeline-mercadofresco-tienda with blue/green and automatic rollback (08-05) |
Good | — | Keep |
| DORA metrics measured: 4.8 deployments/week, restore in 4 min | Good | — | Publish on the business dashboard |
Dashboards mercadofresco-produccion and mercadofresco-negocio (05-01) |
Good | — | Keep |
Traces with X-Ray and Container Insights (05-02, 10-01) |
Good | — | Keep |
| There is no written runbook for the most frequent incidents | Missing | High | Write 5 runbooks: AZ outage, stuck queue, Aurora failing over, unexpected peak, failed deployment |
| There is no formal post mortem or incident log | Missing | Medium | Blameless post mortem template and repository in mercadofresco-infra |
The on-call rota is not defined: alerts from alertas-mercadofresco go to a shared mailbox |
Missing | High | Define the rota and escalation; integrate with the on-call tool |
| There are 3 recurring manual tasks (rotate a certificate, load prices, purge the cache) | Partial | Medium | Automate them with Systems Manager or EventBridge Scheduler |
A detail that usually goes unnoticed: MercadoFresco has excellent observability and weak operations. It knows perfectly well what is happening and has not written down what to do when it happens. It is the most common pattern among good technical teams.
Pillar 2: security
This is about protecting information, systems and assets, with controls that detect and respond.
Design principles:
- A strong identity foundation: least privilege, separation of duties, no long-lived credentials.
- Traceability: log, monitor and audit every action.
- Apply security at all layers, not only at the perimeter.
- Automate security best practices.
- Protect data in transit and at rest, and classify it.
- Keep people away from the data: if nobody needs to get in, nobody gets in.
- Prepare for the incident: have a plan, tools and a rehearsal.
Key questions: how the account and identities are managed; how permissions for people and machines are managed; how security events are detected; how networks, compute and data are protected; and how you respond to an incident.
MercadoFresco review:
| Finding | Status | Risk | Proposed action |
|---|---|---|---|
| IAM Identity Center, no long-lived IAM users; MFA on the root user (04-01, 09-04) | Good | — | Keep |
Encryption at rest with alias/mercadofresco-datos in Aurora, S3, DynamoDB and queues (04-02) |
Good | — | Keep |
Secrets in mercadofresco/produccion/rds/mfadmin with automatic rotation (04-03) |
Good | — | Keep |
| WAF on the CDN and the ALB, Shield Standard, documented decision not to buy Advanced (04-04, 04-05) | Good | — | Review annually |
Security account 444455556666 with an organisation trail and aggregated Config |
Good | — | Keep |
| There is no periodic permissions review: nobody has looked at the permission sets since they were created | Missing | High | Quarterly review with IAM Access Analyzer and the activity-based policy generator |
| There is no security incident response plan and no tested isolation account | Partial | High | Write the plan; rehearse isolating an account in the Aislamiento OU |
| GuardDuty enabled but its findings go to nobody | Partial | Medium | Route to alertas-mercadofresco with a severity ≥ 7 filter |
| There is no written data classification (what is personal, what is sensitive, what may be exported) | Missing | Medium | Data inventory and classification; review by the data protection officer |
| The access keys of two external integrations are never rotated | Missing | Medium | Move to roles with sts:AssumeRole and cross-account trust |
Pillar 3: reliability
This is about the workload doing what it should when it should, and recovering from disruptions.
Design principles:
- Recover automatically from failure, detecting it through key indicators.
- Test the recovery procedures, not just write them.
- Scale horizontally to increase aggregate availability.
- Stop guessing capacity.
- Manage change through automation.
Key questions: how service quotas are managed; how the network topology is designed; how the service architecture is designed to withstand the failure of a dependency; how it is monitored; how reliability is tested; and how disaster recovery is planned.
MercadoFresco review:
| Finding | Status | Risk | Proposed action |
|---|---|---|---|
| Genuine Multi-AZ: subnets in two AZs, ALB, Aurora with a writer and 2 readers, Fargate spread out | Good | — | Keep |
SQS queues with retries, DLQ mercadofresco-pedidos-fallidos and idempotency (07-05) |
Good | — | Keep |
| Auto scaling with target tracking and scheduled scaling for Friday (10-02) | Good | — | Keep |
Backups with Aurora PITR and mercadofresco-copias-basedatos |
Good | — | See the next row |
| A full restore from scratch has never been tested | Missing | High | Quarterly restore drill against the clock |
| There is no declared RTO or RPO from the business | Missing | High | Agree them with the manager and write them down; see below |
| There is no regional disaster recovery plan | Missing | High | Decide a strategy (recovery section) |
| The failure of a whole AZ has never been simulated | Missing | High | Experiment with AWS Fault Injection Service in pre-production |
| There are no load tests validating the Friday peak: the 900 orders/hour are a forecast, not a measurement | Missing | High | Load test at 1,400 orders/hour in pre-production before December |
| Service quotas are not monitored beyond two alarms (05-05) | Partial | Medium | Extend to Fargate, ENI, Lambda concurrency and Aurora connection quotas |
This pillar comes off worst of the six, and not by accident: everything that is missing is a drill, and drills are the first thing to be postponed when features have to ship.
Pillar 4: performance efficiency
This is about using the right resources — not merely enough of them — and continuing to do so as the world changes.
Design principles:
- Democratise advanced technologies: consume them as a service instead of operating them.
- Go global in minutes.
- Use serverless architectures where they fit.
- Experiment more often, because in the cloud trying things is cheap.
- Have mechanical sympathy: choose the technology for how it works inside, not out of habit.
Key questions: how the architecture is selected; how compute, storage, database and network resources are selected and used; and how performance is monitored to make sure it is still what you expect.
MercadoFresco review:
| Finding | Status | Risk | Proposed action |
|---|---|---|---|
| Engines chosen by use case, not by habit: Aurora, DynamoDB, Redshift, ElastiCache (06-01) | Good | — | Keep |
| CloudFront in front of the photos: 350 ms → 25 ms (03-04) | Good | — | Keep |
| ElastiCache for the product page: 240 ms → 28 ms (06-05) | Good | — | Keep |
| Task sizing from the 95th percentile in Container Insights (10-02) | Good | — | Repeat quarterly |
| arm64 with Graviton in the shop (10-02) | Good | — | Extend to workers and pre-production |
| There is no periodic sizing review of Aurora or ElastiCache | Missing | Medium | Quarterly review with Compute Optimizer |
| There are no declared SLOs per user journey; there are metrics but no targets | Missing | Medium | Define SLI/SLO: TiempoConfirmacionPedido p99 < 900 ms, availability 99.9 % |
| Sara's Redshift queries have no time budget or concurrency limit | Partial | Low | Workload management queues with a limit |
Pillar 5: cost optimisation
This is about getting the maximum business value per dollar spent. It is not "spend little": it is "spend well and know it".
Design principles:
- Implement cloud financial management (FinOps) as a capability, not as an annual fright.
- Adopt a consumption model: pay for what you use.
- Measure overall efficiency: cost per business unit, not absolute cost.
- Stop spending on undifferentiated heavy lifting: data centres, patching hosts.
- Analyse and attribute spend: let every team see its own.
Key questions: how spend governance is implemented; how usage and cost are monitored; how you decommission what is no longer used; how purchase options and resource types are evaluated; how demand is planned; and how cost changes are evaluated over time.
MercadoFresco review:
| Finding | Status | Risk | Proposed action |
|---|---|---|---|
Mandatory tags defined in the course: Proyecto, Entorno, Componente, Propietario, CentroCoste |
Partial | High | They are not activated as cost allocation tags nor enforced: lesson 11-02 |
Budget presupuesto-mensual-mercadofresco of 10 USD, created in 01-02 |
Partial | High | It has been firing since the second month and nobody looks at it: lesson 11-04 |
| Serverless and Spot already in use (Lambda, Fargate Spot, Redshift Serverless) | Good | — | Keep |
| Nobody has ever opened Cost Explorer | Missing | High | Lesson 11-03 |
The development account 333344445555 has no spending limit |
Missing | High | Budget with an automatic action: lesson 11-04 |
| There is no capacity commitment at all: everything is paid on demand | Missing | Medium | Lesson 11-05 |
| There is no unit cost metric (cost per order) | Missing | Medium | Lesson 11-02 |
| Nobody reviews the bill on any regular basis | Missing | High | Monthly cost meeting: lesson 11-04 |
Eight findings and five of them high risk. It is by far the worst governed pillar, and that is consistent with reality: it is the only one that does not throw an error in production when it is ignored. It simply charges you.
Pillar 6: sustainability
This is the most recent pillar and the least well understood. It is about the environmental impact of running the workload: energy, hardware and resources consumed.
Design principles:
- Understand the impact and measure it.
- Set sustainability targets per unit of work.
- Maximise utilisation: a server at 10 % consumes almost as much as at 60 %.
- Adopt more efficient hardware and software as soon as they are available.
- Use managed services, which aggregate the load of many customers.
- Reduce the downstream impact: less data transferred, fewer client devices forced to work.
Key questions: how regions are selected against the sustainability goal; how software patterns are aligned with demand; how data is exploited; how hardware and its lifecycle are managed; and how development and deployment processes are optimised.
MercadoFresco review:
| Finding | Status | Risk | Proposed action |
|---|---|---|---|
eu-west-1 (Ireland) has a high share of renewable energy |
Good | — | Document the criterion |
| arm64/Graviton: better performance per watt | Good | — | Extend to everything |
| Fargate and Lambda: no idle reserved capacity | Good | — | Keep |
| S3 lifecycle into cold classes (02-03) | Partial | Low | Apply it to mercadofresco-registros-web as well |
| Pre-production and development switched on 24×7 with nobody using them at night | Missing | Medium | Scheduled shutdown: it is sustainability and cost at the same time (11-03) |
| Logs retained indefinitely in CloudWatch Logs | Missing | Medium | Retention per log group |
| ECR images with no lifecycle policy: 400 images piled up | Missing | Low | Retention policy |
An honest note: in 90 % of cases, the actions in the sustainability pillar coincide exactly with those in the cost pillar. Switching off what nobody uses saves money and energy. It is the pillar with the best effort-to-result ratio, precisely because it goes hand in hand with the next one.
The trade-offs between pillars and how they are documented
This is where the framework stops being a list and starts being engineering. The six pillars cannot be maximised at once. Every decision raises one and lowers another. Real examples from MercadoFresco:
| Decision | Pillar that goes up | Pillar that goes down | Quantification |
|---|---|---|---|
| Aurora Multi-AZ with 2 readers | Reliability | Cost | Compute is multiplied by 3 compared with a single instance |
| 2 NAT Gateways, one per AZ | Reliability | Cost | +33 USD/month for the second NAT in each environment |
| WAF with body inspection on the ALB | Security | Performance, cost | +3 to 8 ms of latency per request; +26 USD/month |
| KMS encryption on all queues | Security | Cost, performance | KMS calls per batch; mitigated with KmsDataKeyReusePeriodSeconds |
| Blue/green with a 10 % canary | Reliability, operations | Cost, speed | Capacity doubled during the deployment; 12 min extra per deployment |
| Fargate Spot on the workers | Cost, sustainability | Reliability | Interruptions with 2 min of notice; acceptable only with retries |
| VPC endpoints instead of NAT | Security | Cost | 7 endpoints × 2 AZs come out dearer than the NAT (10-02) |
| 90-day log retention instead of indefinite | Cost, sustainability | Forensic traceability | An incident discovered 4 months later cannot be investigated |
The lesson is not "choose well". It is more concrete than that: a trade-off is only defensible if it is written down, quantified and signed off by whoever takes the risk. Multi-AZ costs twice as much; if the manager understands that the extra buys not losing a Friday's orders, the decision is his and it has been made. If nobody has told him, the decision does not exist: there is only a bill.
The architecture decision record
The tool for not losing that reasoning is called an ADR (Architecture Decision Record): a short text file, versioned alongside the code, for each relevant decision. MercadoFresco keeps them in mercadofresco-infra under docs/adr/.
Minimum format, four sections:
# ADR-014: Aurora with a writer and two readers across two zones
- **Date:** 2026-03-12
- **Status:** accepted
- **Deciders:** Marta (technical lead), management
## Context
On Fridays between 17:00 and 21:00 up to 900 orders an hour come in. With a single
database instance, a 96-second failover during that window means losing around
24 orders and, above all, the customer's trust. The business takes 31 % of its
weekly revenue in that window.
## Decision
Aurora PostgreSQL with one writer and two readers spread across eu-west-1a and
eu-west-1b, with automatic failover and continuous point-in-time recovery.
## Consequences
- Positive: failover under 30 s; the read-only queries from the catalogue and from
the reports come off the writer; ReplicaLag < 100 ms.
- Negative: the cluster cost goes from 118 to 280 USD/month (+137 %). Accepted
explicitly by management on 2026-03-12, on the grounds that a minute of downtime
on a Friday costs more than the annual difference.
- Trade-off: reliability pillar above cost pillar, consciously.
## Alternatives rejected
- Classic RDS Multi-AZ: 60-120 s failover, with no usable readers. Rejected
because of the failover time.
- A single instance with backups: rejected, unacceptable RPO in the Friday window.Three rules that make ADRs worth something:
- One file per decision, and it is never edited: if the decision changes, a new ADR is written that supersedes the previous one and the old one is marked
superseded by ADR-027. The history is the value. - They are written when the decision is made, not when somebody asks six months later.
- They always include the rejected alternatives and why. That is the part you are most grateful for when the context changes: it lets you know whether the reason for rejecting them still holds.
RTO, RPO and the four disaster recovery strategies
Of all the findings in the review, the one that makes Marta most uncomfortable is this: nobody has ever declared how long the shop may be down or how much data may be lost. Without those two numbers recovery cannot be designed, because there is no way of knowing whether what you have is enough.
The two definitions, which are constantly confused:
- RTO (Recovery Time Objective): how long the service may be down before the damage becomes unacceptable. It is measured from the start of the disruption until the service is working again. It is a business decision, not a technology one.
- RPO (Recovery Point Objective): how much data may be lost, measured in time. An RPO of 15 minutes means that, after the disaster, you accept having lost at most the last 15 minutes of transactions.
timeline
title RTO and RPO around the disaster
section Before
Last consistent backup : RPO measures backwards from the disaster
section Disaster
Disruption : Point zero
section After
Service restored : RTO measures forwards from the disaster
Put another way: the RPO looks backwards (what did I lose) and the RTO looks forwards (how long until I am back). And both cost money in a growing, non-linear way: bringing the RTO down from 8 hours to 4 is cheap; bringing it down from 30 minutes to 1 minute is extremely expensive.
The four canonical strategies, from least to most costly:
| Strategy | What exists in the secondary region | Typical RTO | Typical RPO | Extra cost on the bill |
|---|---|---|---|---|
| Backup and restore | Data only: replicated backups and IaC templates | 8-24 h | 1-24 h | +2 to 4 % |
| Pilot light | Data replicated continuously + minimal core switched off | 1-4 h | 5-15 min | +10 to 15 % |
| Warm standby | A working but scaled-down copy, switched on and receiving replication | 10-30 min | < 5 min | +30 to 40 % |
| Active-active (multi-site) | A full copy serving real traffic | Seconds | Almost zero | +90 to 110 % |
Applied to MercadoFresco's consolidated monthly bill, which is 2,237.60 USD (we will break it down in 11-03), the cost of each option is:
| Strategy | Estimated extra cost | Resulting bill | What would have to be built |
|---|---|---|---|
| Backup and restore | ≈ 70 USD/month | 2,308 USD | Aurora and S3 backups replicated to eu-west-3; the templates from 09-01, tested |
| Pilot light | ≈ 270 USD/month | 2,508 USD | The above + an Aurora replica in the other region + replicated ECR images |
| Warm standby | ≈ 780 USD/month | 3,018 USD | The above + an ALB and 2 Fargate tasks running + Route 53 with health checks |
| Active-active | ≈ 2,200 USD/month | 4,438 USD | Aurora Global Database with writes in two regions, or partitioning by country |
Note that these figures are for the secondary region, and that to all of them you have to add the cost that never appears in the table: the work of keeping that second region consistent with the first. A warm standby that has not been updated for four months is not a warm standby, it is a false sense of security.
MercadoFresco's recovery decision
Marta takes the conversation to the manager with two concrete questions, not with a table of services:
- "If the whole Ireland region goes down — which happens very rarely, but it happens — how many hours can the shop stay shut before the damage is serious?"
- "How many minutes of orders can we afford to lose?"
The answers, after discussing them: 8 hours of RTO and 15 minutes of RPO for the ordering system. The manager's reasoning is defensible: MercadoFresco delivers fresh produce within 24 hours; an 8-hour outage delays a day of deliveries, is annoying and costs money, but it does not close the company down. Losing orders that have already been confirmed and charged for, on the other hand, is serious, because it means charging without delivering.
Those two figures alone rule out two of the four strategies:
- Active-active and warm standby are oversized for an RTO of 8 hours. Nobody is asking to pay 780 or 2,200 USD a month to go from 8 hours down to 20 minutes.
- Backup and restore fits the RTO (8-24 h is right at the limit) but fails on the RPO if the backups are daily.
The resulting decision is a reasoned hybrid: reinforced backup and restore.
| Element | Configuration | Covers |
|---|---|---|
| Aurora backups | Continuous PITR + daily backup replicated to eu-west-3 with AWS Backup |
RPO of 5 min inside the region; 24 h outside it |
| Replicated snapshots | Cross-region copy every 6 h, encrypted with a multi-region key | RPO of 6 h in a regional disaster |
| S3 | Cross-region replication of mercadofresco-catalogo-fotos and -copias-basedatos |
RPO of minutes |
| DynamoDB | PITR backups; no global table for now | RPO of 5 min |
| Infrastructure | red-mercadofresco.yaml and aplicacion-mercadofresco.yaml parameterised by region |
Rebuild in < 2 h |
| Images | Replication of mercadofresco/tienda to ECR in eu-west-3 |
No dependency on the failed region |
| DNS | mercadofresco.example in Route 53, a global service |
Target change in minutes |
And here comes the part that separates a plan from a document: the real declared RPO is 6 hours in the event of a regional disaster, not 15 minutes. Marta writes it exactly like that, in those words, in ADR-021, and gets it signed. The option of bringing it down to 15 minutes exists — continuous replication to the other region — and costs about 200 USD more a month. Management decides to accept the residual risk for now and to revisit it when they open outside Spain.
Three additional commitments that close the finding:
- A half-yearly full restore drill in
eu-west-3, against the clock and minuted. If the measured RTO exceeds 8 hours, the strategy is reconsidered. - A quarterly AZ failure drill with AWS Fault Injection Service in pre-production, which is a far more likely risk than the regional one.
- The first test happens before December, because running it during the Christmas season would be reckless.
The AWS Well-Architected Tool: workloads, milestones and lenses
The Well-Architected Tool is a free console service that turns the document into a workflow with state. The steps:
1. Define the workload. Name, description, environment (production or pre-production), regions, accounts involved, industry and owner. MercadoFresco defines:
# Create the workload from the CLI, in the management account 999988887777
aws wellarchitected create-workload \
--workload-name "mercadofresco-tienda-produccion" \
--description "Online fresh produce shop: catalogue, orders and delivery" \
--environment PRODUCTION \
--aws-regions eu-west-1 \
--account-ids 111122223333 555566667777 \
--review-owner "[email protected]" \
--industry-type Retail \
--lenses wellarchitected serverless \
--tags Proyecto=mercadofresco,Entorno=produccion,Propietario=martaA note on the options that matter:
--environment PRODUCTIONchanges the weight of some recommendations: the tool is more demanding with a production workload.--account-idsincludes the tooling account555566667777because the pipeline is part of the workload: there is no point reviewing operational excellence while ignoring who deploys.--lensesapplies the base lens and the serverless one from the outset, because MercadoFresco has Lambda and Fargate on the critical path.--tagstags the review itself, consistent with the course convention. Yes: even the review gets tagged.
2. Answer the questionnaire. For each question you tick the best practices that are really in place and you can add a note. There are two classic traps:
- Ticking out of optimism. "Yes, we have backups" is not the same as "we successfully restored a backup last month". If it has not been tested, it is not ticked.
- Not using the notes. The note is where you write "we do this partially: production only". Without it, the review six months from now has no context.
There is also the "this question does not apply" option, with its justification. Using it is legitimate: questions about instance fleet management do not apply to an entirely serverless workload.
3. Get the improvement plan. The tool works out the risk per question (high, medium or none) and generates a list of improvement items with links to the documentation. The list can be exported and — this is the important part — turned into backlog tasks with an owner and a date. An improvement plan that lives inside the Well-Architected Tool and not on the team's board never gets executed.
4. Create a milestone. A milestone freezes the state of the answers on a date:
aws wellarchitected create-milestone \
--workload-id 3f2a9c1b7d4e5f60a1b2c3d4e5f60718 \
--milestone-name "revision-inicial-2026-08"Six months later, after a new review, the tool shows the comparison between milestones: how many high risks there were, how many there are, which were resolved and which are new. That comparison is the only honest indicator of whether the team is improving or merely running.
5. Apply lenses. A lens adds domain-specific questions and moves the bar. The most useful ones:
| Lens | What for | Useful for MercadoFresco? |
|---|---|---|
| Serverless | Lambda, API Gateway, Step Functions, queues | Yes: 6 Lambda functions and a state machine on the order path |
| SaaS | Multi-tenancy, per-customer isolation, usage metering | Not today; yes the day it sells its platform to other retailers |
| Data Analytics | Ingestion, data lake, warehouse, data governance | Yes, for the second workload: Redshift and Sara's reports |
| Machine Learning / Generative AI | Model lifecycle, bias, inference cost | Not yet; yes when product recommendations arrive |
| Financial Services / Healthcare | Sector-specific regulatory requirements | Not applicable |
| IoT | Devices, intermittent connectivity, twins | Possible in future with the delivery vehicles |
| Migration | Assessing and executing migrations | Already behind them |
One piece of advice about lenses: do not apply more than two. Each lens adds dozens of questions and the review stops getting finished. A complete review with two lenses beats an abandoned review with six.
6. Query the results through the API, which is how the follow-up gets automated:
import boto3
wa = boto3.client("wellarchitected", region_name="eu-west-1")
WORKLOAD_ID = "3f2a9c1b7d4e5f60a1b2c3d4e5f60718"
# Risk summary per pillar for the current review
summary = wa.get_lens_review(workloadId=WORKLOAD_ID, lensAlias="wellarchitected")
by_pillar = summary["LensReview"]["PillarReviewSummaries"]
print(f"{'Pillar':<28} {'High':>5} {'Medium':>6} {'No risk':>11}")
for p in by_pillar:
c = p.get("RiskCounts", {})
print(f"{p['PillarName']:<28} {c.get('HIGH', 0):>5} "
f"{c.get('MEDIUM', 0):>6} {c.get('NONE', 0):>11}")
# High risk improvement items, which are the ones that go to the backlog
improvements = wa.list_lens_review_improvements(
workloadId=WORKLOAD_ID, lensAlias="wellarchitected"
)
high = [i for i in improvements["ImprovementSummaries"] if i["Risk"] == "HIGH"]
print(f"\n{len(high)} HIGH risk items:")
for i in high:
print(f" [{i['PillarId']}] {i['QuestionTitle']}")What this script does, line by line:
get_lens_reviewreturns the state of the review for a given lens;PillarReviewSummariescarries the risk count per pillar, which is exactly the executive summary management asks for.list_lens_review_improvementsreturns the improvement items; they are filtered byRisk == "HIGH"because a 60-item plan does not get executed and a 12-item one does.- The result can be dumped to a file, used to open issues automatically, or published as a CloudWatch metric to watch it evolve. MercadoFresco does the third: a
RiesgosAltosWAmetric in theMercadoFresco/Tiendanamespace, reviewed in the monthly meeting.
The routine: who reviews, how often and what happens to the findings
A Well-Architected review done once is a report. One that is repeated is a process. The routine Marta puts in place:
| Item | MercadoFresco's decision |
|---|---|
| Who convenes it | Marta, technical lead and owner of the review |
| Who takes part | Luis (development), Sara (business and data), and the manager in the final session |
| Why the business takes part | Because RTO, RPO, budget and priority are business decisions, not technical ones |
| How often | A full review every 6 months; a single-pillar review every quarter |
| When else, off the calendar | Before a big change (new region, new country), after a serious incident, and before the Christmas season |
| Duration | 2 sessions of 2 hours; any more and people stop thinking |
| Output | A milestone created + between 8 and 15 improvement items with an owner and a date on the board |
| What happens to risks that will not be fixed | They are accepted in writing, signed by whoever takes the risk and with a review date |
| Indicator that it is working | Number of high risks compared between consecutive milestones |
Two rules that stop the process from dying:
- No improvement item without an owner and a date. "We ought to do load tests" is not a task; "Luis runs a load test at 1,400 orders/hour in pre-production before 30 October" is.
- A maximum of five improvements in flight at once. A plan with 40 open actions amounts to no action in progress.
Periodic review versus continuous checking: Trusted Advisor and Config
The Well-Architected review is periodic, deep and human. It is no use for spotting that somebody opened a security group to the world on Tuesday afternoon. That is what the tools you already know from module 5 are for, and it is worth seeing how the three fit together:
| Tool | Nature | Cadence | What it detects | What it does not detect |
|---|---|---|---|---|
| Well-Architected Tool (11-01) | Human questionnaire | Half-yearly | Missing procedures, design risks, decisions never taken | Day-to-day changes |
| Trusted Advisor (05-05) | Predefined checks | Continuous (depending on the support plan) | Orphaned resources, quotas, known risks, obvious savings | Anything specific to your architecture |
| AWS Config (05-04) | Your own and managed rules | Continuous, on every change | Deviations from your rules: tags, encryption, ports, versions | Whatever you have not written as a rule |
The correct relationship is one of feedback in both directions:
graph LR WA["Well-Architected review<br/>half-yearly, human"] -->|generates new rules| CFG["AWS Config<br/>grabador-mercadofresco"] CFG -->|recurring deviations| WA TA["Trusted Advisor<br/>continuous"] -->|repeated findings| WA WA -->|one-off actions| BL["Team board"] CFG -->|automatic remediation| FIX["Fixed without intervention"]
A concrete example from MercadoFresco: the review discovers that there is no periodic permissions review. The action is not just "review the permissions this quarter" but turning the finding into a continuous check: a Config rule iam-user-unused-credentials-check and a monthly IAM Access Analyzer report. That way the finding does not come back in the review six months from now.
The general rule: every finding that can be turned into an automatic check gets turned into one. The human review should be reserved for what no tool can assess: whether the RTO suits the business, whether the team knows what to do at 3 in the morning, whether last year's decision still holds.
MercadoFresco's prioritised improvement plan
Adding up the six pillars, the initial review produces this balance:
| Pillar | High risks | Medium risks | Comment |
|---|---|---|---|
| Operational excellence | 2 | 2 | Excellent observability, weak operations |
| Security | 2 | 3 | Solid foundation; missing routine and incident response |
| Reliability | 5 | 1 | The worst: everything missing is a drill |
| Performance efficiency | 0 | 2 | The best pillar, by some distance |
| Cost optimisation | 5 | 2 | Nobody has ever looked at it |
| Sustainability | 0 | 2 | Almost entirely overlapping with cost |
| Total | 14 | 12 |
Fourteen high risks are too many to tackle at once, so they are prioritised by crossing impact with effort:
| Priority | Action | Pillar | Effort | Impact |
|---|---|---|---|---|
| 1 | Activate cost allocation tags and enforce them | Cost | Low | High |
| 2 | Analyse the full bill and execute the obvious optimisations | Cost | Low | High |
| 3 | Budgets per account, with an automatic action in development | Cost | Low | High |
| 4 | Load test of the Friday peak in pre-production | Reliability | Medium | High |
| 5 | Runbooks for the 5 most likely incidents + a defined on-call rota | Operations | Medium | High |
| 6 | Full restore drill against the clock | Reliability | Medium | High |
| 7 | Capacity commitments once optimisation is done | Cost | Low | Medium |
| 8 | AZ failure drill with Fault Injection Service | Reliability | High | Medium |
| 9 | Automated quarterly permissions review | Security | Low | Medium |
| 10 | Security incident response plan and isolation test | Security | High | Medium |
Why the cost pillar comes first, even though reliability has the same number of high risks and sounds more important. Three concrete reasons:
- It is the only pillar nobody has a single figure for. You cannot prioritise what you do not measure, and the reliability decisions that come next — pilot light or warm standby? — are cost decisions dressed up as technical ones.
- The actions are low effort with immediate effect. Activating tags, deleting orphans and switching environments off at night are hours of work, not weeks, and they free up budget.
- The budget freed up funds the rest of the plan. The money no longer thrown away on development at night is exactly what pays for the cross-region backups and the load tests.
That is the thread of the five remaining lessons. 11-02 makes the bill readable through tagging and allocation. 11-03 analyses it with Cost Explorer and executes the optimisations. 11-04 sets limits and alerts with Budgets. 11-05 commits capacity with Savings Plans and reservations. And 11-06 closes the course with the integrating project.
Common Mistakes and Tips
Mistake: treating the review as an exam you have to pass. The team ticks best practices it does not fully meet so that the report comes out green. Tip: nobody outside reads the report. The only thing you lose by over-ticking is the chance to find the problem before it finds you on a Friday at 19:00.
Mistake: reviewing "the whole company" as a single workload. You end up with a questionnaire that is impossible to answer because the right answer is "it depends on the system". Tip: a workload is a set of components that deliver business value together and share an owner. MercadoFresco has two: the shop and analytics.
Mistake: turning the improvement plan into a document and filing it. Six months later, the new review finds exactly the same things. Tip: improvement items come out of the tool the same day and go onto the team's board with an owner and a date, or they do not exist.
Mistake: confusing "we have backups" with "we know how to restore". It is the most repeated finding in the reliability pillar across the whole industry. Tip: an untested backup is a hypothesis. Restore once, against the clock and in a clean environment, and write down the real time: it is almost always triple the estimate.
Mistake: setting the RTO and the RPO from technology. The technical team decides "let's say 15 minutes" without asking anyone, and then designs an architecture that costs three times what it needs to. Tip: RTO and RPO are declared by the business answering two questions in plain language, and they are written into a signed ADR.
Mistake: buying the most expensive recovery strategy "just in case". An unnecessary active-active doubles the bill and, worse, doubles the maintenance work; it usually ends up out of sync and providing false security. Tip: start with the strategy that meets the declared RTO and RPO, and move up when the business raises its demands, not before.
Mistake: applying six lenses at once. The review goes from 60 questions to 300 and is abandoned in the second session. Tip: the base lens plus one or two specific ones. More can be added in the next review.
Tip: use the notes on each question as memory. "Met in production only, pending in pre-production, see ADR-018" turns the next review into half an hour of work instead of two hours of archaeology.
Tip: measure the process, not just the architecture. The useful indicator is not "we have 14 high risks" but "we had 14 and now we have 6". Milestones exist for exactly that.
Tip: accept risks in writing and with an expiry date. "We accept a regional RPO of 6 h until we open in Portugal, review in March" is a professional decision. "We'll look at it some time" is not.
Exercises
Exercise 1: reviewing a pillar and prioritising
A fictitious company, LibreríaAtlas, sells books online with a much simpler architecture than MercadoFresco's: two EC2 instances behind an ALB, a single-AZ RDS MySQL, S3 for the covers, no CDN, deployments over SSH and automatic daily RDS backups with 7 days of retention. They have never restored a backup. They have no tags. The team is two people.
- Write five findings from the reliability pillar with their risk (high or medium).
- State which one you would tackle first and why, knowing that the budget is limited.
- Propose a reasonable RTO and RPO and say which recovery strategy would fit.
Exercise 2: documenting a trade-off between pillars
MercadoFresco is considering adding request body inspection in the ALB's WAF to detect injection attempts in the order form. Measured in pre-production: it adds between 4 and 9 ms of latency per request and about 12 USD a month. The shop has a TiempoConfirmacionPedido p99 target below 900 ms and is currently at 840 ms.
- Identify which pillars go up and which go down.
- Write the complete ADR with context, decision, consequences and rejected alternatives.
- State which metric you would watch afterwards and what would make you reverse the decision.
Exercise 3: choosing a recovery strategy with numbers
MercadoFresco's manager changes his mind: after reading a news item about a competitor's regional outage, he asks for an RTO of 1 hour and an RPO of 10 minutes.
- Which strategies in the table are still valid with those objectives?
- Work out the impact on the monthly bill of 2,237.60 USD of the cheapest option that meets them, in absolute value and as a percentage.
- Prepare three questions you would put to the manager before approving the spend.
Solutions
Solution to exercise 1
(1) Five reliability findings in LibreríaAtlas:
| Finding | Risk | Reason |
|---|---|---|
| RDS MySQL in a single AZ | High | The failure of one zone brings down the entire database, with no failover |
| A backup has never been restored | High | The backups are an unverified hypothesis; they may not even work |
| Deployment over SSH, manual and with no rollback | High | A non-repeatable change with no way back; it is the most frequent cause of outages |
| There is no declared RTO or RPO | High | Without them you cannot judge whether daily backups are enough |
| There is no auto scaling and no capacity test: 2 fixed instances | Medium | A campaign or a viral review takes the site down; the impact is one-off |
(2) What to tackle first: the tested restore. It is not the intuitive answer — intuition says "Multi-AZ" — but it is the right one on a limited budget, for three reasons: it costs nothing (only time), it validates or invalidates the whole backup strategy in one go, and if it turns out the backups are no good, it completely changes the priority of everything else. Multi-AZ is second, and it already costs money: it roughly doubles the cost of the RDS instance.
(3) Reasonable RTO and RPO. An online bookshop is not a life-critical service: an RTO of 4 hours and an RPO of 24 hours are perfectly defensible if the business accepts them — with daily backups, the real RPO is already 24 h. With those objectives, the right strategy is backup and restore, reinforced with two cheap things: replicating the snapshots to another region and having the infrastructure described in CloudFormation so it can be rebuilt without depending on anyone's memory. If the business demanded an RPO of 1 hour, the answer would not be to change strategy but to enable more frequent backups or move to an engine with point-in-time recovery.
Solution to exercise 2
(1) Pillars affected:
- Security goes up: extra protection against injection at the exact point where user data comes in, in a layer separate from the application's validation (defence in depth).
- Performance efficiency goes down: between 4 and 9 ms per request. With the p99 at 840 ms and the target at 900, the remaining headroom goes from 60 ms to about 51 ms in the worst case. It still meets the target, but with less slack.
- Cost optimisation goes down: 12 USD a month, 0.5 % of the bill. Marginal.
- Neutral for reliability, with one nuance: a badly tuned WAF rule that blocks legitimate requests does affect perceived reliability. That is the real risk of this decision, not the latency.
(2) ADR:
# ADR-022: Request body inspection in waf-mercadofresco-alb
- **Date:** 2026-08-14
- **Status:** accepted
- **Deciders:** Marta, Luis
## Context
The order form accepts free text in the delivery notes field. The application's
validation covers the known case, but there is no independent second layer. The
current WAF only inspects headers and query string parameters. Measured in
pre-production over 5 days: +4 to +9 ms per request, +12 USD/month. The p99 of
TiempoConfirmacionPedido is at 840 ms against a target of 900 ms.
## Decision
Enable body inspection (up to 8 KB) in waf-mercadofresco-alb, with the managed
rule group for SQL injection and XSS, deployed first in count mode for 7 days
and then in block mode.
## Consequences
- Positive: defence in depth at the point where user data enters; visibility of
real attempts in the WAF logs.
- Negative: p99 headroom cut from 60 ms to ~51 ms; +12 USD/month; risk of false
positives blocking legitimate orders with unusual characters.
- Mitigation of the main risk: 7 days in count mode before blocking, and a review
of the matches with Luis before switching to block mode.
## Alternatives rejected
- Application validation only: rejected, it gives neither defence in depth nor
visibility of the attempts.
- Inspection in waf-mercadofresco-cdn as well: rejected for now, it doubles cost
and latency without adding coverage for this particular form.
- Restricting the field to alphanumeric characters: rejected, it degrades the
experience (addresses with hyphens, apostrophes and door numbers).(3) What to watch and what would reverse the decision. Three things are watched: the p99 of TiempoConfirmacionPedido on the mercadofresco-produccion dashboard, the rate of requests blocked by the WAF, and the number of orders confirmed per hour compared with the previous week. The decision is reversed if the p99 goes above 900 ms in a sustained way, or if PedidosConfirmados drops inexplicably, which would be the sign of false positives blocking real purchases. The reversal is cheap: putting the rule back into count mode is a one-field change.
Solution to exercise 3
(1) Strategies valid with RTO 1 h and RPO 10 min:
- Backup and restore: does not meet them. Typical RTO of 8-24 h and, with cross-region backups every 6 h, an RPO of 6 h.
- Pilot light: meets them, just. RTO of 1-4 h — you have to work at it to stay at the bottom of the band — and RPO of 5-15 min with continuous Aurora replication to the other region.
- Warm standby: meets them comfortably (RTO 10-30 min).
- Active-active: meets them with room to spare and is unnecessary for these objectives.
The honest answer is that pilot light meets the RPO for certain and the RTO only if it is rehearsed. An RTO of 1 hour with pilot light demands full automation of the start-up: no rebuilding by hand. It is the option to propose, on the explicit condition of a drill that proves it.
(2) Impact on the bill:
Current bill 2,237.60 USD/month Pilot light (+12 %) + 268.51 USD/month ------------------------------------------------------ Resulting bill 2,506.11 USD/month Annual increase +3,222 USD/year
And there is a cost that is not in that figure and is worth putting on the table: the recurring work. Keeping the second region aligned, running the half-yearly drill and fixing whatever the drill breaks come to something like 6 to 10 days of work a year, which at internal cost exceeds the infrastructure cost.
(3) Three questions for the manager:
- "Where does the requirement come from?" If it comes from a news item about a competitor, perhaps the real risk that worries him is not the regional one — which is rare — but something far more likely: a bad deployment, an accidental deletion or an attack. Those are mitigated with automatic rollback, deletion with retention and a WAF, all of which already exist and cost far less.
- "How much does MercadoFresco bill in 8 hours?" That is the number that turns the conversation into an investment decision. If it is 4,000 USD and the probability of a regional outage is once every several years, spending 3,222 USD a year has to be discussed with those two numbers in front of you.
- "Do we also take on the commitment to rehearse it twice a year?" Without that condition, the right answer is not to build it: an untested pilot light gives you the same availability as having nothing, but with a bill.
Conclusion
MercadoFresco no longer has just an architecture: it has an audit of that architecture, done with method rather than intuition.
You know what the Well-Architected Framework is and, above all, what it is not: not a certification, not a shopping list of services, not a compliance audit. It is a collection of questions of the form "how do you do X?", grouped into six pillars — operational excellence, security, reliability, performance efficiency, cost optimisation and sustainability — each with best practices that are ticked only when they are genuinely met. And you know that the unit of review is the workload, not the company.
You have MercadoFresco's complete review pillar by pillar, with 14 high risks and 12 medium ones, and with a pattern that repeats in almost every good technical team: excellent observability alongside operations with no runbooks, an elastic architecture that has never been tested under load, backups that have never been restored and a cost pillar that literally nobody has a single figure for. With the findings written as findings — "there is no declared RTO", "the failure of an AZ has never been simulated", "the development account has no spending limit", "nobody has reviewed the permissions since they were created" — and with their risk and their action beside them.
You have the trade-offs between pillars quantified rather than guessed at: Multi-AZ triples Aurora's compute, the WAF with body inspection adds 4 to 9 ms, Spot swaps cost for interruptions, VPC endpoints buy security and come out dearer than the NAT. And the tool that lets that reasoning survive the passage of time: the architecture decision record, one file per decision, versioned, never edited, and always including the rejected alternatives and why.
You have RTO and RPO genuinely understood — one looks forwards, the other backwards — and the four recovery strategies with their real cost on the bill: backup and restore (+2-4 %), pilot light (+10-15 %), warm standby (+30-40 %) and active-active (+90-110 %). And MercadoFresco's decision, taken by the business and not by the technical team: an RTO of 8 hours and an RPO of 15 minutes, resolved with reinforced backup and restore, with the residual risk written down without adornment — the real regional RPO is 6 hours — and with two drills committed to the calendar.
And you have the routine: who convenes it, who takes part — the business included, because RTO, RPO and budget are not technical decisions — how often, how long it lasts and what comes out of it; the milestones for comparing today's review with the one six months from now, which is the only honest indicator of improvement; the specialised lenses with the advice not to apply more than two; and the division of roles between the half-yearly human review, the continuous checks of Config and the alerts of Trusted Advisor, with the rule that binds them: every finding that can be turned into an automatic check gets turned into one.
The result is a prioritised improvement plan of ten actions with an owner and a date. And its first item is neither the flashiest nor apparently the most urgent: it is the cost optimisation pillar, because it is the only one with not a single figure behind it, because its actions are low effort with immediate effect, and because the budget it frees up is exactly what funds the load tests and the cross-region backups in the rest of the plan.
So the manager's question is still on the table, now with a method behind it to answer it. How much does all this cost and is it money well spent? The trouble is that today the answer would be a single figure on a one-line bill, and you cannot decide anything with that: you do not know how much is production and how much is development, nor how much the catalogue costs against orders, nor how much of that figure belongs to Madrid and how much to Seville, nor what part could be cut without anyone noticing.
In 11-02, "Tagging and cost allocation", that problem is solved first: the five mandatory tags from the course stop being a convention written in a document and become activated dimensions, enforced by policy and audited, capable at last of answering who spends what. Without that step, everything that comes afterwards — analysing, budgeting and committing — is done blind.
AWS Course
Module 1: Introduction to AWS
- What Is AWS?
- Setting Up Your AWS Account
- AWS Global Infrastructure
- The AWS Management Console
- AWS CLI and SDKs
Module 2: Core AWS Services
Module 3: Networking and Content Delivery
Module 4: Security and Identity
- AWS Identity and Access Management (IAM)
- AWS Key Management Service (KMS)
- Secrets Manager and Parameter Store
- AWS Shield
- AWS WAF
Module 5: Monitoring and Management
Module 6: Databases
Module 7: Application Integration
- Amazon SQS
- Amazon SNS
- Amazon EventBridge
- AWS Step Functions
- Integration Patterns: Idempotency, Retries and Dead-Letter Queues
