剖析格式规范 - AWS Well-Architected Tool

我们已经发布了 Well-Architected Framework 的新版本。我们还在镜头目录中添加了新的和更新的镜头了解有关变更的更多信息。

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

剖析格式规范

剖析是使用特定的 JSON 格式定义的。开始创建自定义剖析时,可以选择下载模板 JSON 文件。您可以使用此文件作为自定义剖析的基础,因为它定义了支柱、问题、最佳实践和改进计划的基本结构。

剖析部分

本部分定义了自定义剖析本身的属性。这是它的名称和描述。

  • schemaVersion:要使用的自定义剖析模式的版本。由模板设置,请勿更改。

  • name: 剖析的名称。名称最多可以有 128 个字符。

  • description:剖析的文本描述。选择剖析以在创建工作负载期间添加或选择剖析以稍后应用于现有工作负载时,会显示此文本。描述长度最多为 2048 个字符。

"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.",

支柱部分

本部分定义了与自定义剖析相关的支柱。你可以将你的问题映射到 Well-Architecte AWS d Framework 的支柱,也可以定义自己的支柱,或者两者兼而有之。

您最多可以在自定义剖析中定义 10 个支柱。

  • id: 支柱的 ID。ID 可以包含 3 到 128 个字符,并且仅包含字母数字和下划线(“_”)字符。支柱中使用的 ID 必须是唯一的。

    将您的问题映射到框架的支柱时,请使用以下 ID:

    • operationalExcellence

    • security

    • reliability

    • performance

    • costOptimization

    • sustainability

  • name:支柱的名称。名称最多可以有 128 个字符。

"pillars": [ { "id": "company_Privacy", "name": "Privacy Excellence", . . . }, { "id": "company_Security", "name": "Security", . . . } ]

问题部分

本部分定义了与支柱相关的问题。

您最多可以为自定义剖析中的一个支柱定义 20 个问题。

  • id:问题的 ID。ID 可以包含 3 到 128 个字符,并且仅包含字母数字和下划线(“_”)字符。问题中使用的 ID 必须是唯一的。

  • title:问题的标题。标题最多可以有 128 个字符。

  • description:更详细地描述了问题。描述长度最多为 2048 个字符。

  • helpfulResource displayText:可选。提供有关问题的有用信息的文本。文本最多可以有 2048 个字符。如果指定了 helpfulResource url,则必须指定。

  • helpfulResource url:可选。更详细地解释问题的 URL 资源。URL 必须以 http://https:// 开头。

注意

将自定义镜头工作负载同步到 Jira 时,问题会同时显示问题的 “ID” 和 “标题”。

Jira 票证中使用的格式是[ QuestionID ] QuestionTitle

"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" }, . . . } ]

选项部分

本部分定义了与问题相关的选项。

您最多可以为自定义剖析中的一个问题定义 15 个选项。

  • id:选项的 ID。ID 可以包含 3 到 128 个字符,并且仅包含字母数字和下划线(“_”)字符。必须为问题中的每个选项指定唯一的 ID。添加后缀为 _no 的选项将作为问题的 None of these 选项。

  • title:选项的标题。标题最多可以有 128 个字符。

  • helpfulResource displayText:可选。提供有关选项的有用信息的文本。文本最多可以有 2048 个字符。如果指定了 helpfulResource url,则必须包含。

  • helpfulResource url:可选。更详细地解释选项的 URL 资源。URL 必须以 http://https:// 开头。

  • improvementPlan displayText:描述如何改进选项的文本。文本最多可以有 2048 个字符。除 improvementPlan 选项外,每个选项都必须有 None of these

  • improvementPlan url:可选。可以帮助改进的 URL 资源。URL 必须以 http://https:// 开头。

  • additionalResources type:可选。额外资源的类型。值可以是 HELPFUL_RESOURCEIMPROVEMENT_PLAN

  • additionalResources content:可选。为其它资源指定 displayTexturl 值。最多可以为一个选项指定五个额外的有用资源以及五个额外的改进计划项目。

    • displayText:可选。描述有用资源或改进计划的文本。文本最多可以有 2048 个字符。如果指定了 url,则必须包含。

    • url:可选。有用资源或改进计划的 URL 资源。URL 必须以 http://https:// 开头。

注意

将自定义镜头工作负载同步到 Jira 时,选项会显示问题和选择的 “ID”,以及所选内容的 “标题”。

使用的格式是[ QuestionID | ChoiceID ] ChoiceTitle

"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" } }

风险规则部分

本部分定义了所选选项如何确定风险等级。

您最多可以为每个问题定义三条风险规则,每个风险等级各一条。

  • condition:对应问题风险等级的选项的布尔表达式,或 default

    每个问题都必须有一个 default 风险规则。

  • risk:表示与条件相关的风险。有效值包括 HIGH_RISKMEDIUM_RISKNO_RISK

风险规则的顺序很重要。第一个评估为 truecondition 将设定问题的风险。实施风险规则的常见模式是从风险最小(通常也最精细)的规则开始,然后逐步上升到风险最大(最不具体)的规则。

例如:

"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" } ]

如果问题有三个选项(choice_1choice_2choice_3),则这些风险规则会导致以下行为:

  • 如果选中所有三个选项,则没有风险。

  • 如果选中 choice_1choice_2并且还选中 choice_3,则为中等风险。

  • 如果选中 choice_1 但选中了 choice_3,则也为中等风险。

  • 如果前面的这些条件都不为 true,则为高风险。