Sub topic 14
Lenses for specialized workloads
This chapter assumes you know the six pillars, how questions and best practices are organized, and how risk levels work. It also assumes you have created a workload in the AWS Well-Architected Tool. If any of that is unfamiliar, review the earlier chapters first.
What a lens is
The core Well-Architected Framework is general. It applies to a web shop, a data pipeline and a batch job alike. Some workloads need more specific questions. A machine learning system has training and inference concerns that a generic review does not cover.
A lens is an extension of the framework for a particular technology or industry. It keeps the same six pillars. It adds its own questions, best practices and design principles for that domain. In the Well-Architected Tool, each lens is reviewed in its own right, with its own answers and its own risk counts.
The default lens is the AWS Well-Architected Framework lens, with the alias wellarchitected. Every workload you saw in the earlier command examples used it.
Common lenses
AWS publishes lenses for several domains. The list changes over time, so check the Tool for the current catalog.
| Lens | Use it when the workload is |
|---|---|
| Serverless Applications | built on Lambda, API Gateway, and similar managed services |
| SaaS | a multi-tenant software-as-a-service product |
| Machine Learning | training or serving models |
| Data Analytics | an analytics or data lake platform |
| Financial Services Industry | subject to financial regulation and resilience expectations |
| Sustainability | a workload where environmental impact is a main concern |
You can also write a custom lens. A custom lens encodes your own organization's standards, such as internal security rules, as questions and best practices that teams answer in the same review flow.
Choosing a lens
Start with the Framework lens. Then add a lens only when it matches how the workload is built or the rules it must follow.
- Identify the dominant technology. A system built mostly from Lambda functions and managed services suggests the Serverless Applications lens.
- Identify the business model or industry. A multi-tenant product suggests the SaaS lens. A regulated bank suggests the Financial Services lens.
- Add lenses one at a time. Each lens adds questions, so a workload with four lenses takes much longer to review.
Lenses add to the Framework lens. They do not replace it, because the general questions still apply.
Applying lenses in the Tool
You choose lenses when you create the workload, using the --lenses option. The earlier example passed only wellarchitected. The command below adds a second lens. The alias serverless is the published alias for the Serverless Applications lens. Check the alias with list-lenses if your Region shows a different one.
aws wellarchitected list-lenses
aws wellarchitected create-workload \
--workload-name "orders-api" \
--description "Customer order processing API" \
--environment PRODUCTION \
--lenses wellarchitected serverless \
--aws-regions us-east-1 \
--review-owner "[email protected]"For a workload that already exists, attach a lens with associate-lenses.
aws wellarchitected associate-lenses \
--workload-id <workload-id> \
--lens-aliases serverlessWhen you list answers, name the lens in --lens-alias. Each lens returns its own question set.
aws wellarchitected list-answers \
--workload-id <workload-id> \
--lens-alias serverless \
--pillar-id reliabilityThe risk counts and improvement items are tracked per lens. Milestones capture the state across the lenses attached to the workload at the time you save them.
Common mistakes
- Attaching every available lens. This produces a long review that teams abandon before they finish.
- Skipping the Framework lens. The specialized lens assumes the general practices are covered.
- Treating a lens as a compliance certificate. A lens is a structured review, and its output depends on honest answers.
- Using a stale alias. Lens versions are updated, so confirm the current alias with
list-lenses.
Exercise
A team runs a multi-tenant billing product built entirely on Lambda and DynamoDB. Which lenses should they attach, and why do they still need the Framework lens?
Show answer
They should attach the Framework lens plus the SaaS lens for multi-tenancy and the Serverless Applications lens for the Lambda-based design. The Framework lens stays because lenses extend it rather than replace it, so the general questions across all six pillars still apply.
Exercise
Which AWS CLI command adds a lens to a workload that already exists?
Show answer
aws wellarchitected associate-lenses --workload-id <workload-id> --lens-aliases <alias>.