

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

# Gunakan `DeletePolicy` dengan CLI
<a name="example_auto-scaling_DeletePolicy_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`DeletePolicy`.

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

**AWS CLI**  
**Untuk menghapus kebijakan penskalaan**  
Contoh ini menghapus kebijakan penskalaan yang ditentukan.  

```
aws autoscaling delete-policy \
    --auto-scaling-group-name my-asg \
    --policy-name alb1000-target-tracking-scaling-policy
```
Perintah ini tidak menghasilkan output.  
+  Untuk detail API, lihat [DeletePolicy](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/autoscaling/delete-policy.html)di *Referensi AWS CLI Perintah*. 

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

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini menghapus kebijakan yang ditentukan untuk grup Auto Scaling yang ditentukan. Anda diminta untuk konfirmasi sebelum operasi berlangsung.**  

```
Remove-ASPolicy -AutoScalingGroupName my-asg -PolicyName myScaleInPolicy
```
**Output:**  

```
Confirm
Are you sure you want to perform this action?
Performing operation "Remove-ASPolicy (DeletePolicy)" on Target "myScaleInPolicy".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):
```
**Contoh 2: Jika Anda menentukan parameter Force, Anda tidak diminta untuk konfirmasi sebelum operasi berlangsung.**  

```
Remove-ASPolicy -AutoScalingGroupName my-asg -PolicyName myScaleInPolicy -Force
```
+  Untuk detail API, lihat [DeletePolicy](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 yang ditentukan untuk grup Auto Scaling yang ditentukan. Anda diminta untuk konfirmasi sebelum operasi berlangsung.**  

```
Remove-ASPolicy -AutoScalingGroupName my-asg -PolicyName myScaleInPolicy
```
**Output:**  

```
Confirm
Are you sure you want to perform this action?
Performing operation "Remove-ASPolicy (DeletePolicy)" on Target "myScaleInPolicy".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):
```
**Contoh 2: Jika Anda menentukan parameter Force, Anda tidak diminta untuk konfirmasi sebelum operasi berlangsung.**  

```
Remove-ASPolicy -AutoScalingGroupName my-asg -PolicyName myScaleInPolicy -Force
```
+  Untuk detail API, lihat [DeletePolicy](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.