使用编辑器创建更改模板 - Amazon Web Services Systems Manager
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门

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

使用编辑器创建更改模板

使用本主题中的步骤在变更管理器中配置更改模板,Amazon Web Services Systems Manager,方法是输入 JSON 或 YAML,而不是使用控制台控件。

使用编辑器创建更改模板

  1. 在导航窗格中,选择变更管理员

    -或者-

    如果Amazon Web Services Systems Manager首先打开主页,选择菜单图标( ) 打开导航窗格中的,然后选择选择变更管理员

  2. 选择 Create template (创建模板)

  3. 适用于名称中,输入模板名称以便于标识其用途,例如RestartEC2LinuxInstance

  4. FOLLO更改模板详细信息中,选择Editor (编辑器)

  5. 文档编辑器部分,选择编辑,然后为您的更改模板输入 JSON 或 YAML 内容。

    以下是示例。

    注意

    此示例演示了两个级别的批准。您最多可以指定五个级别的批准,但只需要一个级别。

    YAML
    description: >- This change template demonstrates the feature set available for creating change templates for Change Manager. This template starts a Runbook workflow for the Automation runbook called AWS-HelloWorld. templateInformation: > ### Document Name: HelloWorldChangeTemplate ## What does this document do? This change template demonstrates the feature set available for creating change templates for Change Manager. This template starts a Runbook workflow for the Automation runbook called AWS-HelloWorld. ## Input Parameters * ApproverSnsTopicArn: (Required) Amazon Simple Notification Service ARN for approvers. * Approver: (Required) The name of the approver to send this request to. * ApproverType: (Required) The type of reviewer. * Allowed Values: IamUser, IamGroup, IamRole, SSOGroup, SSOUser ## Output Parameters This document has no outputs schemaVersion: '0.3' parameters: ApproverSnsTopicArn: type: String description: Amazon Simple Notification Service ARN for approvers. Approver: type: String description: IAM approver ApproverType: type: String description: >- Approver types for the request. Allowed values include IamUser, IamGroup, IamRole, SSOGroup, and SSOUser. executableRunBooks: - name: AWS-HelloWorld version: '1' emergencyChange: false mainSteps: - name: ApproveAction1 action: 'aws:approve' timeoutSeconds: 3600 inputs: Message: >- A sample change request has been submitted for your review in Change Manager. You can approve or reject this request. EnhancedApprovals: NotificationArn: '{{ ApproverSnsTopicArn }}' Approvers: - approver: '{{ Approver }}' type: '{{ ApproverType }}' minRequiredApprovals: 1 - name: ApproveAction2 action: 'aws:approve' timeoutSeconds: 3600 inputs: Message: >- A sample change request has been submitted for your review in Change Manager. You can approve or reject this request. EnhancedApprovals: NotificationArn: '{{ ApproverSnsTopicArn }}' Approvers: - approver: '{{ Approver }}' type: '{{ ApproverType }}' minRequiredApprovals: 1
    JSON
    { "description": "This change template demonstrates the feature set available for creating change templates for Change Manager. This template starts a Runbook workflow for the Automation runbook called AWS-HelloWorld", "templateInformation": "### Document Name: HelloWorldChangeTemplate\n\n ## What does this document do?\n This change template demonstrates the feature set available for creating change templates for Change Manager. This template starts a Runbook workflow for the Automation runbook called AWS-HelloWorld.\n\n ## Input Parameters\n* ApproverSnsTopicArn: (Required) Amazon Simple Notification Service ARN for approvers.\n * Approver: (Required) The name of the approver to send this request to.\n * ApproverType: (Required) The type of reviewer. * Allowed Values: IamUser, IamGroup, IamRole, SSOGroup, SSOUser\n\n ## Output Parameters\nThis document has no outputs\n", "schemaVersion": "0.3", "parameters": { "ApproverSnsTopicArn": { "type": "String", "description": "Amazon Simple Notification Service ARN for approvers." }, "Approver": { "type": "String", "description": "IAM approver" }, "ApproverType": { "type": "String", "description": "Approver types for the request. Allowed values include IamUser, IamGroup, IamRole, SSOGroup, and SSOUser." } }, "executableRunBooks": [ { "name": "AWS-HelloWorld", "version": "1" } ], "emergencyChange": false, "mainSteps": [ { "name": "ApproveAction1", "action": "aws:approve", "timeoutSeconds": 3600, "inputs": { "Message": "A sample change request has been submitted for your review in Change Manager. You can approve or reject this request.", "EnhancedApprovals": { "NotificationArn": "{{ ApproverSnsTopicArn }}", "Approvers": [ { "approver": "{{ Approver }}", "type": "{{ ApproverType }}", "minRequiredApprovals": 1 } ] } } }, { "name": "ApproveAction2", "action": "aws:approve", "timeoutSeconds": 3600, "inputs": { "Message": "A sample change request has been submitted for your review in Change Manager. You can approve or reject this request.", "EnhancedApprovals": { "NotificationArn": "{{ ApproverSnsTopicArn }}", "Approvers": [ { "approver": "{{ Approver }}", "type": "{{ ApproverType }}", "minRequiredApprovals": 1 } ] } } } ] }
  6. 选择保存和预览

  7. 查看要创建的更改模板的详细信息。

    如果要在提交更改模板以供审核之前对其进行更改,请选择Actions、Edit

    如果对更改模板的内容满意,请选择提交审核。您的组织或帐户中被指定为模板审阅者的用户在设置选项卡将通知新的更改模板正在等待其审阅。

    如果已为更改模板指定 Amazon Simple Notification Service (Amazon SNS) 主题,则在更改模板被拒绝或批准时将通知发送。如果您没有收到与此更改模板相关的通知,您可以稍后返回到 “变更管理器” 以检查其状态。