

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

# 步驟 5：刪除 MyStack
<a name="gettingstarted-delete"></a>

**重要**  
 AWS OpsWorks Stacks 此服務已於 2024 年 5 月 26 日終止，並已針對新客戶和現有客戶停用。我們強烈建議客戶盡快將其工作負載遷移至其他解決方案。如果您對遷移有任何疑問，請透過 [AWS re：Post](https://repost.aws/) 或透過 [AWS Premium Support](https://aws.amazon.com/support) 聯絡 AWS 支援 團隊。

一旦您開始使用 Amazon EC2 執行個體等 AWS 資源，就會根據用量收費。若您目前暫時不需要使用，建議您停止執行個體，以避免產生任何不必要的費用。若您不再需要堆疊，您可以刪除它。

**刪除 MyStack**

1. 

**停止所有執行個體**

   在 **Instances (執行個體)** 頁面上，按一下 **Stop All Instances (停止所有執行個體)**，然後在出現提示確認操作時，按一下 **Stop (停止)**。  
![\[Confirmation dialog asking if user wants to stop the stack, warning about data loss.\]](http://docs.aws.amazon.com/zh_tw/opsworks/latest/userguide/images/gse1.png)

   按一下**停止**後， OpsWorks Stacks 會終止相關聯的 Amazon EC2 執行個體，但不會終止任何相關聯的資源，例如彈性 IP 地址或 Amazon EBS 磁碟區。

1. 

**刪除所有執行個體**

   停止執行個體只會終止相關聯的 Amazon EC2 執行個體。在執行個體狀態顯示已停止時，您必須刪除每個執行個體。在 **PHP App Server (PHP 應用程式伺服器)** layer 中，在 php-app1 執行個體的 **Actions (動作)** 資料行中按一下 **delete (刪除)**。  
![\[PHP App Server table showing two instances with status, size, and actions including delete option.\]](http://docs.aws.amazon.com/zh_tw/opsworks/latest/userguide/images/gse2.png)

   OpsWorks Stacks 接著會要求您確認刪除，並顯示任何相依的資源。您可以選擇保留任何或全部的資源。此範例沒有依存資源，因此只需按一下 **Delete (刪除)**。

   針對 php-app2、**MySQL** 執行個體、db-master1 重複此程序。請注意，db-master1 具有相關聯的 Amazon Elastic Block Store 磁碟區，這是預設選取的。將其維持在選取狀態，以伴隨執行個體一同刪除它。

1. 

**刪除 Layer。**

   在 **Layers (Layer)** 頁面上，按一下 **Delete (刪除)**，然後按一下 **Delete (刪除)** 確認。  
![\[PHP App Server layer with options for General Settings, Recipes, Network, EBS Volumes, and Security.\]](http://docs.aws.amazon.com/zh_tw/opsworks/latest/userguide/images/gse4.png)

   針對 **MySQL** layer 重複此程序。

1. 

**刪除應用程式**

   在 **Apps (應用程式)** 頁面上，按一下 **SimplePHPApp** 應用程式的 **Actions (動作)** 資料行中的 **delete (刪除)**，然後按一下 **Delete (刪除)** 確認。  
![\[Confirmation dialog for deleting SimplePHPApp, warning of configuration loss.\]](http://docs.aws.amazon.com/zh_tw/opsworks/latest/userguide/images/gse5.png)

1. 

**刪除 MyStack**

   在 **Stack (堆疊)** 頁面上，按一下 **Delete Stack (刪除堆疊)**，然後按一下 **Delete (刪除)** 確認。  
![\[Confirmation dialog for deleting MyStack, warning of settings loss with Cancel and Delete options.\]](http://docs.aws.amazon.com/zh_tw/opsworks/latest/userguide/images/gse6.png)

這份演練到此結束。