本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
客戶受管環境
透過客戶受管環境,您可以使用已部署為 AWS Proton 環境的現有基礎設施,例如 VPC。使用客戶受管環境時,您可以在 外部佈建自己的共用資源 AWS Proton。不過,您仍然可以允許 在部署服務時 AWS Proton ,使用相關的佈建輸出做為 AWS Proton 服務的輸入。如果輸出可以變更, AWS Proton 可以接受更新。但是,由於佈建是在 外部管理,因此 AWS Proton 無法直接變更環境 AWS Proton。
建立環境之後,您必須負責提供相同的輸出給 AWS Proton ,如果 AWS Proton 已建立環境,例如 Amazon ECS 叢集名稱或 Amazon VPC IDs。
透過此功能,您可以將 AWS Proton 服務資源從 AWS Proton 服務範本部署和更新至此環境。不過,環境本身不會透過 中的範本更新進行修改 AWS Proton。您有責任執行環境的更新,並在其中更新這些輸出 AWS Proton。
您可以在單一帳戶中擁有多個混合 AWS Proton 受管環境和客戶受管環境的環境。您也可以連結第二個帳戶,並使用主要帳戶中的 AWS Proton 範本,對該第二個連結帳戶中的環境和服務執行部署和更新。
如何使用客戶受管環境
管理員需要做的第一件事是註冊匯入的客戶受管環境範本。請勿在範本套件中提供資訊清單或基礎設施檔案。僅提供結構描述。
下面的結構描述概述了使用開放 API 格式的輸出清單,並從 AWS CloudFormation 範本複寫輸出。
重要
輸出只允許輸入字串。
下列範例是對應 Fargate 範本之 AWS CloudFormation 範本輸出區段的程式碼片段。
Outputs: ClusterName: Description: The name of the ECS cluster Value: !Ref 'ECSCluster' ECSTaskExecutionRole: Description: The ARN of the ECS role Value: !GetAtt 'ECSTaskExecutionRole.Arn' VpcId: Description: The ID of the VPC that this stack is deployed in Value: !Ref 'VPC' [...]
對應 AWS Proton 匯入環境的結構描述類似如下。請勿在結構描述中提供預設值。
schema: format: openapi: "3.0.0" environment_input_type: "EnvironmentOutput" types: EnvironmentOutput: type: object description: "Outputs of the environment" properties: ClusterName: type: string description: "The name of the ECS cluster" ECSTaskExecutionRole: type: string description: "The ARN of the ECS role" VpcId: type: string description: "The ID of the VPC that this stack is deployed in" [...]
在註冊範本時,您表示此範本已匯入,並提供 bundle 的 Amazon S3 儲存貯體位置。在將 AWS CloudFormation 範本放入草稿之前, 會 AWS Proton 驗證結構描述僅包含environment_input_type
且沒有範本參數。
您提供下列項目來建立匯入的環境。
-
部署時要使用的 IAM 角色。
-
具有所需輸出值的規格。
您可以使用與一般環境部署類似的 AWS CLI 程序,透過 主控台或 提供兩者。