Platform Engineering · Lesson 154

The AWS Well-Architected Framework: Six Pillars and a Real Review

The AWS Well-Architected Framework is AWS's checklist for asking whether a workload is built well, in six pillars: operational excellence, security, reliability, performance efficiency, cost optimization, and sustainability. Each pillar has design principles and review questions; the AWS Well-Architected Tool turns the questions into a review that records high- and medium-risk issues and an improvement plan. This lesson reviews one orders service pillar by pillar before launch, and shows what happens when a pillar is skipped: a single-zone database that takes the shop down for nine hours, and a fleet sized for a peak that never came.

Difficulty: Advanced · Know this first: Lesson 153, Lesson 145

What you will learn

By the end of this lesson you can work at four levels:

This page teaches it with a plain-language analogy, an animated diagram with normal and failure scenarios, a simulator, a quiz, basic, intermediate, advanced, and master checks, the expert detail ("Go deeper"), a production incident, a hands-on lab with commands and their output, and a production design exercise.

Run it as:

When it breaks, I check

One thing to remember

Where the time goes

This bar adds up hours of review work for one workload. It is a worked example, not a measurement. The reliability and cost hops are where a skipped pillar turns into an outage or a bill.

Try it: choose the design and see the risks

Pick how the database and the compute are deployed, and how often the workload is reviewed. The workload loses about $40,000 an hour when orders are down.

1high-risk issues
9 hdown in a zone event
$18kmonthly bill

Check yourself

Three questions. No score is saved anywhere — this is just you against the material.

Basic to master

Using the AWS framework grows in four levels: knowing the pillars, running a review, fixing what it finds, and running reviews across an organisation.

Basic — Know the six pillars

At the basic level you can name the pillars and the question each one asks.

  • Operational excellence (run and improve), security (protect), reliability (recover), performance efficiency (right resources), cost optimization (pay for value), sustainability (use less).
  • Design principles per pillar, and lenses for workload types.
  • High- and medium-risk issues.

Where it breaks: treating the framework as a certification instead of a set of questions.

Try it: Basic

Which pillar asks "how do you test recovery procedures?"

Now do it: Read the reliability pillar's design principles.

Intermediate — Run a review

At the intermediate level you run a review with the team that owns the workload.

  • Define the workload, its outcome, Regions, and numbers.
  • Answer every question with evidence; mark what does not apply, with a reason.
  • Apply the lenses that fit (Serverless, SaaS, machine learning, generative AI).

Try it: Intermediate

A question does not apply to the workload. What do you do?

Now do it: Run the review on one workload with its owners.

Advanced — Fix and automate

At the advanced level reviews lead to changes, and checks run continuously.

  • An improvement plan with owners and dates; HRIs cleared before launch.
  • Continuous checks: AWS Config rules and conformance packs, Security Hub, Trusted Advisor, Compute Optimizer.
  • Milestones after each big change to show progress.

Try it: Advanced

How do you stop a fixed risk from coming back?

Now do it: Turn one HRI into a Config rule.

Master — Reviews across the organisation

At the master level the framework is how the organisation designs, not an event.

  • Review templates and profiles with shared answers; custom lenses for your own standards.
  • Reviews before launch and each quarter for critical workloads; HRI counts reported to leadership.
  • Guardrails in the landing zone (SCPs, Config) so new workloads start compliant.

Trade-off: reviews take a day or two of senior time per workload, and catch the failures that cost far more.

Try it: Master

You have 80 workloads and 6 reviewers. How do you scale reviews?

Now do it: Draft a custom lens with your three most important standards.

Go deeper

The review through the API: list risks and improvements for a workload, and save a milestone. Run these with read access first; create-milestone writes to the Tool only, not to the workload.

aws wellarchitected list-workloads --query "WorkloadSummaries[].[WorkloadName,WorkloadId,RiskCounts]"
aws wellarchitected get-lens-review --workload-id $WID --lens-alias wellarchitected \
  --query "LensReview.PillarReviewSummaries[].[PillarName,RiskCounts]"
aws wellarchitected list-lens-review-improvements --workload-id $WID --lens-alias wellarchitected \
  --query "ImprovementSummaries[?Risk=='HIGH'].[PillarId,QuestionTitle]" --output table
