本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
透過客戶管理的環境,您可以使用已部署為 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 範本,對該第二個連結帳戶中的環境和服務執行部署和更新。
如何使用客戶管理的環境
系統管理員需要做的第一件事就是註冊匯入的客戶管理環境範本。請勿在範本組合包中提供資訊清單或基礎結構檔案。僅提供綱要。
下面的結構描述了使用 open 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"
[...]
註冊範本時,表示已匯入此範本,並提供服務包的 Amazon S3 儲存貯體位置。 AWS Proton 在將 AWS CloudFormation 範本置於草稿之前,先驗證結構描述僅包含environment_input_type
且不包含範本參數。
您可以提供以下內容來建立匯入的環境。
-
進行部署時要使用的IAM角色。
-
包含所需輸出值的規格。
您可以透過主控台或 AWS CLI 使用類似於一般環境部署的程序來提供這兩種方式。