- 
                    次のコマンドを実行して、Production-Baselineという名前の Windows のパッチベースラインを作成します。このパッチベースラインは、リリースまたは最後に更新されてから 7 日後に、実稼働環境のパッチを承認します。つまり、パッチベースラインが本番環境用であることを示すタグ付けがされています。
 OperatingSystemパラメータおよびPatchFiltersは、パッチベースラインが適用されるターゲット マネージドノードのオペレーティングシステムによって異なります。詳細については、「OperatingSystem」および「PatchFilter」を参照してください。
 
                        - Linux & macOS
- 
                                aws ssm create-patch-baseline \
    --name "Production-Baseline" \
    --operating-system "WINDOWS" \
    --tags "Key=Environment,Value=Production" \
    --approval-rules "PatchRules=[{PatchFilterGroup={PatchFilters=[{Key=MSRC_SEVERITY,Values=[Critical,Important]},{Key=CLASSIFICATION,Values=[SecurityUpdates,Updates,ServicePacks,UpdateRollups,CriticalUpdates]}]},ApproveAfterDays=7}]" \
    --description "Baseline containing all updates approved for production systems"
 
- Windows Server
- 
                                aws ssm create-patch-baseline ^
    --name "Production-Baseline" ^
    --operating-system "WINDOWS" ^
    --tags "Key=Environment,Value=Production" ^
    --approval-rules "PatchRules=[{PatchFilterGroup={PatchFilters=[{Key=MSRC_SEVERITY,Values=[Critical,Important]},{Key=CLASSIFICATION,Values=[SecurityUpdates,Updates,ServicePacks,UpdateRollups,CriticalUpdates]}]},ApproveAfterDays=7}]" ^
    --description "Baseline containing all updates approved for production systems"
 
 システムが以下のような情報をレスポンスします。 {
   "BaselineId":"pb-0c10e65780EXAMPLE"
}
- 
                    次のコマンドを実行して、2 つのパッチグループの「実稼働ベースライン」パッチベースラインを登録します。グループの名前は「データベースサーバー」と「フロントエンドサーバー」です。 
                        - Linux & macOS
- 
                                aws ssm register-patch-baseline-for-patch-group \
    --baseline-id pb-0c10e65780EXAMPLE \
    --patch-group "Database Servers"
 
- Windows Server
- 
                                aws ssm register-patch-baseline-for-patch-group ^
    --baseline-id pb-0c10e65780EXAMPLE ^
    --patch-group "Database Servers"
 
 システムが以下のような情報をレスポンスします。 {
   "PatchGroup":"Database Servers",
   "BaselineId":"pb-0c10e65780EXAMPLE"
}
                        - Linux & macOS
- 
                                aws ssm register-patch-baseline-for-patch-group \
    --baseline-id pb-0c10e65780EXAMPLE \
    --patch-group "Front-End Servers"
 
- Windows Server
- 
                                aws ssm register-patch-baseline-for-patch-group ^
    --baseline-id pb-0c10e65780EXAMPLE ^
    --patch-group "Front-End Servers"
 
 システムが以下のような情報をレスポンスします。 {
   "PatchGroup":"Front-End Servers",
   "BaselineId":"pb-0c10e65780EXAMPLE"
}
- 
                    次のコマンドを実行し、実稼働サーバー用の 2 つのメンテナンスウィンドウを作成します。最初のウィンドウは、毎火曜日の午後 10 時に実行します。2 番目のウィンドウは、毎土曜日の午後 10 時に実行します。また、メンテナンスウィンドウが実稼働環境用であることを示すタグが付けられます。 
                        - Linux & macOS
- 
                                aws ssm create-maintenance-window \
    --name "Production-Tuesdays" \
    --tags "Key=Environment,Value=Production" \
    --schedule "cron(0 0 22 ? * TUE *)" \
    --duration 1 \
    --cutoff 0 \
    --no-allow-unassociated-targets
 