aws wellarchitected create-milestone --workload-id $WID --milestone-name launch \
  --client-request-token "$(uuidgen)"

The design principles in one line each:

AWS revises the framework and its wording from time to time; read the current version before a review. How the three clouds' frameworks line up:

AWSAzureGoogle Cloud
FrameworkAWS Well-Architected FrameworkAzure Well-Architected FrameworkGoogle Cloud Well-Architected Framework (called the Architecture Framework until 2024)
PillarsSix: operational excellence, security, reliability, performance efficiency, cost optimization, sustainabilityFive: reliability, security, cost optimization, operational excellence, performance efficiency; sustainability is separate guidanceSix: operational excellence; security, privacy, and compliance; reliability; cost optimization; performance optimization; sustainability
Inside each pillarDesign principles, best practices, and review questionsDesign principles, a checklist, recommendations, and trade-offs with the other pillarsPrinciples and recommendations
Specialised guidanceLenses (for example serverless, SaaS, machine learning, generative AI)Workload guidance (for example AI, mission-critical, SaaS) and service guides per Azure servicePerspectives (for example AI and ML, financial services)
Review toolAWS Well-Architected Tool: questions per pillar, high- and medium-risk issues, milestones, an APIAzure Well-Architected Review, an assessment in Microsoft Assessments, with a score and recommendations per pillarNo separate review tool; the framework's recommendations, Architecture Center, and Active Assist
Automated recommendationsTrusted Advisor (the number of checks depends on the support plan), Compute OptimizerAzure Advisor, grouped by reliability, security, performance, cost, and operational excellence, with an Advisor scoreActive Assist: Recommender (rightsizing, idle resources, IAM) and insights
Carbon dataCustomer Carbon Footprint ToolEmissions Impact Dashboard; carbon optimization in the portalCarbon Footprint, with export to BigQuery; low-carbon indicators per region
Policy and guardrailsOrganizations service control policies, AWS Config rules and conformance packsAzure Policy, initiatives, management groupsOrganization Policy, constraints, folders
Landing zone guidanceAWS Control Tower, the Landing Zone AcceleratorCloud Adoption Framework Azure landing zonesGoogle Cloud setup checklist and enterprise foundations blueprint

Where they differ, not just in names: Azure keeps sustainability out of its five pillars and in separate guidance; Google Cloud folds privacy and compliance into its security pillar; AWS has the most formal review process (questions, risk levels, milestones) in its own tool. The ideas line up closely; the services and the detail do not, so review a workload against the framework of the cloud it runs on, and use the others for ideas.

One time it broke

This is a composite of a failure pattern that keeps repeating; the details are illustrative. The pillar that was "for later".

Timeline

  • Launch − 2 weeksThe team runs a Well-Architected review and answers five pillars. Reliability is marked "to do after launch".
  • Launch + 3 weeks, 02:10An event affects the Availability Zone that hosts the only RDS instance. The orders API returns errors.
  • 02:40No standby exists. The team decides to restore the latest automated snapshot into another zone; nobody has done it before.
  • 11:10Orders resume after nine hours: the restore, parameter group and secret fixes, and a DNS change.

What changed after

The database is Multi-AZ, restores are rehearsed every quarter, launches are blocked while any high-risk issue is open, and no pillar may be left unanswered in a pre-launch review.

Try it yourself, from scratch

Everything here runs on any Linux machine: your own laptop, WSL on Windows (run wsl --install in PowerShell once), or a small cloud VM. The Python needs only Python 3 and its standard library; check that you have it with python3 --version.

Before you start: The AWS CLI v2 with read access to an account (aws sts get-caller-identity should answer). A workload defined in the Well-Architected Tool for the review steps; the other steps work in any account.

1. Linux commands

