

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

# 使用 AWS Secrets Manager 追蹤資料庫密碼或第三方 API 金鑰
<a name="parameter-store-encryption"></a>

建議您使用 AWS Secrets Manager 在整個生命週期輪換、管理和擷取資料庫登入資料、API 金鑰和其他**秘密**。Secrets Manager 可讓您將程式碼中的硬式編碼登入資料 （包括密碼） 取代為對 Secrets Manager 的 API 呼叫，以程式設計方式擷取秘密。如需詳細資訊，請參閱[什麼是 AWS Secrets Manager？](https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html) 《*AWS Secrets Manager 使用者指南*》中的 。

對於在 CloudFormation 範本中傳遞秘密 （例如 OAuth 登入資料） 參數的管道，您應該在範本中包含動態參考，以存取您在 Secrets Manager 中存放的秘密。如需參考 ID 模式和範例，請參閱*AWS CloudFormation 《 使用者指南*》中的 [Secrets Manager Secrets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html#dynamic-references-secretsmanager)。如需在管道中 GitHub webhook 範本程式碼片段內使用動態參考的範例，請參閱 [Webhook 資源組態](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codepipeline-webhook.html#aws-resource-codepipeline-webhook--examples)。



## 另請參閱
<a name="related-resources-managing-secrets"></a>

下列相關資源可在您管理秘密時提供協助。
+ Secrets Manager 可以自動輪換資料庫登入資料，例如輪換 Amazon RDS 秘密。如需詳細資訊，請參閱《[AWS Secrets Manager 使用者指南》中的輪換 Secrets](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets.html) *AWS Manager 秘密*。
+ 如要檢視將 Secrets Manager 動態參考新增到您 CloudFormation 範本的說明，請參閱 [https://aws.amazon.com/blogs/security/how-to-create-and-retrieve-secrets-managed-in-aws-secrets-manager-using-aws-cloudformation-template/](https://aws.amazon.com/blogs/security/how-to-create-and-retrieve-secrets-managed-in-aws-secrets-manager-using-aws-cloudformation-template/)。