- Windows Server
- 
                                aws ssm create-maintenance-window ^
    --name "Production-Tuesdays" ^
    --tags "Key=Environment,Value=Production" ^
    --schedule "cron(0 0 22 ? * TUE *)" ^
    --duration 1 ^
    --cutoff 0 ^
    --no-allow-unassociated-targets
 
 システムが以下のような情報をレスポンスします。 {
   "WindowId":"mw-0c50858d01EXAMPLE"
}
                        - Linux & macOS
- 
                                aws ssm create-maintenance-window \
    --name "Production-Saturdays" \
    --tags "Key=Environment,Value=Production" \
    --schedule "cron(0 0 22 ? * SAT *)" \
    --duration 2 \
    --cutoff 0 \
    --no-allow-unassociated-targets
 
- Windows Server
- 
                                aws ssm create-maintenance-window ^
    --name "Production-Saturdays" ^
    --tags "Key=Environment,Value=Production" ^
    --schedule "cron(0 0 22 ? * SAT *)" ^
    --duration 2 ^
    --cutoff 0 ^
    --no-allow-unassociated-targets
 
 システムが以下のような情報をレスポンスします。 {
   "WindowId":"mw-9a8b7c6d5eEXAMPLE"
}
- 
                    次のコマンドを実行して、DatabaseおよびFront-Endサーバーのパッチグループをそれぞれのメンテナンスウィンドウに登録します。
 
                        - Linux & macOS
- 
                                aws ssm register-target-with-maintenance-window \
    --window-id mw-0c50858d01EXAMPLE \
    --targets "Key=tag:PatchGroup,Values=Database Servers" \
    --owner-information "Database Servers" \
    --resource-type "INSTANCE"
 
- Windows Server
- 
                                aws ssm register-target-with-maintenance-window ^
    --window-id mw-0c50858d01EXAMPLE ^
    --targets "Key=tag:PatchGroup,Values=Database Servers" ^
    --owner-information "Database Servers" ^
    --resource-type "INSTANCE"
 
 システムが以下のような情報をレスポンスします。 {
   "WindowTargetId":"e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE"
}
                        - Linux & macOS
- 
                                aws ssm register-target-with-maintenance-window \
--window-id mw-9a8b7c6d5eEXAMPLE \
--targets "Key=tag:PatchGroup,Values=Front-End Servers" \
--owner-information "Front-End Servers" \
--resource-type "INSTANCE"
 
- Windows Server
- 
                                aws ssm register-target-with-maintenance-window ^
    --window-id mw-9a8b7c6d5eEXAMPLE ^
    --targets "Key=tag:PatchGroup,Values=Front-End Servers" ^
    --owner-information "Front-End Servers" ^
    --resource-type "INSTANCE"
 
 システムが以下のような情報をレスポンスします。 {
   "WindowTargetId":"faa01c41-1d57-496c-ba77-ff9caEXAMPLE"
}
- 
                    次のコマンドを実行して、それぞれのメンテナンスウィンドウ中に、DatabaseおよびFront-Endサーバー上に不足している更新プログラムをインストールするパッチタスクを登録します。
 
                        - Linux & macOS
- 
                                aws ssm register-task-with-maintenance-window \
    --window-id mw-0c50858d01EXAMPLE \
    --targets "Key=WindowTargetIds,Values=e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" \
    --task-arn "AWS-RunPatchBaseline" \
    --service-role-arn "arn:aws:iam::123456789012:role/MW-Role" \
    --task-type "RUN_COMMAND" \
    --max-concurrency 2 \
    --max-errors 1 \
    --priority 1 \
    --task-invocation-parameters "RunCommand={Parameters={Operation=Install}}"
 
- Windows Server
- 
                                aws ssm register-task-with-maintenance-window ^
    --window-id mw-0c50858d01EXAMPLE ^
    --targets "Key=WindowTargetIds,Values=e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" ^
    --task-arn "AWS-RunPatchBaseline" ^
    --service-role-arn "arn:aws:iam::123456789012:role/MW-Role" ^
    --task-type "RUN_COMMAND" ^
    --max-concurrency 2 ^
    --max-errors 1 ^
    --priority 1 ^
    --task-invocation-parameters "RunCommand={Parameters={Operation=Install}}"
 
 システムが以下のような情報をレスポンスします。 {
   "WindowTaskId":"4f7ca192-7e9a-40fe-9192-5cb15EXAMPLE"
}
                        - Linux & macOS
