

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

# Gunakan `SetIdentityPoolRoles` dengan CLI
<a name="cognito-identity_example_cognito-identity_SetIdentityPoolRoles_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`SetIdentityPoolRoles`.

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

**AWS CLI**  
**Untuk mengatur peran kumpulan identitas**  
`set-identity-pool-roles`Contoh berikut menetapkan peran kumpulan identitas.  

```
aws cognito-identity set-identity-pool-roles \
    --identity-pool-id "us-west-2:11111111-1111-1111-1111-111111111111" \
    --roles authenticated="arn:aws:iam::111111111111:role/Cognito_MyIdentityPoolAuth_Role"
```
+  Untuk detail API, lihat [SetIdentityPoolRoles](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cognito-identity/set-identity-pool-roles.html)di *Referensi AWS CLI Perintah*. 

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

**Alat untuk PowerShell V4**  
**Contoh 1: Mengkonfigurasi Identity Pool tertentu untuk memiliki peran IAM yang tidak diautentikasi.**  

```
Set-CGIIdentityPoolRole -IdentityPoolId us-east-1:0de2af35-2988-4d0b-b22d-EXAMPLEGUID1 -Role @{ "unauthenticated" = "arn:aws:iam::123456789012:role/CommonTests1Role" }
```
+  Untuk detail API, lihat [SetIdentityPoolRoles](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Mengkonfigurasi Identity Pool tertentu untuk memiliki peran IAM yang tidak diautentikasi.**  

```
Set-CGIIdentityPoolRole -IdentityPoolId us-east-1:0de2af35-2988-4d0b-b22d-EXAMPLEGUID1 -Role @{ "unauthenticated" = "arn:aws:iam::123456789012:role/CommonTests1Role" }
```
+  Untuk detail API, lihat [SetIdentityPoolRoles](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

Untuk daftar lengkap panduan pengembang AWS SDK dan contoh kode, lihat[Menggunakan layanan ini dengan AWS SDK](sdk-general-information-section.md). Topik ini juga mencakup informasi tentang memulai dan detail tentang versi SDK sebelumnya.