

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 在 CodePipeline 中刪除管道
<a name="pipelines-delete"></a>

您可隨時編輯管道以變更其功能，但您也可以決定是否刪除它。您可以使用 AWS CodePipeline 主控台或 中的 **delete-pipeline**命令 AWS CLI 來刪除管道。

**Topics**
+ [刪除管道 (主控台)](#pipelines-delete-console)
+ [刪除管道 (CLI)](#pipelines-delete-cli)

## 刪除管道 (主控台)
<a name="pipelines-delete-console"></a>

**刪除管道**

1. 登入 AWS 管理主控台 並開啟 CodePipeline 主控台，網址為 https：//[http://console.aws.amazon.com/codesuite/codepipeline/home](https://console.aws.amazon.com/codesuite/codepipeline/home)。

   與 AWS 您的帳戶相關聯的所有管道的名稱和狀態都會顯示。

1. 在 **Name (名稱)** 中，選擇您想刪除的管道名稱。

1. 在管道詳細資訊頁面上，選擇 **Edit (編輯)**。

1. 在 **Edit (編輯)** 頁面上，選擇 **Delete (刪除)**。

1. 在欄位中輸入 **delete** 以確認，然後選擇 **Delete (刪除)**。
**重要**  
這個操作無法復原。

## 刪除管道 (CLI)
<a name="pipelines-delete-cli"></a>

若要使用 AWS CLI 手動刪除管道，請使用 [delete-pipeline](https://docs.aws.amazon.com/cli/latest/reference/codepipeline/delete-pipeline.html) 命令。

**重要**  
管道刪除後是無法復原的。沒有確認對話方塊。在命令執行後，該管道會被刪除，但管道中使用的資源都不會被刪除。這可讓您輕鬆建立新管道，這些管道會使用那些資源來自動化發佈您的軟體。

**刪除管道**

1. 開啟終端機 (Linux、macOS 或 Unix) 或命令提示字元 (Windows)，然後使用 AWS CLI 執行**delete-pipeline**命令，指定您要刪除的管道名稱。例如，若要刪除名為 {{MyFirstPipeline}} 的管道：

   ```
   aws codepipeline delete-pipeline --name {{MyFirstPipeline}}
   ```

   此命令不會傳回任何結果。

1. 刪除您不再使用的資源。
**注意**  
刪除管道不會刪除管道中使用的資源，例如您用來部署程式碼的 CodeDeploy 或 Elastic Beanstalk 應用程式，或者，如果您從 CodePipeline 主控台建立管道，則為建立來存放管道成品的 Amazon S3 儲存貯體 CodePipeline。請務必刪除您不再使用的資源，才不會在日後繼續為其付費。例如，當您第一次使用主控台建立管道時，CodePipeline 會建立一個 Amazon S3 儲存貯體來存放所有管道的所有成品。如果您已刪除所有管道，請依照[刪除儲存貯體](https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeletingaBucket.html)​中的步驟進行。