- 
                                aws ssm register-task-with-maintenance-window \
    --window-id mw-9a8b7c6d5eEXAMPLE \
    --targets "Key=WindowTargetIds,Values=faa01c41-1d57-496c-ba77-ff9caEXAMPLE" \
    --task-arn "AWS-RunPatchBaseline" \
    --service-role-arn "arn:aws:iam::123456789012:role/MW-Role" \
    --task-type "RUN_COMMAND" \
    --max-concurrency 2 \
    --max-errors 1 \
    --priority 1 \
    --task-invocation-parameters "RunCommand={Parameters={Operation=Install}}"
 
- Windows Server
- 
                                aws ssm register-task-with-maintenance-window ^
    --window-id mw-9a8b7c6d5eEXAMPLE ^
    --targets "Key=WindowTargetIds,Values=faa01c41-1d57-496c-ba77-ff9caEXAMPLE" ^
    --task-arn "AWS-RunPatchBaseline" ^
    --service-role-arn "arn:aws:iam::123456789012:role/MW-Role" ^
    --task-type "RUN_COMMAND" ^
    --max-concurrency 2 ^
    --max-errors 1 ^
    --priority 1 ^
    --task-invocation-parameters "RunCommand={Parameters={Operation=Install}}"
 
 システムが以下のような情報をレスポンスします。 {
   "WindowTaskId":"8a5c4629-31b0-4edd-8aea-33698EXAMPLE"
}
- 
                    以下のコマンドを実行して、パッチグループのパッチコンプライアンスの概要を取得します。高レベル パッチコンプライアンスの概要には、それぞれのパッチ状態のパッチがあるマネージドノードの数が含まれます。 最初のメンテナンスウィンドウ中にパッチ タスクが実行されるまで、サマリー内のマネージドノード数はゼロであることが予想されます。 
                        - Linux & macOS
- 
                                aws ssm describe-patch-group-state \
    --patch-group "Database Servers"
 
- Windows Server
- 
                                aws ssm describe-patch-group-state ^
    --patch-group "Database Servers"
 
 システムが以下のような情報をレスポンスします。 {
   "Instances": number,
   "InstancesWithFailedPatches":number,
   "InstancesWithInstalledOtherPatches":number,
   "InstancesWithInstalledPatches":number,
   "InstancesWithInstalledPendingRebootPatches":number,
   "InstancesWithInstalledRejectedPatches":number,
   "InstancesWithMissingPatches":number,
   "InstancesWithNotApplicablePatches":number,
   "InstancesWithUnreportedNotApplicablePatches":number}
- 
                    以下のコマンドを実行して、パッチグループのマネージドノードごとにパッチ状態の概要を取得します。マネージドノードごとのサマリーには、パッチグループのマネージドノードごとのそれぞれのパッチ状態にある多数のパッチが含まれます。 
                        - Linux & macOS
- 
                                aws ssm describe-instance-patch-states-for-patch-group \
    --patch-group "Database Servers"
 
- Windows Server
- 
                                aws ssm describe-instance-patch-states-for-patch-group ^
    --patch-group "Database Servers"
 
 システムが以下のような情報をレスポンスします。 {
   "InstancePatchStates": [ 
      { 
         "BaselineId": "string",
         "FailedCount":number,
         "InstalledCount":number,
         "InstalledOtherCount":number,
         "InstalledPendingRebootCount":number,
         "InstalledRejectedCount":number,
         "InstallOverrideList": "string",
         "InstanceId": "string",
         "LastNoRebootInstallOperationTime":number,
         "MissingCount":number,
         "NotApplicableCount":number,
         "Operation": "string",
         "OperationEndTime":number,
         "OperationStartTime":number,
         "OwnerInformation": "string",
         "PatchGroup": "string",
         "RebootOption": "string",
         "SnapshotId": "string",
         "UnreportedNotApplicableCount":number}
   ]
}