翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
AMS Accelerate 用の Systems Manager コマンドラインインターフェイス (CLI) を使用してメンテナンスウィンドウを作成する
コマンドラインインターフェイスを使用して AMS Accelerate メンテナンスウィンドウを作成するには:
「SSM チュートリアル: メンテナンスウィンドウ (AWS CLI) を作成して設定する」に従います。チュートリアルの各ステップで、パッチ適用用のサンプル CLI コマンドを次に示します。
注記
これらの例は Linux または macOS に固有のものです。コマンドを実行することもできます。 AWS CloudShell このコマンドは、ローカルマシン
awscliで を設定するよりも簡単です。詳細については、「 の使用 AWS CloudShell」を参照してください。-
チュートリアルのステップ 1 では、メンテナンスウィンドウを作成します。
aws ssm create-maintenance-window \ --name Sample-Maintenance-Window \ --schedule "cron(0 30 23 ? * TUE#2 *)" \ --duration 4 \ --cutoff 1 \ --allow-unassociated-targets \ --tags "Key=Environment,Value=Production"正常に完了すると、
window-idが返されます。 -
チュートリアルのステップ 2 では、ターゲットノードを登録します。
aws ssm register-target-with-maintenance-window \ --window-id "mw-xxxxxxxxx" \ --resource-type "INSTANCE" \ --target "Key=tag:Environment,Values=Prod"正常に完了すると、
WindowTargetIDが返されます。 チュートリアルのステップ 3 で、タスクを登録するには:
aws ssm register-task-with-maintenance-window \ --window-id "mw-xxxxxx" \ --targets "Key=WindowTargetIds,Values=63d4f63c-xxxxxx-9b1d-xxxxxfff" \ --task-arn "AWSManagedServices-PatchInstance" \ --service-role-arn "arn:aws:iam::AWS-Account-ID:role/ams_ssm_automation_role" \ --task-invocation-parameters "{\"Automation\":{\"DocumentVersion\":\"\$DEFAULT\",\"Parameters\":{\"InstanceId\":[\"{{TARGET_ID}}\"],\"StartInactiveInstances\":[\"True\"]}}}" \ --max-concurrency 50 \ --max-errors 50 \ --name "AutomationExample" \ --description "Sample Description" \ --task-type=AUTOMATION
-