Type each one, read what it prints, and compare it with the note above it.

  1. List the workloads defined in the Well-Architected Tool, with their risk counts.

    aws wellarchitected list-workloads --query "WorkloadSummaries[].[WorkloadName,WorkloadId,RiskCounts]" --output json

    Options: --query picks fields (JMESPath); RiskCounts holds HIGH, MEDIUM, NONE, UNANSWERED, NOT_APPLICABLE.

    Expect: Each workload with its counts; UNANSWERED above zero means a pillar was skipped. Read-only: it lists or describes, and changes nothing.

  2. Find the reliability pillar's most common high-risk issue: databases in one Availability Zone.

    aws rds describe-db-instances --query "DBInstances[].[DBInstanceIdentifier,Engine,MultiAZ]" --output table

    Expect: One row per database; False in the last column is a single-zone instance. Read-only: it lists or describes, and changes nothing.

  3. Find long-lived access keys, a frequent security finding.

    aws iam list-users --query "Users[].UserName" --output text | tr "\t" "\n" | while read u; do
      aws iam list-access-keys --user-name "$u" --query "AccessKeyMetadata[].[UserName,AccessKeyId,CreateDate,Status]" --output text
    done

    Options: Loops over users and lists each one's access keys with their creation date.

    Expect: Keys that are old and active are candidates to replace with roles. Read-only: it lists or describes, and changes nothing.

  4. Check the cost pillar's first practice: is there a budget with an alert?

    aws budgets describe-budgets --account-id "$(aws sts get-caller-identity --query Account --output text)" --query "Budgets[].[BudgetName,BudgetLimit.Amount,BudgetLimit.Unit]" --output table

    Expect: Your budgets, or an empty result, which is itself a finding. Read-only: it lists or describes, and changes nothing.

2. Python: waf_review.py

This program runs a small Well-Architected review: each pillar's questions have best practices marked present or missing, missing ones become high or medium risks, an unanswered pillar shows up as unanswered rather than safe, and the improvement plan orders the risks by impact and effort. Save it as waf_review.py, then run it.

# waf_review.py
REVIEW = {  # pillar: [(question, best practice, in place?, risk if missing, effort 1-3)]
    "Operational excellence": [("How do you deploy changes?", "small, reversible, automated deployments", True, "MEDIUM", 2)],
    "Security": [("How do you manage identities for workloads?", "no long-lived access keys", False, "HIGH", 1),
                 ("How do you protect data at rest?", "encryption with KMS on every store", True, "HIGH", 1)],
    "Reliability": None,   # skipped "to save time"
    "Performance efficiency": [("How do you select compute?", "load tested at peak", True, "MEDIUM", 2)],
    "Cost optimization": [("How do you govern usage?", "budgets with alerts", False, "HIGH", 1),
                          ("How do you match supply to demand?", "autoscaling", False, "MEDIUM", 2)],
    "Sustainability": [("How do you take advantage of utilisation?", "utilisation above 50% on average", False, "MEDIUM", 2)],
}
IMPACT = {"HIGH": 3, "MEDIUM": 2}

risks, counts = [], {"HIGH": 0, "MEDIUM": 0, "NONE": 0, "UNANSWERED": 0}
for pillar, questions in REVIEW.items():
    if questions is None:
        counts["UNANSWERED"] += 1
        print(f"{pillar:<24} UNANSWERED: no risks recorded, which does not mean none exist")
        continue
    for q, practice, present, level, effort in questions:
        if present:
            counts["NONE"] += 1
        else:
            counts[level] += 1
            risks.append((IMPACT[level] / effort, level, pillar, practice, effort))
    found = [r for r in risks if r[2] == pillar]
    print(f"{pillar:<24} {len(found)} risk(s)" + (": " + "; ".join(f"{r[1]} {r[3]}" for r in found) if found else ""))
print()
print("risk counts:", counts)
print("launch:", "BLOCKED" if counts["HIGH"] or counts["UNANSWERED"] else "allowed",
      f"({counts['HIGH']} high-risk issues, {counts['UNANSWERED']} pillar unanswered)")
print()
print("improvement plan, highest impact per unit of effort first:")
for i, (score, level, pillar, practice, effort) in enumerate(sorted(risks, reverse=True), 1):
    print(f"  {i}. [{level:<6}] {pillar}: {practice} (effort {effort})")

Run it, and you should see this output:

$ python3 waf_review.py
Operational excellence   0 risk(s)
Security                 1 risk(s): HIGH no long-lived access keys
Reliability              UNANSWERED: no risks recorded, which does not mean none exist
Performance efficiency   0 risk(s)
Cost optimization        2 risk(s): HIGH budgets with alerts; MEDIUM autoscaling
Sustainability           1 risk(s): MEDIUM utilisation above 50% on average

risk counts: {'HIGH': 2, 'MEDIUM': 2, 'NONE': 3, 'UNANSWERED': 1}
launch: BLOCKED (2 high-risk issues, 1 pillar unanswered)

