

• 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="automation-working-executing-manually"></a>

다음 절차에서는 수동 실행 모드를 사용하여 자동화를 실행하도록 AWS Systems Manager 콘솔과 AWS Command Line Interface(AWS CLI)를 사용하는 방법을 설명합니다. 수동 실행 모드를 사용하면 자동화가 [*대기 중(Waiting)*] 상태로 시작하고 각 단계 간에 [*대기 중(Waiting)*] 상태로 일시 중지합니다. 그러면 사용자가 자동화를 진행할 시점을 제어할 수 있어 다음 단계로 넘어가기 전에 단계의 결과를 검토해야 할 경우 유용합니다.

자동화는 현재 사용자의 컨텍스트에서 실행됩니다. 이는 런북과 그 런북에 의해 호출되는 모든 작업을 사용할 권한이 있는 한 추가 IAM 권한을 구성할 필요가 없음을 뜻합니다. IAM에서 관리자 권한이 있는 경우 이 자동화를 실행할 권한이 이미 있습니다.

## 단계별 자동화 실행(콘솔)
<a name="automation-working-executing-manually-console"></a>

다음 절차에서는 Systems Manager 콘솔을 사용하여 단계별 자동화를 수동으로 실행하는 방법을 보여줍니다.

**단계별 자동화를 실행하려면**

