

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

# 在 中記錄資源類型 AWS Config
<a name="registry-config-record"></a>

您可以指定 AWS Config 自動追蹤私有資源類型，並將這些資源的變更記錄為*組態項目*。這可讓您檢視這些私有資源類型的組態歷史記錄，以及撰寫 AWS Config 規則 規則來驗證組態最佳實務。Hook 延伸 AWS Config 模組需要 。

若要讓 AWS Config 自動追蹤您的私有資源類型：
+ 通過 CloudFormation 管理資源。這包括透過 CloudFormation 執行所有建立，更新和刪除資源的操作。
**注意**  
如果您使用 IAM 角色來執行堆疊操作，則該 IAM 角色必須具有呼叫下列 AWS Config 動作的許可：  
[PutResourceConfig](https://docs.aws.amazon.com/config/latest/APIReference/API_PutResourceConfig.html)
[DeleteResourceConfig](https://docs.aws.amazon.com/config/latest/APIReference/API_DeleteResourceConfig.html)
+ 設定 AWS Config 以記錄所有資源類型。如需詳細資訊，請參閱《*AWS Config 開發人員指南*》中的[使用 AWS CLI記錄第三方資源的組態](https://docs.aws.amazon.com/config/latest/developerguide/customresources.html)。
**注意**  
AWS Config 不支援錄製包含定義為必要*和*唯讀屬性的私有資源。  
根據設計，用於建立 AWS Config 組態項目的結構描述中不會傳回定義為唯寫的資源屬性。因此，如果包含定義為唯寫和必要的屬性，則會導致建立組態項目失敗，因為將不存在必要屬性。若要檢視用來建立組態項目的結構描述，您可以檢閱 [https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeType.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeType.html) 動作的 `schema` 屬性。

如需有關組態項目的詳細資訊，請參閱《AWS Config 開發人員指南》**中的[組態項目](https://docs.aws.amazon.com/config/latest/developerguide/config-concepts.html#config-items)。

## 防止在組態項目中記錄感應性屬性
<a name="registry-config-record-sensitive"></a>

您的資源類型可能包含您認為機密資訊 (例如密碼、秘密或其他機密資料) 的內容，意即您不想記錄為組態項目的一部分。若要防止將內容記錄在組態項目中，您可以在資源類型結構描述的 `writeOnlyproperties` 清單中包含該內容。使用者可指定列為 `writeOnlyproperties` 的資源屬性，但不會由 `read` 或 `list` 請求傳回。

如需詳細資訊，請參閱《*CloudFormation 使用者指南*》中的 [https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-writeonlyproperties](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-writeonlyproperties)。