improvement plan, highest impact per unit of effort first:
  1. [HIGH  ] Security: no long-lived access keys (effort 1)
  2. [HIGH  ] Cost optimization: budgets with alerts (effort 1)
  3. [MEDIUM] Sustainability: utilisation above 50% on average (effort 2)
  4. [MEDIUM] Cost optimization: autoscaling (effort 2)

3. What to notice

4. Advanced: every step as one Bash script

The same Linux steps, made into a real script you can keep and run again. It uses the Bash features a production script needs: functions (one per step), an array of step names, arguments to choose steps, a case for options, exit codes recorded for each step, and a trap that prints a summary even when you stop it with Ctrl+C. Make a folder for this lesson (mkdir -p ~/labs/aws-well-architected-framework && cd ~/labs/aws-well-architected-framework) and save this as lab.sh.

#!/usr/bin/env bash
# The Linux steps of "The AWS Well-Architected Framework: Six Pillars and a Real Review", as one script (save it as lab.sh).
#
#   ./lab.sh          run every step, in order
#   ./lab.sh 2 4      run only steps 2 and 4
#   ./lab.sh --list   list the steps
#
# The steps share one shell, so a later step can use what an earlier one set up (a folder,
# a variable, a container): run them all in order the first time. Your own scripts should
# start with "set -euo pipefail"; this one runs teaching commands, and some of them fail on
# purpose, so it records each step's exit code instead of stopping at the first failure.

STEPS=(
  'List the workloads defined in the Well-Architected Tool, with their risk counts.'
  'Find the reliability pillar'\''s most common high-risk issue: databases in one Availability Zone.'
  'Find long-lived access keys, a frequent security finding.'
  'Check the cost pillar'\''s first practice: is there a budget with an alert?'
)

step_1() {
aws wellarchitected list-workloads --query "WorkloadSummaries[].[WorkloadName,WorkloadId,RiskCounts]" --output json
}

step_2() {
aws rds describe-db-instances --query "DBInstances[].[DBInstanceIdentifier,Engine,MultiAZ]" --output table
}

step_3() {
aws iam list-users --query "Users[].UserName" --output text | tr "\t" "\n" | while read u; do
  aws iam list-access-keys --user-name "$u" --query "AccessKeyMetadata[].[UserName,AccessKeyId,CreateDate,Status]" --output text
done
}

step_4() {
aws budgets describe-budgets --account-id "$(aws sts get-caller-identity --query Account --output text)" --query "Budgets[].[BudgetName,BudgetLimit.Amount,BudgetLimit.Unit]" --output table
}

# print a step that has to be run by hand, instead of running it
by_hand() {
  echo "  (run this one yourself: $1)"
  sed 's/^/    /'
}

RESULTS=()
run_step() {
  local n=$1 start=$SECONDS code
  printf '\n== step %d of %d: %s\n' "$n" "${#STEPS[@]}" "${STEPS[n-1]}"
  "step_$n"
  code=$?
  RESULTS+=("step $n: exit code $code, $((SECONDS - start)) s")
}

summary() {
  echo
  echo "== summary"
  local r
  for r in "${RESULTS[@]}"; do echo "  $r"; done
}

case "${1:-}" in
  -h|--help) sed -n '2,6p' "$0"; exit 0 ;;
  --list) for i in "${!STEPS[@]}"; do echo "$((i + 1)). ${STEPS[i]}"; done; exit 0 ;;
esac

