

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

# 在 Visual Studio 中建立 CloudFormation 範本專案
<a name="tkv-cfn-editor-new-project"></a>

 **建立範本專案** 

1. 在 Visual Studio 中，選擇**檔案**，選擇**新增**，然後選擇**專案**。

1. **針對 Visual Studio 2017**：

   在**新增專案**對話方塊中，展開**已安裝**，然後選取 **AWS**。  
![\[New Project dialog box showing CloudFormation and Lambda Function project options.\]](http://docs.aws.amazon.com/zh_tw/toolkit-for-visual-studio/latest/user-guide/images/CreateNewProject-04-CloudFormation-VS2017.png)

   **針對 Visual Studio 2019**：

   在**新增專案**對話方塊中，確保**語言**、**平台**和**專案類型**下拉式方塊設定為「全部...」，並在**搜尋**欄位中輸入 **aws**。  
![\[Project template options for AWS 服務, including Lambda, CloudFormation, and Serverless applications.\]](http://docs.aws.amazon.com/zh_tw/toolkit-for-visual-studio/latest/user-guide/images/CreateNewProject-04-CloudFormation-VS2019.png)

1. 選取 **AWS CloudFormation 專案**範本。

1. **針對 Visual Studio 2017**：

   輸入範本專案所需的**名稱**、**位置**等，然後按一下**確定**。

   **針對 Visual Studio 2019**：

   按一下 **Next (下一步)**。在下一個對話方塊中，輸入範本專案所需的**名稱**、**位置**等，然後按一下**建立**。

1. 在**選取專案來源**頁面上，選擇您將建立的範本來源：
   +  **使用空白範本建立** 會產生新的空白 CloudFormation 範本。
   +  **從現有 AWS \$1CFN\$1 堆疊建立** 會從您 AWS 帳戶中的現有堆疊產生範本。（堆疊不需要狀態為 `CREATE_COMPLETE`。)
   +  **選取範例範本**會從其中一個 CloudFormation 範例範本產生範本。  
![\[CloudFormation project creation window with options for template source selection.\]](http://docs.aws.amazon.com/zh_tw/toolkit-for-visual-studio/latest/user-guide/images/vs-editor-new-template-empty-2.png)

1. 若要完成 CloudFormation 範本專案的建立，請選擇**完成**。