

Ada lebih banyak contoh AWS SDK yang tersedia di repo Contoh [SDK AWS Doc](https://github.com/awsdocs/aws-doc-sdk-examples). GitHub 

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

# Gunakan `StartAutomationExecution` dengan CLI
<a name="ssm_example_ssm_StartAutomationExecution_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`StartAutomationExecution`.

------
#### [ CLI ]

**AWS CLI**  
**Contoh 1: Untuk menjalankan dokumen otomatisasi**  
`start-automation-execution`Contoh berikut menjalankan dokumen Automation.  

```
aws ssm start-automation-execution \
    --document-name "AWS-UpdateLinuxAmi" \
    --parameters "AutomationAssumeRole=arn:aws:iam::123456789012:role/SSMAutomationRole,SourceAmiId=ami-EXAMPLE,IamInstanceProfileName=EC2InstanceRole"
```
Output:  

```
{
  "AutomationExecutionId": "4105a4fc-f944-11e6-9d32-0a1b2EXAMPLE"
}
```
Untuk informasi selengkapnya, lihat [Menjalankan Alur Kerja Otomasi Secara Manual](https://docs.aws.amazon.com/systems-manager/latest/userguide/automation-working-executing-manually.html) di *Panduan Pengguna AWS Systems Manager*.  
**Contoh 2: Untuk menjalankan dokumen otomatisasi bersama**  
`start-automation-execution`Contoh berikut menjalankan dokumen Otomasi bersama.  

```
aws ssm start-automation-execution \
    --document-name "arn:aws:ssm:us-east-1:123456789012:document/ExampleDocument"
```
Output:  

```
{
  "AutomationExecutionId": "4105a4fc-f944-11e6-9d32-0a1b2EXAMPLE"
}
```
Untuk informasi selengkapnya, lihat [Menggunakan dokumen SSM bersama](https://docs.aws.amazon.com/systems-manager/latest/userguide/ssm-using-shared.html) di *Panduan Pengguna AWS Systems Manager*.  
+  Untuk detail API, lihat [StartAutomationExecution](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ssm/start-automation-execution.html)di *Referensi AWS CLI Perintah*. 

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

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini menjalankan dokumen yang menentukan peran Otomasi, ID sumber AMI, dan peran instans Amazon EC2.**  

```
Start-SSMAutomationExecution -DocumentName AWS-UpdateLinuxAmi -Parameter @{'AutomationAssumeRole'='arn:aws:iam::123456789012:role/SSMAutomationRole';'SourceAmiId'='ami-f173cc91';'InstanceIamRole'='EC2InstanceRole'}
```
**Output:**  

```
3a532a4f-0382-11e7-9df7-6f11185f6dd1
```
+  Untuk detail API, lihat [StartAutomationExecution](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menjalankan dokumen yang menentukan peran Otomasi, ID sumber AMI, dan peran instans Amazon EC2.**  

```
Start-SSMAutomationExecution -DocumentName AWS-UpdateLinuxAmi -Parameter @{'AutomationAssumeRole'='arn:aws:iam::123456789012:role/SSMAutomationRole';'SourceAmiId'='ami-f173cc91';'InstanceIamRole'='EC2InstanceRole'}
```
**Output:**  

```
3a532a4f-0382-11e7-9df7-6f11185f6dd1
```
+  Untuk detail API, lihat [StartAutomationExecution](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------