AWS Custom Lenses: Customize your own Lens to see your architectures clearly
von Daman Preet Singh Walia
AWS Well-Architected tool gives you flexibility to create your own custom lenses with your own pillars, questions, best practices, and improvement plan. These lenses can be utilized in a similar way as you employ AWS provided lenses. Custom lenses can be shared across the AWS accounts to reuse.
Tailor your questions in custom lenses to meet the necessary governance within the organization for example TechOps Playbook which is an extended best practice as per BurdaForward’s Cloud architectures.
Creating a custom lens:
- Sign in to the AWS Management Console and open the AWS Well-Architected Tool console at https://console.aws.amazon.com/wellarchitected/.
- In the left navigation pane, choose Custom lenses.
- Choose Create custom lens.
- Choose Download file to download the JSON template file.
- Open the JSON template file with your favorite text editor and add the data for your custom lens. This data includes your pillars, questions, best practices, and improvement plan links. A custom lens cannot exceed 500 KB in size.
- Choose Choose file to select your JSON file.
- (Optional) In the Tags section, add any tags you want to associate with the custom lens.
- Choose Submit & Preview to preview the custom lens, or Submit to submit the custom lens without previewing. If you choose to Submit & Preview your custom lens, you can select Next to navigate through the lens preview, or select Exit Preview to go back to Custom lenses.
If validation fails, edit your JSON file and try creating the custom lens again.
After AWS WA Tool validates your JSON file, your custom lens is displayed in Custom lenses.
After a custom lens has been created, it's in DRAFT status. You must publish the lens before it can be applied to workloads or shared with other AWS accounts.
You can create up to 15 custom lenses in an AWS account.
"schemaVersion": "2021-11-01",
"name": "Company Policy ABC",
"description": "This lens provides a set of specific questions to assess compliance with company policy ABC-2021 as revised on 2021/09/01.",
Custom Lens JSON template
Lens is divided into 5 sections which are as follows. The purpose and example is provided for reference.
Follow link for detailed information: https://docs.aws.amazon.com/wellarchitected/latest/userguide/lenses-format-specification.html
1. Lens section:
This section defines the pillars associated with the custom lens. You can map your questions to the pillars of the AWS Well-Architected Framework, define your own pillars, or both. You can define up to 10 pillars in a custom lens.
"pillars": [
{
"id": "company_Privacy",
"name": "Privacy Excellence",
.
.
.
},
{
"id": "company_Security",
"name": "Security",
.
.
.
}
]
2. Pillars section:
This section defines the questions associated with a pillar. You can define up to 20 questions in a pillar in a custom lens.
"questions": [
{
"id": "privacy01",
"title": "How do you ensure HR conversations are private?",
"description": "Career and benefits discussions should occur on secure channels only and be audited regularly for compliance.",
"helpfulResource": {
"displayText": "This is helpful text for the first question",
"url": "https://example.com/poptquest01_help.html"
},
.
.
.
},
{
"id": "privacy02",
"title": "Is your team following the company privacy policy?",
"description": "Our company requires customers to opt-in to data use and does not disclose customer data to third parties either individually or in aggregate.",
"helpfulResource": {
"displayText": "This is helpful text for the second question",
"url": "https://example.com/poptquest02_help.html"
},
.
.
.
}
]
3. Questions section:
This section defines the questions associated with a pillar. You can define up to 20 questions in a pillar in a custom lens.
"choices": [
{
"id": "choice_1",
"title": "Option 1",
"helpfulResource": {
"displayText": "This is helpful text for the first choice",
"url": "https://example.com/popt01_help.html"
},
"improvementPlan": {
"displayText": "This is text that will be shown for improvement of this choice.",
"url": "https://example.com/popt01_iplan.html"
}
},
{
"id": "choice_2",
"title": "Option 2",
"helpfulResource": {
"displayText": "This is helpful text for the second choice",
"url": "https://example.com/hr_manual_CORP_1.pdf"
},
"improvementPlan": {
"displayText": "This is text that will be shown for improvement of this choice.",
"url": "https://example.com/popt02_iplan_01.html"
},
"additionalResources":[
{
"type": "HELPFUL_RESOURCE",
"content": [
{
"displayText": "This is the second set of helpful text for this choice.",
"url": "https://example.com/hr_manual_country.html"
},
{
"displayText": "This is the third set of helpful text for this choice.",
"url": "https://example.com/hr_manual_city.html"
}
]
},
{
"type": "IMPROVEMENT_PLAN",
"content": [
{
"displayText": "This is additional text that will be shown for improvement of this choice.",
"url": "https://example.com/popt02_iplan_02.html"
},
{
"displayText": "This is the third piece of improvement plan text.",
"url": "https://example.com/popt02_iplan_03.html"
}
{
"displayText": "This is the fourth piece of improvement plan text.",
"url": "https://example.com/popt02_iplan_04.html"
}
]
}
]
},
{
"id": "option_no",
"title": "None of these",
"helpfulResource": {
"displayText": "Choose this if your workload does not follow these best practices.",
"url": "https://example.com/popt02_iplan_none.html"
}
}
```
4. Choices section:
This section defines the choices that are associated with a question. You can define up to 15 choices for a question in a custom lens.
"riskRules": [
{
"condition": "choice_1 && choice_2 && choice_3",
"risk": "NO_RISK"
},
{
"condition": "((choice_1 || choice_2) && choice_3) || (!choice_1 && choice_3)",
"risk": "MEDIUM_RISK"
},
{
"condition": "default",
"risk": "HIGH_RISK"
}
]
```json
5. Risk Rules section:
This section defines how the choices selected determine the risk level. You can define a maximum of three risk rules per question, one for each level of risk. The order of your risk rules is significant. The first condition that evaluates to true sets the risk for the question. A common pattern for implementing risk rules is to start with your least risky (and typically most granular) rules and work your way down to your most risky (and least specific) rules.