1. AWS Systems Manager 콘솔[https://console.aws.amazon.com/systems-manager/](https://console.aws.amazon.com/systems-manager/)을 엽니다.

1. 탐색 창에서 **Automation**(자동화)을 선택한 후 **Execute automation**(자동화 실행)을 선택합니다.

1. [**Automation 문서(Automation document)**] 목록에서 실행서를 선택합니다. **문서 카테고리** 창에서 옵션을 1개 이상 선택하여 SSM 문서를 목적에 따라 필터링합니다. 자신이 소유한 실행서를 보려면 [**내 소유(Owned by me)**] 탭을 선택합니다. 자신의 계정과 공유하고 있는 실행서를 보려면 [**나와 공유됨(Shared with me)**] 탭을 선택합니다. 모든 실행서를 보려면 [**모든 문서(All documents)**] 탭을 선택합니다.
**참고**  
실행서 이름을 선택하여 실행서에 대한 정보를 볼 수 있습니다.

1. **문서 세부 정보** 섹션에서 **문서 버전**이 실행할 버전으로 설정되었는지 확인합니다. 이 시스템에는 다음 버전 옵션이 포함되어 있습니다.
   + **런타임 시 기본 버전** - Automation 런북이 정기적으로 업데이트되며 새 기본 버전이 할당된 경우 이 옵션을 선택합니다.
   + **런타임 시 최신 버전** - Automation 런북이 정기적으로 업데이트되며 최근에 업데이트된 버전을 실행하려는 경우 이 옵션을 선택합니다.
   + **1(기본값)** - 문서의 최초 버전을 실행하려면 이 옵션을 선택합니다(기본값).

1. **다음**을 선택합니다.

1. **실행 모드** 섹션에서 **Manual execution(수동 실행)**을 선택합니다.

1. **입력 파라미터** 섹션에서 필수 입력을 지정합니다. 필요에 따라 [**AutomationAssumeRole**] 목록에서 IAM 서비스 역할을 선택합니다.

1. **실행**을 선택합니다.

1. 자동화의 첫 번째 단계를 실행할 준비가 되면 [**이 단계를 실행(Execute this step)**]을 선택합니다. 자동화가 1단계를 실행하고 이 절차의 3단계에서 선택한 런북에 지정된 이후 단계를 실행하기 전에 일시 중지됩니다. 실행서에 여러 단계가 포함된 경우 각 단계마다 [**이 단계 실행(Execute this step)**]을 선택하여 자동화를 진행합니다. [**이 단계 실행(Execute this step)**]을 선택할 때마다 작업이 실행됩니다.
**참고**  
콘솔에 자동화 상태가 표시됩니다. 자동화 단계가 실행되지 않는 경우 [Systems Manager Automation 문제 해결](automation-troubleshooting.md) 섹션을 참조하세요.

1. 실행서에 지정된 모든 단계를 마쳤으면 [**완료 및 결과 보기(Complete and view results)**]를 선택하여 자동화를 완료하고 결과를 확인합니다.

자동화 실행이 완료되면 동일하거나 수정된 파라미터로 실행을 다시 실행할 수 있습니다. 자세한 내용은 [자동화 실행 재실행](automation-rerun-executions.md) 섹션을 참조하세요.

## 단계별 자동화 실행(명령줄)
<a name="automation-working-executing-manually-commandline"></a>

다음 절차에서는 AWS CLI(Linux, macOS 또는 Windows) 또는 AWS Tools for PowerShell을 사용하여 단계별 자동화를 수동으로 실행하는 방법을 설명합니다.

**단계별 자동화를 실행하려면**

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. 수동 자동화를 시작하려면 다음 명령을 실행합니다. 각 {{example resource placeholder}}를 사용자의 정보로 바꿉니다.

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

   ```
   aws ssm start-automation-execution \
       --document-name {{runbook name}} \
       --mode Interactive \
       --parameters {{runbook parameters}}
   ```

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

   ```
   aws ssm start-automation-execution ^
       --document-name {{runbook name}} ^
       --mode Interactive ^
       --parameters {{runbook parameters}}
   ```

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

   ```
   Start-SSMAutomationExecution `
       -DocumentName {{runbook name}} `
       -Mode Interactive `
       -Parameter {{runbook parameters}}
   ```

------

   여기에 실행서 `AWS-RestartEC2Instance`를 사용하여 지정된 EC2 인스턴스를 다시 시작하는 예가 있습니다.

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

   ```
   aws ssm start-automation-execution \
       --document-name "AWS-RestartEC2Instance" \
       --mode Interactive \
       --parameters "InstanceId=i-02573cafcfEXAMPLE"
   ```

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

   ```
   aws ssm start-automation-execution ^
       --document-name "AWS-RestartEC2Instance" ^
       --mode Interactive ^
       --parameters "InstanceId=i-02573cafcfEXAMPLE"
   ```

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

   ```
   Start-SSMAutomationExecution `
       -DocumentName AWS-RestartEC2Instance `
       -Mode Interactive 
       -Parameter @{"InstanceId"="i-02573cafcfEXAMPLE"}
   ```

------

   시스템은 다음과 같은 정보를 반환합니다.

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

   ```
   {
       "AutomationExecutionId": "ba9cd881-1b36-4d31-a698-0123456789ab"
   }
   ```

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

   ```
   {
       "AutomationExecutionId": "ba9cd881-1b36-4d31-a698-0123456789ab"
   }
   ```

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

   ```
   ba9cd881-1b36-4d31-a698-0123456789ab
   ```

------

1. 자동화의 첫 번째 단계를 실행할 준비가 되면 다음 명령을 실행합니다. 각 {{example resource placeholder}}를 사용자의 정보로 바꿉니다. 자동화가 1단계를 실행하고 이 절차의 1단계에서 선택한 런북에 지정된 이후 단계를 실행하기 전에 일시 중지됩니다. 실행서에 여러 단계가 포함된 경우 각 단계마다 다음 명령을 실행하여 자동화를 진행합니다.

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

   ```
   aws ssm send-automation-signal \
       --automation-execution-id {{ba9cd881-1b36-4d31-a698-0123456789ab}} \
       --signal-type StartStep \
       --payload StepName="{{stopInstances}}"
   ```

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

   ```
   aws ssm send-automation-signal ^
       --automation-execution-id {{ba9cd881-1b36-4d31-a698-0123456789ab}} ^
       --signal-type StartStep ^
       --payload StepName="{{stopInstances}}"
   ```

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

   ```
   Send-SSMAutomationSignal `
       -AutomationExecutionId {{ba9cd881-1b36-4d31-a698-0123456789ab}} `
       -SignalType StartStep 
       -Payload @{"StepName"="{{stopInstances}}"}
   ```

------

   명령이 성공해도 출력은 없습니다.

1. 다음 명령을 실행하여 자동화의 각 단계 실행 상태를 검색합니다.

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

   ```
   aws ssm describe-automation-step-executions \
       --automation-execution-id {{ba9cd881-1b36-4d31-a698-0123456789ab}}
   ```

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

   ```
   aws ssm describe-automation-step-executions ^
       --automation-execution-id {{ba9cd881-1b36-4d31-a698-0123456789ab}}
   ```

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

   ```
   Get-SSMAutomationStepExecution `
       -AutomationExecutionId {{ba9cd881-1b36-4d31-a698-0123456789ab}}
   ```

------

   시스템은 다음과 같은 정보를 반환합니다.

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

   ```
   {
       "StepExecutions": [
           {
               "StepName": "stopInstances",
               "Action": "aws:changeInstanceState",
               "ExecutionStartTime": 1557167178.42,
               "ExecutionEndTime": 1557167220.617,
               "StepStatus": "Success",
               "Inputs": {
                   "DesiredState": "\"stopped\"",
                   "InstanceIds": "[\"i-02573cafcfEXAMPLE\"]"
               },
               "Outputs": {
                   "InstanceStates": [
                       "stopped"
                   ]
               },
               "StepExecutionId": "654243ba-71e3-4771-b04f-0123456789ab",
               "OverriddenParameters": {},
               "ValidNextSteps": [
                   "startInstances"
               ]
           },
           {
               "StepName": "startInstances",
               "Action": "aws:changeInstanceState",
               "ExecutionStartTime": 1557167273.754,
               "ExecutionEndTime": 1557167480.73,
               "StepStatus": "Success",
               "Inputs": {
                   "DesiredState": "\"running\"",
                   "InstanceIds": "[\"i-02573cafcfEXAMPLE\"]"
               },
               "Outputs": {
                   "InstanceStates": [
                       "running"
                   ]
               },
               "StepExecutionId": "8a4a1e0d-dc3e-4039-a599-0123456789ab",
               "OverriddenParameters": {}
           }
       ]
   }
   ```

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

   ```
   {
       "StepExecutions": [
           {
               "StepName": "stopInstances",
               "Action": "aws:changeInstanceState",
               "ExecutionStartTime": 1557167178.42,
               "ExecutionEndTime": 1557167220.617,
               "StepStatus": "Success",
               "Inputs": {
                   "DesiredState": "\"stopped\"",
                   "InstanceIds": "[\"i-02573cafcfEXAMPLE\"]"
               },
               "Outputs": {
                   "InstanceStates": [
                       "stopped"
                   ]
               },
               "StepExecutionId": "654243ba-71e3-4771-b04f-0123456789ab",
               "OverriddenParameters": {},
               "ValidNextSteps": [
                   "startInstances"
               ]
           },
           {
               "StepName": "startInstances",
               "Action": "aws:changeInstanceState",
               "ExecutionStartTime": 1557167273.754,
               "ExecutionEndTime": 1557167480.73,
               "StepStatus": "Success",
               "Inputs": {
                   "DesiredState": "\"running\"",
                   "InstanceIds": "[\"i-02573cafcfEXAMPLE\"]"
               },
               "Outputs": {
                   "InstanceStates": [
                       "running"
                   ]
               },
               "StepExecutionId": "8a4a1e0d-dc3e-4039-a599-0123456789ab",
               "OverriddenParameters": {}
           }
       ]
   }
   ```

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

   ```
   Action: aws:changeInstanceState
   ExecutionEndTime     : 5/6/2019 19:45:46
   ExecutionStartTime   : 5/6/2019 19:45:03
   FailureDetails       : 
   FailureMessage       : 
   Inputs               : {[DesiredState, "stopped"], [InstanceIds, ["i-02573cafcfEXAMPLE"]]}
   IsCritical           : False
   IsEnd                : False
   MaxAttempts          : 0
   NextStep             : 
   OnFailure            : 
   Outputs              : {[InstanceStates, Amazon.Runtime.Internal.Util.AlwaysSendList`1[System.String]]}
   OverriddenParameters : {}
   Response             : 
   ResponseCode         : 
   StepExecutionId      : 8fcc9641-24b7-40b3-a9be-0123456789ab
   StepName             : stopInstances
   StepStatus           : Success
   TimeoutSeconds       : 0
   ValidNextSteps       : {startInstances}
   ```

------

1. 선택한 런북 내에 지정된 모든 단계가 종료된 후에 다음 명령을 실행하여 자동화를 완료합니다. 각 {{example resource placeholder}}를 사용자의 정보로 바꿉니다.

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

   ```
   aws ssm stop-automation-execution \
       --automation-execution-id {{ba9cd881-1b36-4d31-a698-0123456789ab}} \
       --type Complete
   ```

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

   ```
   aws ssm stop-automation-execution ^
       --automation-execution-id {{ba9cd881-1b36-4d31-a698-0123456789ab}} ^
       --type Complete
   ```

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

   ```
   Stop-SSMAutomationExecution `
       -AutomationExecutionId {{ba9cd881-1b36-4d31-a698-0123456789ab}} `
       -Type Complete
   ```

------

   명령이 성공해도 출력은 없습니다.