中繼資料 - AWS CloudFormation

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

中繼資料

您可以使用選用 Metadata 區段包含可提供範本詳細資訊的任意 JSON 或 YAML 物件。例如,您可以包含特定資源的範本實作詳細資訊,如下列程式碼片段所示:

重要

在更新堆疊期間,您無法自行更新 Metadata 區段。只有在包含可新增、修改或刪除資源的變更時,才能予以更新。

重要

CloudFormation 不會轉換、修改或密文Metadata章節中包含的任何資訊。因此,我們強烈建議您不要使用此區段來儲存機密資訊,例如密碼或秘密。

JSON

"Metadata" : { "Instances" : {"Description" : "Information about the instances"}, "Databases" : {"Description" : "Information about the databases"} }

YAML

Metadata: Instances: Description: "Information about the instances" Databases: Description: "Information about the databases"

中繼資料金鑰

某些 AWS CloudFormation 特徵會擷取您在Metadata區段中定義的設定或組態資訊。您可以在下列 AWS CloudFormation特定中繼資料金鑰中定義這項資訊:

AWS::CloudFormation::Init

定義 cfn-init 協助程式指令碼的組態任務。這個指令碼對於在 EC2 執行個體上設定和安裝應用程式很有用。如需詳細資訊,請參閱 AWS::CloudFormation::Init

AWS::CloudFormation::Interface

定義輸入參數顯示在 AWS CloudFormation 控制台中時的分組和順序。依預設, AWS CloudFormation 主控台會依其邏輯 ID 的字母順序排序參數。如需詳細資訊,請參閱 AWS::CloudFormation::Interface

AWS::CloudFormation::Designer

描述如何在 AWS CloudFormation 設計師 (設計師) 中配置您的資源。使用設計工具來建立和更新範本時,其會自動新增此資訊。如需更多詳細資訊,請參閱 使用舊的 AWS CloudFormation 設計工具建立範本