

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

Contoh kode berikut menunjukkan cara menggunakan`RemovePermission`.

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

**AWS CLI**  
**Untuk menghapus izin dari fungsi Lambda yang ada**  
`remove-permission`Contoh berikut menghapus izin untuk memanggil fungsi bernama`my-function`.  

```
aws lambda remove-permission \
    --function-name my-function \
    --statement-id sns
```
Perintah ini tidak menghasilkan output.  
*Untuk informasi selengkapnya, lihat [Menggunakan Kebijakan Berbasis Sumber Daya untuk Lambda AWS di Panduan Pengembang Lambda](https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html).AWS *  
+  Untuk detail API, lihat [RemovePermission](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/remove-permission.html)di *Referensi AWS CLI Perintah*. 

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

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini menghapus kebijakan fungsi untuk yang ditentukan StatementId dari Fungsi Lambda.**  

```
$policy =  Get-LMPolicy -FunctionName "MylambdaFunction123" -Select Policy | ConvertFrom-Json| Select-Object -ExpandProperty Statement
Remove-LMPermission -FunctionName "MylambdaFunction123" -StatementId $policy[0].Sid
```
+  Untuk detail API, lihat [RemovePermission](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 kebijakan fungsi untuk yang ditentukan StatementId dari Fungsi Lambda.**  

```
$policy =  Get-LMPolicy -FunctionName "MylambdaFunction123" -Select Policy | ConvertFrom-Json| Select-Object -ExpandProperty Statement
Remove-LMPermission -FunctionName "MylambdaFunction123" -StatementId $policy[0].Sid
```
+  Untuk detail API, lihat [RemovePermission](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------