

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 `RemoveRoleFromInstanceProfile` dengan CLI
<a name="iam_example_iam_RemoveRoleFromInstanceProfile_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`RemoveRoleFromInstanceProfile`.

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

**AWS CLI**  
**Untuk menghapus peran dari profil instance**  
`remove-role-from-instance-profile`Perintah berikut menghapus peran bernama `Test-Role` dari profil instance bernama`ExampleInstanceProfile`.  

```
aws iam remove-role-from-instance-profile \
    --instance-profile-name ExampleInstanceProfile \
    --role-name Test-Role
```
Untuk informasi lebih lanjut, lihat [Menggunakan profil instance](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html) dalam *AWS Panduan Pengguna IAM*.  
+  Untuk detail API, lihat [RemoveRoleFromInstanceProfile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/remove-role-from-instance-profile.html)di *Referensi AWS CLI Perintah*. 

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

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini menghapus peran bernama `MyNewRole` dari profil instans EC2 bernama. `MyNewRole` Profil instance yang dibuat di konsol IAM selalu memiliki nama yang sama dengan peran, seperti dalam contoh ini. Jika Anda membuatnya di API atau CLI, maka mereka dapat memiliki nama yang berbeda.**  

```
Remove-IAMRoleFromInstanceProfile -InstanceProfileName MyNewRole -RoleName MyNewRole -Force
```
+  Untuk detail API, lihat [RemoveRoleFromInstanceProfile](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus peran bernama `MyNewRole` dari profil instans EC2 bernama. `MyNewRole` Profil instance yang dibuat di konsol IAM selalu memiliki nama yang sama dengan peran, seperti dalam contoh ini. Jika Anda membuatnya di API atau CLI, maka mereka dapat memiliki nama yang berbeda.**  

```
Remove-IAMRoleFromInstanceProfile -InstanceProfileName MyNewRole -RoleName MyNewRole -Force
```
+  Untuk detail API, lihat [RemoveRoleFromInstanceProfile](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------