

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

# 部署產品
<a name="deploy-the-product"></a>

**注意**  
此產品使用 [AWS CloudFormation 範本和堆疊](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-whatis-concepts.html)來自動化其部署。CloudFormation 範本說明此產品中包含 AWS 的資源及其屬性。CloudFormation 堆疊會佈建範本中所述的資源。

啟動產品之前，請檢閱本指南先前討論[的成本](plan-your-deployment.md#plan-your-deployment-cost)、[架構](architecture-overview.md)、[網路安全](plan-your-deployment.md#plan-your-deployment-security)和其他考量事項。

**Topics**
+ [先決條件](prerequisites.md)
+ [建立外部資源](create-external-resources.md)
+ [步驟 1：啟動產品](launch-the-product.md)
+ [步驟 2：第一次登入](first-sign-in.md)

# 先決條件
<a name="prerequisites"></a>

**Topics**
+ [AWS 帳戶 使用管理使用者建立](#aws-account)
+ [建立 Amazon EC2 SSH 金鑰對](#create-ssh-key-pair)
+ [增加服務配額](#increase-service-quotas)
+ [建立 Cognito 使用者集區 （選用）](#create-cognito-user-pool)
+ [建立自訂網域 （選用）](#create-public-domain)
+ [建立網域 （僅限 GovCloud)](#create-domain-govcloud)
+ [提供外部資源](#external-resources)
+ [在您的環境中設定 LDAPS （選用）](#configure-ldaps)
+ [設定 Microsoft Active Directory 的服務帳戶](#service-account-ms-ad)
+ [設定私有 VPC （選用）](#private-vpc)

## AWS 帳戶 使用管理使用者建立
<a name="aws-account"></a>

您必須擁有 AWS 帳戶 具有 管理使用者的 ：

1. 開啟 [https://portal.aws.amazon.com/billing/signup](https://portal.aws.amazon.com/billing/signup)。

1. 請遵循線上指示進行。

   部分註冊程序需接收來電或簡訊，並在電話鍵盤輸入驗證碼。

   當您註冊 時 AWS 帳戶，*AWS 帳戶根使用者*會建立 。根使用者有權存取該帳戶中的所有 AWS 服務 和資源。作為安全最佳實務，請將管理存取權指派給使用者，並且僅使用根使用者來執行[需要根使用者存取權的任務](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html#root-user-tasks)。

## 建立 Amazon EC2 SSH 金鑰對
<a name="create-ssh-key-pair"></a>

如果您沒有 Amazon EC2 SSH 金鑰對，則必須建立一個金鑰對。如需詳細資訊，請參閱《[Amazon EC2 使用者指南》中的使用 Amazon EC2 建立金鑰對](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-key-pairs.html)。 *Amazon EC2 * 

## 增加服務配額
<a name="increase-service-quotas"></a>

最佳實務是[增加下列項目的服務配額](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html)：
+ [ Amazon VPC](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)
  + 將每個 NAT 閘道的彈性 IP 地址配額從 5 提高到 8。
  + 將每個可用區域的 NAT 閘道從 5 增加到 10。
+ [ Amazon EC2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-resource-limits.html) 
  + 將 EC2-VPC 彈性 IPs 從 5 提高到 10。

 AWS 您的帳戶具有每個 AWS 服務的預設配額。除非另有說明，否則每個配額都是區域特定的。您可以請求提高某些配額，而其他配額無法提高。如需詳細資訊，請參閱[此產品中 AWS 服務的配額](plan-your-deployment.md#quotas-for-aws-services-in-this-product)。

## 建立 Cognito 使用者集區 （選用）
<a name="create-cognito-user-pool"></a>

您可以選擇在安裝 RES 時匯入現有的 Cognito 使用者集區，以進行使用者和用戶端身分驗證。否則，RES 會自動建立新的 Cognito 使用者集區。預先存在的使用者集區必須具有下列註冊自訂屬性：


| 名稱 | 類型 | 最小值/長度 | 最大值/長度 | Mutable | 
| --- | --- | --- | --- | --- | 
| custom：aws\$1region | String |  |  | TRUE | 
| custom：cluster\$1name | String |  |  | TRUE | 
| custom：password\$1last\$1set  | Number |  |  | TRUE | 
| custom：password\$1max\$1age | Number |  |  | TRUE | 
| custom：uid | Number | 2000200001 | 4294967294 | TRUE | 

## 建立自訂網域 （選用）
<a name="create-public-domain"></a>

最佳實務是針對易於使用的 URL，使用產品的自訂網域。您可以提供自訂網域，並*選擇性地*為其提供憑證。

外部資源堆疊中有一個程序，可為您提供的自訂網域建立憑證。如果您有網域並想要使用外部資源堆疊的憑證產生功能，您可以略過此處的步驟。

或者，請依照下列步驟使用 Amazon Route 53 註冊網域，並使用 匯入網域的憑證 AWS Certificate Manager。

1. 依照指示向 Route 53 [註冊網域](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-register.html#register_new_console)。您應該會收到確認電子郵件。

1. 擷取網域的託管區域。Route 53 會自動建立此項目。

   1. 開啟 Route 53 主控台。

   1. 從左側導覽中選擇**託管區域**。

   1. 開啟為您的網域名稱建立的託管區域，並複製**託管區域 ID**。

1. 開啟 AWS Certificate Manager 並依照下列步驟[請求網域憑證](https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html)。確定您位於您計劃部署解決方案的 區域。

1. 從導覽中選擇**列出憑證**，然後尋找您的憑證請求。請求應處於待定狀態。

1. 選擇您的**憑證 ID** 以開啟請求。

1. 在**網域**區段中，選擇在 ** Route 53 中建立記錄**。處理請求大約需要十分鐘。

1. 發出憑證後，請從**憑證狀態**區段複製 **ARN**。

## 建立網域 （僅限 GovCloud)
<a name="create-domain-govcloud"></a>

如果您要部署在 an AWS GovCloud 區域中，而且正在使用適用於 Research and Engineering Studio 的自訂網域，則必須完成這些先決條件步驟。

1. 在建立公有託管網域的商業分割區 AWS 帳戶中部署[憑證 CloudFormation 堆疊](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/quickcreate?templateURL=https://s3.amazonaws.com/aws-hpc-recipes/main/recipes/security/public_certs/assets/main.yaml)。

1. 從**憑證 CloudFormation 輸出**中，尋找並記下 `CertificateARN`和 `PrivateKeySecretARN`。

1. 在 GovCloud 分割區帳戶中，建立具有`CertificateARN`輸出值的秘密。請注意新的秘密 ARN，並將兩個標籤新增至秘密，以便 `vdc-gateway` 可以存取秘密值：

   1. res：ModuleName = virtual-desktop-controller 

   1. res：EnvironmentName = 【環境名稱】 （這可能是 res-demo。) 

1. 在 GovCloud 分割區帳戶中，建立具有`PrivateKeySecretARN`輸出值的秘密。請注意新的秘密 ARN，並將兩個標籤新增至秘密，以便 `vdc-gateway` 可以存取秘密值：

   1. res：ModuleName = virtual-desktop-controller

   1. res：EnvironmentName = 【環境名稱】 （這可能是 res-demo。)

## 提供外部資源
<a name="external-resources"></a>

上的研究和工程 Studio AWS 預期在部署時存在下列外部資源。
+ **網路 (VPC、公有子網路和私有子網路）**

  在這裡，您將執行用於託管 RES 環境、Active Directory (AD) 和共用儲存體的 EC2 執行個體。
+ **儲存 (Amazon EFS)**

  儲存磁碟區包含虛擬桌面基礎設施 (VDI) 所需的檔案和資料。
+ **目錄服務 (AWS Directory Service for Microsoft Active Directory) **

  目錄服務會將使用者驗證為 RES 環境。
+ **秘密，其中包含格式化為鍵/值對的 Active Directory 服務帳戶使用者名稱和密碼 （使用者名稱、密碼）**

  Research and Engineering Studio 會使用 存取[您提供的秘密](secrets-management.md)，包括服務帳戶密碼[AWS Secrets Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html)。

**警告**  
您必須為要同步的所有 Active Directory (AD) 使用者提供有效的電子郵件地址。

**提示**  
如果您正在部署示範環境，但沒有這些外部資源可用，則可以使用 AWS 高效能運算配方來產生外部資源。請參閱下一節 [建立外部資源](create-external-resources.md)，以在您的帳戶中部署資源。  
對於 an AWS GovCloud 區域中的示範部署，您必須完成 中的先決條件步驟[建立網域 （僅限 GovCloud)](#create-domain-govcloud)。

## 在您的環境中設定 LDAPS （選用）
<a name="configure-ldaps"></a>

如果您計劃在環境中使用 LDAPS 通訊，則必須完成以下步驟，才能建立憑證並將其連接至 AWS Managed Microsoft AD (AD) 網域控制器，以提供 AD 和 RES 之間的通訊。

1. 請遵循[如何為您的 啟用伺服器端 LDAPS AWS Managed Microsoft AD](https://aws.amazon.com/blogs/security/how-to-enable-ldaps-for-your-aws-microsoft-ad-directory/)中提供的步驟。如果您已啟用 LDAPS，則可以略過此步驟。

1. 確認已在 AD 上設定 LDAPS 之後，匯出 AD 憑證：

   1. 前往您的 Active Directory 伺服器。

   1. 以管理員身分開啟 PowerShell。

   1. 執行 `certmgr.msc` 以開啟憑證清單。

   1. 首先開啟信任的根憑證授權機構，然後開啟憑證清單。

   1. 選取並按住 （或以滑鼠右鍵按一下） 與 AD 伺服器同名的憑證，然後選擇**所有任務**，然後選擇**匯出**。

   1. 選取 **Base-64 編碼的 X.509 (.CER)**，然後選擇**下一步**。

   1. 選取目錄，然後選擇**下一步**。

1. 在 中建立秘密 AWS Secrets Manager：

   在 Secrets Manager 中建立機密時，在**機密類型**下選擇**其他類型的機密**，並將 PEM 編碼的憑證貼到**純文字**欄位中。

1. 請注意建立的 ARN，並將其輸入為 中的 `DomainTLSCertificateSecretARN` 參數[步驟 1：啟動產品](launch-the-product.md)。

## 設定 Microsoft Active Directory 的服務帳戶
<a name="service-account-ms-ad"></a>

如果您選擇 Microsoft Active Directory (AD) 作為 RES 的身分來源，則 AD 中會有允許程式設計存取的服務帳戶。做為 RES 安裝的一部分，您必須使用服務帳戶的登入資料傳遞秘密。秘密的格式必須如下所示。

![\[使用者名稱和密碼格式範例\]](http://docs.aws.amazon.com/zh_tw/res/latest/ug/images/res-secret-value-example.png)


另請注意， `username` 欄位不支援格式 的 NT 樣式登入名稱`DOMAIN\username`。

服務帳戶負責下列函數：
+ 從 AD 同步使用者：RES 必須從 AD 同步使用者，以允許他們登入 Web 入口網站。同步程序會使用 服務帳戶查詢使用 LDAP 的 AD （以確定哪些使用者和群組可用）。
+ 加入 AD 網域：這是 Linux 虛擬桌面和基礎設施主機的選用操作，其中執行個體會加入 AD 網域。在 RES 中，這會使用 `DisableADJoin` 參數控制。此參數預設為 False，這表示 Linux 虛擬桌面會嘗試在預設組態中加入 AD 網域。
+ 連線至 AD：如果 Linux 虛擬桌面和基礎設施主機未加入 AD 網域，則會連線至 AD 網域 (`DisableADJoin` = True)。為了讓此功能運作，服務帳戶也需要 `UsersOU`和 中使用者和群組的讀取存取權`GroupsOU`。

服務帳戶需要下列許可：
+ 同步使用者並連線至 AD → `UsersOU`和 中使用者和群組的讀取存取權`GroupsOU`。
+ 若要加入 AD 網域 → 在 中建立`Computer`物件`ComputersOU`。

https：//[https://github.com/aws-samples/aws-hpc-recipes/blob/main/recipes/res/res\$1demo\$1env/assets/service\$1account.ps1 ](https://github.com/aws-samples/aws-hpc-recipes/blob/main/recipes/res/res_demo_env/assets/service_account.ps1)的指令碼提供如何授予適當服務帳戶許可的範例。您可以根據自己的 AD 進行修改。

## 設定私有 VPC （選用）
<a name="private-vpc"></a>

在隔離的 VPC 中部署研究和工程 Studio 可提供增強的安全性，以滿足組織的合規和管理要求。不過，標準 RES 部署依賴網際網路存取來安裝相依性。若要在私有 VPC 中安裝 RES，您需要滿足下列先決條件：

**Topics**
+ [準備 Amazon Machine Image AMIs)](#prep-ami)
+ [設定 VPC 端點](#private-vpc-endpoints)
+ [在沒有 VPC 端點的情況下連線至 服務](#connect-services-without-endpoints)
+ [設定私有 VPC 部署參數](#vpc-deployment-parameters)

### 準備 Amazon Machine Image AMIs)
<a name="prep-ami"></a>

1. 在 https：//[https://research-engineering-studio-us-east-1.s3.amazonaws.com/releases/latest/res-installation-scripts.tar.gz ](https://research-engineering-studio-us-east-1.s3.amazonaws.com/releases/latest/res-installation-scripts.tar.gz)下載相依性。若要在隔離的 VPC 中部署，RES 基礎設施需要有相依性的可用性，而不需要公有網際網路存取。
**重要**  
如果您的 RES 環境版本不是最新的，請將下載 URI **latest**中的 取代為確切的版本編號 （例如 **2025.06**)。

1. 使用 Amazon S3 唯讀存取和 Amazon EC2 的受信任身分建立 IAM 角色。

   1. 前往 [https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/) 開啟 IAM 主控台。

   1. 在**角色**中，選擇**建立角色**。

   1. 在**選取信任的實體**頁面：
      + 在**信任的實體類型**下，選擇 AWS 服務。
      + 針對服務或**使用案例**下的**使用案例**，選擇 **EC2**，然後選擇**下一步**。

   1. 在**新增許可**上，選取下列許可政策，然後選擇**下一步**：
      + AmazonS3ReadOnlyAccess
      + AmazonSSMManagedInstanceCore
      + EC2InstanceProfileForImageBuilder

   1. 新增**角色名稱**和**描述**，然後選擇**建立角色**。

1. 建立 EC2 映像建置器元件：

   1. 在 開啟 EC2 Image Builder 主控台[https://console.aws.amazon.com//imagebuilder](https://console.aws.amazon.com//imagebuilder)。

   1. 在**已儲存資源**下，選擇**元件**，然後選擇**建立元件**。

   1. 在**建立元件**頁面上，輸入下列詳細資訊：
      + 針對**元件類型**，選擇**建置**。
      + 如需**元件詳細資訊**，請選擇：    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/res/latest/ug/prerequisites.html)

   1. 在**建立元件**頁面上，選擇**定義文件內容**。

      1. 在輸入定義文件內容之前，您需要 tar.gz 檔案的檔案 URI。將 RES 提供的 tar.gz 檔案上傳至 Amazon S3 儲存貯體，並從儲存貯體屬性複製檔案的 URI。

      1. 輸入下列資料：
**注意**  
`AddEnvironmentVariables` 是選用的，如果您在基礎設施主機中不需要自訂環境變數，則可以將其移除。  
如果您要設定 `http_proxy`和 `https_proxy`環境變數，則需要這些`no_proxy`參數，以防止執行個體使用代理來查詢 localhost、執行個體中繼資料 IP 地址，以及支援 VPC 端點的服務。

         ```
         #  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
         #
         #  Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
         #  with the License. A copy of the License is located at
         #
         #      http://www.apache.org/licenses/LICENSE-2.0
         #
         #  or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
         #  OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
         #  and limitations under the License.
         name: research-and-engineering-studio-infrastructure
         description: An RES EC2 Image Builder component to install required RES software dependencies for infrastructure hosts.
         schemaVersion: 1.0
         
         parameters:
           - AWSRegion:
               type: string
               description: RES Environment AWS Region
         phases:
           - name: build
             steps:
                - name: DownloadRESInstallScripts
                  action: S3Download
                  onFailure: Abort
                  maxAttempts: 3
                  inputs:
                     - source: '<s3 tar.gz file uri>'
                       destination: '/root/bootstrap/res-installation-scripts/res-installation-scripts.tar.gz'
                - name: RunInstallScript
                  action: ExecuteBash
                  onFailure: Abort
                  maxAttempts: 3
                  inputs:
                     commands:
                         - 'cd /root/bootstrap/res-installation-scripts'
                         - 'tar -xf res-installation-scripts.tar.gz'
                         - 'cd scripts/infrastructure-host'
                         - '/bin/bash install.sh'
                - name: AddEnvironmentVariables
                  action: ExecuteBash
                  onFailure: Abort
                  maxAttempts: 3
                  inputs:
                     commands:
                         - |
                           echo -e "
                           http_proxy=http://<ip>:<port>
                           https_proxy=http://<ip>:<port>
                           no_proxy=127.0.0.1,169.254.169.254,169.254.170.2,localhost,{{ AWSRegion }}.res,{{ AWSRegion }}.vpce.amazonaws.com,{{ AWSRegion }}.elb.amazonaws.com,s3.{{ AWSRegion }}.amazonaws.com,s3.dualstack.{{ AWSRegion }}.amazonaws.com,ec2.{{ AWSRegion }}.amazonaws.com,ec2.{{ AWSRegion }}.api.aws,ec2messages.{{ AWSRegion }}.amazonaws.com,ssm.{{ AWSRegion }}.amazonaws.com,ssmmessages.{{ AWSRegion }}.amazonaws.com,kms.{{ AWSRegion }}.amazonaws.com,secretsmanager.{{ AWSRegion }}.amazonaws.com,sqs.{{ AWSRegion }}.amazonaws.com,elasticloadbalancing.{{ AWSRegion }}.amazonaws.com,sns.{{ AWSRegion }}.amazonaws.com,logs.{{ AWSRegion }}.amazonaws.com,logs.{{ AWSRegion }}.api.aws,elasticfilesystem.{{ AWSRegion }}.amazonaws.com,fsx.{{ AWSRegion }}.amazonaws.com,dynamodb.{{ AWSRegion }}.amazonaws.com,api.ecr.{{ AWSRegion }}.amazonaws.com,.dkr.ecr.{{ AWSRegion }}.amazonaws.com,kinesis.{{ AWSRegion }}.amazonaws.com,.data-kinesis.{{ AWSRegion }}.amazonaws.com,.control-kinesis.{{ AWSRegion }}.amazonaws.com,events.{{ AWSRegion }}.amazonaws.com,cloudformation.{{ AWSRegion }}.amazonaws.com,sts.{{ AWSRegion }}.amazonaws.com,application-autoscaling.{{ AWSRegion }}.amazonaws.com,monitoring.{{ AWSRegion }}.amazonaws.com,ecs.{{ AWSRegion }}.amazonaws.com,.execute-api.{{ AWSRegion }}.amazonaws.com
                            " >> /etc/environment launch template
         ```

   1. 選擇**建立元件**。

1. 建立映像建置器映像配方。

   1. 在**建立配方**頁面上，輸入下列內容：    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/res/latest/ug/prerequisites.html)

   1. 選擇**建立配方**。

1. 建立映像建置器基礎設施組態。

   1. 在**已儲存資源**下，選擇**基礎設施組態**。

   1. 選擇**建立基礎設施組態**。

   1. 在**建立基礎設施組態**頁面上，輸入下列內容：    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/res/latest/ug/prerequisites.html)

   1. 選擇**建立基礎設施組態**。

1. 建立新的 EC2 Image Builder 管道：

   1. 前往**映像管道**，然後選擇**建立映像管道**。

   1. 在**指定管道詳細資訊**頁面上，輸入以下內容並選擇**下一步**：
      + 管道名稱和選用描述
      + 針對**建置排程**，如果您想要**手動**啟動 AMI 製作程序，請設定排程或選擇手動。

   1. 在**選擇配方**頁面上，選擇**使用現有配方**，然後輸入先前建立**的配方名稱**。選擇**下一步**。

   1. 在**定義映像程序**頁面上，選取預設工作流程，然後選擇**下一步**。

   1. 在**定義基礎設施組態**頁面上，選擇**使用現有的基礎設施組態**，然後輸入先前建立的基礎設施組態名稱。選擇**下一步**。

   1. 在**定義分佈設定**頁面上，針對您的選擇考慮下列事項：
      + 輸出映像必須與部署的 RES 環境位於相同的區域，以便 RES 可以從中正確啟動基礎設施主機執行個體。使用服務預設值，輸出映像會在使用 EC2 Image Builder 服務的區域中建立。
      + 如果您想要在多個區域中部署 RES，您可以選擇**建立新的分佈設定**，並在該處新增更多區域。

   1. 檢閱您的選擇，然後選擇**建立管道**。

1. 執行 EC2 Image Builder 管道：

   1. 從**映像管道**中，尋找並選取您建立的管道。

   1. 選擇**動作**，然後選取**執行管道**。

      管道可能需要大約 45 分鐘到一小時的時間來建立 AMI 映像。

1. 請注意產生的 AMI 的 AMI ID，並將其用作 中 InfrastructureHostAMI 參數的輸入[步驟 1：啟動產品](launch-the-product.md)。

### 設定 VPC 端點
<a name="private-vpc-endpoints"></a>

 若要部署 RES 並啟動虛擬桌面， AWS 服務 需要存取您的私有子網路。您必須設定 VPC 端點以提供必要的存取權，而且您必須為每個端點重複這些步驟。

1. 如果先前尚未設定端點，請遵循[AWS 服務 使用介面 VPC 端點存取](https://docs.aws.amazon.com/vpc/latest/privatelink/create-interface-endpoint.html) 中提供的指示。

1. 在兩個可用區域中各選取一個私有子網路。

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/res/latest/ug/prerequisites.html)

### 在沒有 VPC 端點的情況下連線至 服務
<a name="connect-services-without-endpoints"></a>

若要與不支援 VPC 端點的服務整合，您可以在 VPC 的公有子網路中設定代理伺服器。請依照下列步驟，使用 AWS 身分中心做為您的身分提供者，建立具有 Research and Engineering Studio 部署所需最低存取權的代理伺服器。

1. 在將用於 RES 部署的 VPC 公有子網路中啟動 Linux 執行個體。
   + Linux 系列 – Amazon Linux 2 或 Amazon Linux 3
   + 架構 – x86
   + 執行個體類型 – t2.micro 或更高版本
   + 安全群組 – 從 0.0.0.0/0 起連接埠 3128 上的 TCP

1. 連線至執行個體以設定代理伺服器。

   1. 開啟 http 連線。

   1. 允許從所有相關子網路連線至下列網域：
      + .amazonaws.com （適用於一般 AWS 服務）
      + .amazoncognito.com （適用於 Amazon Cognito)
      + .awsapps.com （適用於 Identity Center)
      + .signin.aws （適用於 Identity Center)
      + .amazonaws-us-gov.com （適用於 Gov Cloud)

   1. 拒絕所有其他連線。

   1. 啟用並啟動代理伺服器。

   1. 請注意代理伺服器接聽的 PORT。

1. 設定您的路由表以允許存取代理伺服器。

   1. 前往 VPC 主控台，找出您將用於基礎設施主機和 VDI 主機的子網路路由表。

   1. 編輯路由表，以允許所有傳入連線前往先前步驟中建立的代理伺服器執行個體。

   1. 針對您要用於基礎設施/VDIs 的所有子網路 （無網際網路存取） 的路由表執行此操作。

1. 修改代理伺服器 EC2 執行個體的安全群組，並確保其允許代理伺服器接聽之 PORT 上的傳入 TCP 連線。

### 設定私有 VPC 部署參數
<a name="vpc-deployment-parameters"></a>

在 中[步驟 1：啟動產品](launch-the-product.md)，您需要在 CloudFormation 範本中輸入特定參數。請務必依照說明設定下列參數，以成功部署到您剛設定的私有 VPC。


| 參數 | Input | 
| --- |--- |
| InfrastructureHostAMI | Use the infrastructure AMI ID created in [準備 Amazon Machine Image AMIs)](#prep-ami). | 
| IsLoadBalancerInternetFacing | Set to false. | 
| LoadBalancerSubnets | Choose private subnets without internet access. | 
| InfrastructureHostSubnets | Choose private subnets without internet access. | 
| VdiSubnets | Choose private subnets without internet access. | 
|  ClientIP  | You can choose your VPC CIDR to allow access for all VPC IP addresses. | 
|  HttpProxy  | Example: http://10.1.2.3:123 | 
|  HttpsProxy  | Example: http://10.1.2.3:123 | 
|  NoProxy  | 範例： <pre>127.0.0.1,169.254.169.254,169.254.170.2,localhost,us-east-1.res,us-east-1.vpce.amazonaws.com,us-east-1.elb.amazonaws.com,s3.us-east-1.amazonaws.com,s3.dualstack.us-east-1.amazonaws.com,ec2.us-east-1.amazonaws.com,ec2.us-east-1.api.aws,ec2messages.us-east-1.amazonaws.com,ssm.us-east-1.amazonaws.com,ssmmessages.us-east-1.amazonaws.com,kms.us-east-1.amazonaws.com,secretsmanager.us-east-1.amazonaws.com,sqs.us-east-1.amazonaws.com,elasticloadbalancing.us-east-1.amazonaws.com,sns.us-east-1.amazonaws.com,logs.us-east-1.amazonaws.com,logs.us-east-1.api.aws,elasticfilesystem.us-east-1.amazonaws.com,fsx.us-east-1.amazonaws.com,dynamodb.us-east-1.amazonaws.com,api.ecr.us-east-1.amazonaws.com,.dkr.ecr.us-east-1.amazonaws.com,kinesis.us-east-1.amazonaws.com,.data-kinesis.us-east-1.amazonaws.com,.control-kinesis.us-east-1.amazonaws.com,events.us-east-1.amazonaws.com,cloudformation.us-east-1.amazonaws.com,sts.us-east-1.amazonaws.com,application-autoscaling.us-east-1.amazonaws.com,monitoring.us-east-1.amazonaws.com,ecs.us-east-1.amazonaws.com,.execute-api.us-east-1.amazonaws.com </pre>  | 

# 建立外部資源
<a name="create-external-resources"></a>

此 CloudFormation 堆疊會建立聯網、儲存體、作用中目錄和網域憑證 （如果提供 PortalDomainName)。您必須擁有這些外部資源，才能部署產品。

您可以在部署之前[下載配方範本](https://s3.amazonaws.com/aws-hpc-recipes/main/recipes/res/res_demo_env/assets/bi.yaml)。

**部署時間：**約 40-90 分鐘 

1. 登入 AWS 管理主控台 並在 https：//[https://console.aws.amazon.com/cloudformation](https://console.aws.amazon.com/cloudformation/) 開啟 CloudFormation 主控台。
**注意**  
請確定您在管理員帳戶中。

1. 在 主控台中啟動 [ 範本](https://console.aws.amazon.com/cloudformation/home#/stacks/quickcreate?templateURL=https%3A%2F%2Fs3.amazonaws.com%2Faws-hpc-recipes%2Fmain%2Frecipes%2Fres%2Fres_demo_env%2Fassets%2Fbi.yaml)。

   如果您要部署在 an AWS GovCloud 區域中，請在 GovCloud 分割區帳戶中啟動範本 （例如，[GovCloud](https://console.amazonaws-us-gov.com/cloudformation/home?region=us-gov-west-1#/stacks/quickcreate?templateURL=https://s3.amazonaws.com/aws-hpc-recipes/main/recipes/res/res_demo_env/assets/bi.yaml) AWS GovCloud （美國西部） 區域在此處）。

1. 輸入範本參數：
**重要**  
針對 `AdminPassword`和 使用不同的值`ServiceAccountPassword`，在這些帳戶之間維持適當的安全界限。    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/res/latest/ug/create-external-resources.html)

1.  確認**功能**中的所有核取方塊，然後選擇**建立堆疊**。

# 步驟 1：啟動產品
<a name="launch-the-product"></a>

請依照本節中的step-by-step說明，設定並將產品部署至您的帳戶。

**部署時間：**約 60 分鐘 

您可以在部署之前下載此產品的 [ CloudFormation 範本](https://research-engineering-studio-us-east-1.s3.amazonaws.com/releases/latest/ResearchAndEngineeringStudio.template.json)。

如果您要部署 in AWS GovCloud （美國西部），請使用此[範本](https://research-engineering-studio-us-gov-west-1.s3.us-gov-west-1.amazonaws.com/releases/latest/ResearchAndEngineeringStudio.template.json)。

**res-stack** - 使用此範本啟動產品和所有相關聯的元件。預設組態會部署 RES 主要堆疊和身分驗證、前端和後端資源。

**注意**  
AWS CloudFormation 資源是從 AWS Cloud Development Kit (AWS CDK) (AWS CDK) 建構模組建立的。

 AWS CloudFormation 範本會在 AWS 的 上部署 Research and Engineering Studio AWS 雲端。您必須先符合[先決條件](prerequisites.md)，才能啟動堆疊。

1. 登入 AWS 管理主控台 並開啟位於 https：//[https://console.aws.amazon.com/cloudformation](https://console.aws.amazon.com/cloudformation/) 的 CloudFormation 主控台。

1. 啟動[範本 ](https://console.aws.amazon.com/cloudformation/home#/stacks/quickcreate?templateURL=https%3A%2F%2Fresearch-engineering-studio-us-east-1.s3.amazonaws.com%2Freleases%2Flatest%2FResearchAndEngineeringStudio.template.json)。

   若要部署 in AWS GovCloud （美國西部），請啟動此[範本](https://console.amazonaws-us-gov.com/cloudformation/home?region=us-gov-west-1#/stacks/quickcreate?templateURL=https://research-engineering-studio-us-gov-west-1.s3.us-gov-west-1.amazonaws.com/releases/latest/ResearchAndEngineeringStudio.template.json)。

1. 根據預設，範本會在美國東部 （維吉尼亞北部） 區域啟動。若要在不同的 中啟動產品 AWS 區域，請使用主控台導覽列中的區域選擇器。
**注意**  
此產品使用 Amazon Cognito 服務，目前尚未在所有 中提供 AWS 區域。您必須在可使用 Amazon Cognito AWS 區域 的 中啟動此產品。如需各區域的最新可用性，請參閱 [AWS 區域 al Services List](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/)。

1. 在**參數**下，檢閱此產品範本的參數，並視需要修改。如果您部署了自動化外部資源，您可以在外部資源堆疊的**輸出**索引標籤中找到這些參數。    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/res/latest/ug/launch-the-product.html)

1. 在**設定堆疊選項 → 標籤 - *選用***下，新增您要套用至 RES 部署資源的標籤 （鍵/值對）。標籤索引鍵 `Name`和 由 RES `res:*`保留，不能用作標籤索引鍵。

1. 選擇 **Create stack** (建立堆疊) 以部署堆疊。

您可以在狀態欄的 AWS CloudFormation 主控台中檢視堆疊**的狀態**。您會在大約 60 分鐘內收到 CREATE\$1COMPLETE 狀態。

**重要**  
您有責任在部署後修補您的基礎設施/VDI 主機。

# 步驟 2：第一次登入
<a name="first-sign-in"></a>

在 帳戶中部署產品堆疊之後，您會收到包含登入資料的電子郵件。使用 URL 登入您的帳戶，並為其他使用者設定工作區。

![\[首次登入電子郵件邀請\]](http://docs.aws.amazon.com/zh_tw/res/latest/ug/images/res-firstsignin.png)


第一次登入後，您可以在 Web 入口網站中設定 設定以連線至 SSO 供應商。如需部署後組態資訊，請參閱 [組態指南](configuration-guide.md)。請注意， `clusteradmin` 是突破性的帳戶 — 您可以使用它來建立專案，並將使用者或群組成員資格指派給這些專案；它無法自行指派軟體堆疊或部署桌面。