

• 2026 年 4 月 30 日之後將不再提供 AWS Systems Manager CloudWatch Dashboard。客戶可以繼續使用 Amazon CloudWatch 主控台來檢視、建立和管理其 Amazon CloudWatch 儀表板，就像現在一樣。如需詳細資訊，請參閱 [Amazon CloudWatch Dashboard 文件](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 建立您自己的執行手冊
<a name="automation-documents"></a>

Automation Runbook 定義 Systems Manager 在自動化執行時對受管執行個體和其他 AWS 資源執行*的動作*。Automation 是 AWS Systems Manager中的工具。Runbook 包含循序執行的一或多個步驟。每個步驟都是圍繞單一動作而建立的。來自一個步驟的輸出可以作為後續步驟中的輸入。

執行這些動作及其步驟的程序稱為*自動化*。

Runbook 支援的動作類型可讓您自動化 AWS 環境中的各種操作。例如，使用 `executeScript` 動作類型，您可以直接在 Runbook 中嵌入 Python 或 PowerShell 指令碼。(建立自訂 Runbook 時，您可以內嵌新增指令碼，或從 S3 儲存貯體或本機電腦連接指令碼。) 您可以使用 `createStack`和 `deleteStack`動作類型來自動化 AWS CloudFormation 資源的管理。此外，使用 `executeAwsApi`動作類型，步驟可以在任何 中執行*任何 *API 操作 AWS 服務，包括建立或刪除 AWS 資源、啟動其他程序、啟動通知等等。

如需自動化所支援的全部 20 個動作類型清單，請參閱 [Systems Manager Automation 動作參考](automation-actions.md)。

AWS Systems Manager 自動化提供數個執行手冊，其中包含預先定義的步驟，可用來執行常見的任務，例如重新啟動一或多個 Amazon Elastic Compute Cloud (Amazon EC2) 執行個體或建立 Amazon Machine Image()AMI。您也可以建立自己的 Runbook 並與其他 Runbook 共用 AWS 帳戶，或公開給所有自動化使用者。

Runbook 使用 YAML 或 JSON 編寫而成。使用 Systems Manager Automation 主控台中的 **Document Builder** (文件建置器)，不過，您可以建立 Runbook，而無需以原生 JSON 或 YAML 撰寫。

**重要**  
如果您執行可使用 AWS Identity and Access Management (IAM) 服務角色叫用其他服務的自動化工作流程，請注意您必須為該服務角色設定可叫用這些服務的許可。此需求適用於所有 AWS Automation Runbook (`AWS-*` Runbook)，例如 `AWS-ConfigureS3BucketLogging`、 `AWS-CreateDynamoDBBackup`和 `AWS-RestartEC2Instance` Runbook。此要求也適用於您建立的任何自訂 Automation Runbook， AWS 服務 透過使用呼叫其他 服務的動作來叫用其他 。例如，如果您使用 `aws:executeAwsApi`、`aws:createStack` 或 `aws:copyImage` 動作，為服務角色設定可叫用這些服務的許可。您可新增 IAM 內嵌政策到角色，以啟用其他 AWS 服務 的許可。如需詳細資訊，請參閱[（選用） 新增自動化內嵌政策或客戶受管政策以叫用其他 AWS 服務](automation-setup-iam.md#add-inline-policy)。

如需您可以在 Runbook 中指定的動作的相關資訊，請參閱 [Systems Manager Automation 動作參考](automation-actions.md)。

如需有關使用 AWS Toolkit for Visual Studio Code 建立 Runbook 的資訊，請參閱*AWS Toolkit for Visual Studio Code 《 使用者指南*》中的[使用 Systems Manager Automation 文件](https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/systems-manager-automation-docs.html)。

如需有關使用視覺化設計工具來建立自訂執行手冊的資訊，請參閱 [Automation 執行手冊的視覺化設計體驗](automation-visual-designer.md)。

**Contents**
+ [Automation 執行手冊的視覺化設計體驗](automation-visual-designer.md)
  + [視覺化設計體驗介面的概觀](visual-designer-interface-overview.md)
    + [動作瀏覽器](visual-designer-interface-overview.md#visual-designer-actions)
    + [Canvas](visual-designer-interface-overview.md#visual-designer-canvas)
    + [表格](visual-designer-interface-overview.md#visual-designer-form)
    + [鍵盤快速鍵](visual-designer-interface-overview.md#visual-designer-keyboard-shortcuts)
  + [運用視覺化設計體驗](visual-designer-use.md)
    + [建立執行手冊工作流程](visual-designer-use.md#visual-designer-create-runbook-workflow)
    + [設計執行手冊](visual-designer-use.md#visual-designer-build)
    + [更新執行手冊](visual-designer-use.md#visual-designer-update-runbook)
    + [匯出執行手冊](visual-designer-use.md#visual-designer-export-runbook)
  + [設定動作的輸入和輸出](visual-designer-action-inputs-outputs.md)
    + [為動作提供輸入資料](visual-designer-action-inputs-outputs.md#providing-input)
    + [定義動作的輸出資料](visual-designer-action-inputs-outputs.md#defining-output)
  + [藉助視覺化設計體驗錯誤處理](visual-designer-error-handling.md)
    + [出現錯誤時重試動作](visual-designer-error-handling.md#retry-actions)
    + [逾時](visual-designer-error-handling.md#timeout-seconds)
    + [失敗的動作](visual-designer-error-handling.md#failure-actions)
    + [取消的動作](visual-designer-error-handling.md#cancel-actions)
    + [關鍵動作](visual-designer-error-handling.md#critical-actions)
    + [結束動作](visual-designer-error-handling.md#end-actions)
  + [教學課程：使用視覺化設計體驗建立執行手冊](visual-designer-tutorial.md)
    + [步驟 1：導覽至視覺化設計體驗](visual-designer-tutorial.md#navigate-console)
    + [步驟 2：建立工作流程](visual-designer-tutorial.md#create-workflow)
    + [步驟 3：檢閱自動產生的程式碼](visual-designer-tutorial.md#view-generated-code)
    + [步驟 4：執行新的執行手冊](visual-designer-tutorial.md#use-tutorial-runbook)
    + [步驟 5：清除](visual-designer-tutorial.md#cleanup-tutorial-runbook)
+ [撰寫 Automation Runbook](automation-authoring-runbooks.md)
  + [識別您的使用案例](automation-authoring-runbooks.md#automation-authoring-runbooks-use-case)
  + [設定開發環境](automation-authoring-runbooks.md#automation-authoring-runbooks-environment)
  + [開發 Runbook 內容](automation-authoring-runbooks.md#automation-authoring-runbooks-developing-content)
  + [範例 1：建立父子 Runbook](automation-authoring-runbooks-parent-child-example.md)
    + [建立子系 Runbook](automation-authoring-runbooks-parent-child-example.md#automation-authoring-runbooks-child-runbook)
    + [建立父系 Runbook](automation-authoring-runbooks-parent-child-example.md#automation-authoring-runbooks-parent-runbook)
  + [範例 2：指令碼式 Runbook](automation-authoring-runbooks-scripted-example.md)
  + [其他執行手冊範例](automation-document-examples.md)
    + [部署 VPC 架構和 Microsoft Active Directory 網域控制站](automation-document-architecture-deployment-example.md)
    + [從最新的快照還原根磁碟區](automation-document-instance-recovery-example.md)
    + [建立 AMI 和跨區域複本](automation-document-backup-maintenance-example.md)
+ [建立填入 AWS 資源的輸入參數](populating-input-parameters.md)
+ [使用文件建置器建立執行手冊](automation-document-builder.md)
  + [使用文件建置器建立自訂執行手冊](automation-document-builder.md#create-runbook)
  + [建立執行指令碼的執行手冊](automation-document-builder.md#create-runbook-scripts)
+ [在執行手冊中使用指令碼](automation-document-script-considerations.md)
  + [使用 Runbook 的許可](automation-document-script-considerations.md#script-permissions)
  + [將指令碼新增至 Runbook](automation-document-script-considerations.md#adding-scripts)
  + [Runbook 的指令碼限制](automation-document-script-considerations.md#script-constraints)
+ [在執行手冊中使用條件陳述式](automation-branch-condition.md)
  + [使用 `aws:branch` 動作](automation-branch-condition.md#branch-action-explained)
    + [在 Runbook 中建立 `aws:branch` 步驟](automation-branch-condition.md#create-branch-action)
      + [關於建立輸出變數](automation-branch-condition.md#branch-action-output)
    + [範例 `aws:branch` Runbook](automation-branch-condition.md#branch-runbook-examples)
    + [使用運算子建立複雜的分支自動化](automation-branch-condition.md#branch-operators)
  + [如何使用條件選項的範例](automation-branch-condition.md#conditional-examples)
+ [使用動作輸出作為輸入](automation-action-outputs-inputs.md)
  + [在執行手冊中使用 JSONPath](automation-action-outputs-inputs.md#automation-action-json-path)
+ [為 Automation 建立 Webhook 整合](creating-webhook-integrations.md)
  + [建立整合 (主控台)](creating-webhook-integrations.md#creating-integrations-console)
  + [建立整合 (命令列)](creating-webhook-integrations.md#creating-integrations-commandline)
  + [為整合建立 Webhook](creating-webhook-integrations.md#creating-webhooks)
+ [處理 Runbook 中的逾時](automation-handling-timeouts.md)