

• AWS Systems Manager CloudWatch ダッシュボードは、2026 年 4 月 30 日以降は利用できなくなります。お客様は、これまでと同様に Amazon CloudWatch コンソールを使用して、Amazon CloudWatch ダッシュボードの表示、作成、管理を継続できます。詳細については、「[Amazon CloudWatch ダッシュボードのドキュメント](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html)」を参照してください。

# コマンドラインツールを使用した変更テンプレートの作成
<a name="change-templates-tools"></a>

**Change Manager の可用性の変更**  
AWS Systems ManagerChange Manager は、2025 年 11 月 7 日以降、新規のお客様の受付を終了します。Change Manager を使用する場合は、その日付の前にサインアップしてください。既存のお客様は、通常どおりサービスを引き続き使用できます。詳細については、「[AWS Systems Manager Change Manager の可用性の変更](https://docs.aws.amazon.com/systems-manager/latest/userguide/change-manager-availability-change.html)」を参照してください。

以下の手順では、AWS Command Line Interface (AWS CLI) (Linux、macOS、または Windows Server の場合) または AWS Tools for Windows PowerShell を使用して、AWS Systems Manager のツールである Change Manager で変更リクエストを作成する方法について説明します。

**変更テンプレートを作成するには**

1. まだ AWS CLI または AWS Tools for PowerShell をインストールして設定していない場合は、インストールして設定します。

   詳細については、「[AWS CLI の最新バージョンをインストールまたは更新します。](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)」および「[AWS Tools for PowerShell のインストール](https://docs.aws.amazon.com/powershell/latest/userguide/pstools-getting-set-up.html)」を参照してください。

1. ローカルマシンに `MyChangeTemplate.json` などの名前の JSON ファイルを作成してから、変更テンプレートのコンテンツを貼り付けます。
**注記**  
変更テンプレートは、オートメーションランブックと同じサポートのすべてが含まれていないスキーマ 0.3 のバージョンを使用します。

   以下に例を示します。
**注記**  
パラメータ `minRequiredApprovals` は、このテンプレートを使用して作成された変更リクエストを承認する必要がある、指定されたレベルのレビュー担当者の数を指定するために使用されます。  
この例では、2 つのレベルの承認を示しています。承認レベルは最大 5 つまで指定できますが、必要なレベルは 1 つだけです。  
最初のレベルでは、特定のユーザー「John-Doe」が各変更リクエストを承認する必要があります。その後、IAM ロール `Admin` のいずれか 3 名のメンバーが変更リクエストを承認する必要があります。  
変更テンプレートの承認の詳細については、「[変更テンプレートの承認について](cm-approvals-templates.md)」を参照してください。

   ```
   {
      "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,
      "autoApprovable": 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": "John-Doe",
                        "type": "IamUser",
                        "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": "Admin",
                        "type": "IamRole",
                        "minRequiredApprovals": 3                  
                     }
                  ]
               }
            }
         }
      ]
   }
   ```

1. 次のコマンドを実行して、変更テンプレートを作成します。

------
#### [ Linux & macOS ]

   ```
   aws ssm create-document \
       --name MyChangeTemplate \
       --document-format JSON \
       --document-type Automation.ChangeTemplate \
       --content file://MyChangeTemplate.json \
       --tags Key=tag-key,Value=tag-value
   ```

------
#### [ Windows ]

   ```
   aws ssm create-document ^
       --name MyChangeTemplate ^
       --document-format JSON ^
       --document-type Automation.ChangeTemplate ^
       --content file://MyChangeTemplate.json ^
       --tags Key=tag-key,Value=tag-value
   ```

------
#### [ PowerShell ]

   ```
   $json = Get-Content -Path "C:\path\to\file\MyChangeTemplate.json" | Out-String
   New-SSMDocument `
       -Content $json `
       -Name "MyChangeTemplate" `
       -DocumentType "Automation.ChangeTemplate" `
       -Tags "Key=tag-key,Value=tag-value"
   ```

------

   指定できるオプションの詳細については、「[https://docs.aws.amazon.com/cli/latest/reference/ssm/create-document.html](https://docs.aws.amazon.com/cli/latest/reference/ssm/create-document.html)」を参照してください。

   システムが以下のような情報をレスポンスします。

   ```
   {
      "DocumentDescription":{
         "CreatedDate":1.585061751738E9,
         "DefaultVersion":"1",
         "Description":"Use this template to update an EC2 Linux AMI. Requires one
         approver specified in the template and an approver specified in the request.",
         "DocumentFormat":"JSON",
         "DocumentType":"Automation",
         "DocumentVersion":"1",
         "Hash":"0d3d879b3ca072e03c12638d0255ebd004d2c65bd318f8354fcde820dEXAMPLE",
         "HashType":"Sha256",
         "LatestVersion":"1",
         "Name":"MyChangeTemplate",
         "Owner":"123456789012",
         "Parameters":[
            {
               "DefaultValue":"",
               "Description":"Level one approvers",
               "Name":"LevelOneApprovers",
               "Type":"String"
            },
            {
               "DefaultValue":"",
               "Description":"Level one approver type",
               "Name":"LevelOneApproverType",
               "Type":"String"
            },
      "cloudWatchMonitors": {
         "monitors": [
            "my-cloudwatch-alarm"
         ]
      }
         ],
         "PlatformTypes":[
            "Windows",
            "Linux"
         ],
         "SchemaVersion":"0.3",
         "Status":"Creating",
         "Tags":[
   
         ]
      }
   }
   ```

Change Manager の [**Settings**] (設定) タブでテンプレートレビューワーとして指定された組織またはアカウント内のユーザーに、新しい変更テンプレートのレビューが保留中であることが通知されます。

Amazon Simple Notification Service (Amazon SNS) トピックが変更テンプレートで指定されている場合、変更テンプレートが拒否または承認されたときに通知が送信されます。この変更テンプレートに関連する通知が届かない場合は、後ほど Change Manager に戻って、そのステータスを確認できます。