View a markdown version of this page

Gunakan DeleteFlowLogs dengan CLI - Amazon Elastic Compute Cloud

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

Gunakan DeleteFlowLogs dengan CLI

Contoh kode berikut menunjukkan cara menggunakanDeleteFlowLogs.

CLI
AWS CLI

Untuk menghapus log alur

delete-flow-logsContoh berikut menghapus log alur yang ditentukan.

aws ec2 delete-flow-logs --flow-log-id fl-11223344556677889

Output:

{ "Unsuccessful": [] }
PowerShell
Alat untuk PowerShell V4

Contoh 1: Contoh ini menghapus FlowLogId fl-01a2b3456a789c01 yang diberikan

Remove-EC2FlowLog -FlowLogId fl-01a2b3456a789c01

Output:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-EC2FlowLog (DeleteFlowLogs)" on target "fl-01a2b3456a789c01". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
  • Untuk detail API, lihat DeleteFlowLogs di Referensi Alat AWS untuk PowerShell Cmdlet (V4).

Alat untuk PowerShell V5

Contoh 1: Contoh ini menghapus FlowLogId fl-01a2b3456a789c01 yang diberikan

Remove-EC2FlowLog -FlowLogId fl-01a2b3456a789c01

Output:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-EC2FlowLog (DeleteFlowLogs)" on target "fl-01a2b3456a789c01". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
  • Untuk detail API, lihat DeleteFlowLogs di Referensi Alat AWS untuk PowerShell Cmdlet (V5).

Untuk daftar lengkap panduan pengembang AWS SDK dan contoh kode, lihatMembuat EC2 sumber daya Amazon menggunakan AWS SDK. Topik ini juga mencakup informasi tentang memulai dan detail tentang versi SDK sebelumnya.