[ $# -eq 0 ] && set -- $(seq 1 "${#STEPS[@]}")
for n in "$@"; do
  if ! [[ $n =~ ^[0-9]+$ ]] || (( n < 1 || n > ${#STEPS[@]} )); then
    echo "there is no step '$n'; try --list" >&2
    exit 2
  fi
done
trap summary EXIT
trap 'echo; echo "stopped with Ctrl+C"; exit 130' INT
for n in "$@"; do run_step "$n"; done

Then make it executable and run it:

chmod +x lab.sh
./lab.sh --list     # the steps
./lab.sh            # every step, then a summary of exit codes and times
./lab.sh 2 3        # only steps 2 and 3

5. Learn the basics behind it

New to a feature used above? These W3Schools pages explain each one from zero, with examples you can run in the browser.

If you remember nothing else

Design exercise

Your company runs 40 workloads on AWS and has never reviewed any of them. Design a Well-Architected review programme for the next year.

Clarifying questions to ask

Which workloads go first, and why? Who runs reviews, and who answers? Which lenses apply? What blocks a launch? How are risks tracked and reported? How do fixes become guardrails?

Rough sizing

Say 40 workloads, 8 business-critical, 4 senior engineers with a day a week each for reviews, and launches about twice a month.

Shape of the answer

Rank workloads by business impact and change rate; review the 8 critical ones in the first quarter with their teams; a review template with shared answers for the landing zone; lenses where they fit; HRIs pulled into the team trackers through the API; launches blocked while HRIs are open; quarterly milestones for critical workloads; recurring HRIs turned into Config rules, SCPs, or pipeline checks; a monthly report of open HRIs by pillar.

Trade-offs to name

Reviews cost senior time and slow some launches; templates speed them up and can hide workload-specific risks; blocking launches on HRIs creates pressure to mark things not applicable, so reviewers check the reasons.

Failure modes and how to troubleshoot them

Each row is one way this system went wrong in the diagram's scenarios. The hop number is where to look first.

ScenarioWhereEffectWhat goes wrong
Reliability skippedHop 4: ReliabilityBreaksThe reliability questions are skipped to meet the launch date. Three weeks after launch, an event in the Availability Zone that hosts the single RDS instance makes it unreachable. There is no standby; the last snapshot restore has never been tried.
Cost and sustainability skippedHop 6: Cost optimizationBreaksThe cost questions are deferred. The ECS service runs 24 large tasks around the clock, sized for a peak four times the real one, RDS is an instance size larger than needed, and logs keep forever with no lifecycle rule.
Cost and sustainability skippedHop 7: SustainabilityDegradesDeferred with cost; idle tasks and unbounded logs.

How to troubleshoot

  1. Write down the symptom and when it started: what users see, which number moved, and what changed just before (a deploy, a config change, traffic).
  2. Walk the path in order, from the first hop to the last: Workload → Operational excellence → Security → Reliability → Performance efficiency → Cost optimization → Sustainability → Risks → Improvement plan. The first hop whose evidence is wrong is where to dig.
  3. At that hop, run the read-only check from the diagram or the lab first; change nothing until the evidence points at a cause.
  4. Fix the smallest thing that restores service, or roll back the last change, and confirm the symptom is gone with the same check.
  5. Write down what you found and the check that would have caught it sooner, so the next person starts there.

Architecture review checklist

Review the design in this lesson, or your own, against these ten areas. Tick an area when you can answer its question with evidence: a number, a test, a document, or an owner. Your ticks stay in this browser.

  1. Business outcomeWhich result for users or the business does this design serve, and which number shows it is working?
  2. SecurityWho and what can reach each part, how is identity proven, and how is data protected in transit and at rest?
  3. ReliabilityWhat is the target (SLO), which single failures does the design survive, and how was that tested?
  4. PerformanceWhat latency and throughput are required at peak, and where is the first bottleneck?
  5. OperationsHow is it deployed, observed, and changed safely, and who is paged when it breaks?
  6. CostWhat does it cost per month and per unit of work (request, tenant, model call), and what grows the bill?
  7. SustainabilityWhich resources sit idle, which region and hardware does it run on, and what can scale to zero?
  8. GovernanceWhich policies, guardrails, and compliance rules apply, and how are they enforced in code?
  9. OwnershipWhich team owns each component, its budget, and its on-call, and where is that written down?
  10. Failure and recovery planWhat is the RTO and RPO, what is the runbook for a region or dependency loss, and when was it last rehearsed?

References and review

The official documentation and standards behind this lesson. Versions and defaults change; when a command or field here differs from them, trust the official page.

Last updated . Next review due by November 2027. Found something out of date? Tell me.

Saved on this device, in this browser.
Next in this series · Lesson 155
The Azure Well-Architected Framework: Five Pillars, Trade-offs, and Sustainability

The Azure Well-Architected Framework has five pillars: reliability, security, cost optimization, operational excellence, and performance efficiency. Each pillar gives design principles, a numbered checklist, recommendations, and…

Go to Lesson 155 →

Or browse the full course from the Lessons index.