

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# AMS Accelerate용 Systems Manager 명령줄 인터페이스(CLI)를 사용하여 유지 관리 기간 생성
<a name="acc-p-maint-window-cli"></a>

명령줄 인터페이스를 사용하여 AMS Accelerate 유지 관리 기간을 생성하려면

1. SSM [자습서: 유지 관리 기간 생성 및 구성(AWS CLI)을 ](https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-cli-tutorials-create.html)따릅니다. 다음은 자습서의 각 단계에 대한 패치 적용을 위한 샘플 CLI 명령입니다.
**참고**  
 이 예제는 Linux 또는 macOS에만 해당됩니다. 로컬 시스템에서 `awscli`를 구성하는 것보다 더 간단한 명령도 실행할 수 AWS CloudShell 있습니다. 자세한 내용은 [작업을 참조하세요 AWS CloudShell](https://docs.aws.amazon.com/cloudshell/latest/userguide/working-with-cloudshell.html).

   1. 자습서의 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`가 반환됩니다.

   1. 자습서의 2단계에서 대상 노드를 등록하려면:

      ```
      aws ssm register-target-with-maintenance-window \
                      --window-id "mw-xxxxxxxxx" \
                      --resource-type "INSTANCE" \
                      --target "Key=tag:Environment,Values=Prod"
      ```

      성공적으로 완료되면이 반환`WindowTargetID`됩니다.

   1. 자습서의 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
      ```