简体   繁体   English

如何在 AWS Secrets Manager 中存储多个密钥?

[英]How to store multiple secrets in AWS Secrets Manager?

I have following requirements to store multiple Secret/Key value (around 200 secrets) in AWS Secrets Manager and I do not want to enter each and every secret key/value manually from AWS Secrets Manager console.我有以下要求在 AWS Secrets Manager 中存储多个密钥/密钥值(大约 200 个密钥),我不想从 AWS Secrets Manager 控制台手动输入每个密钥/值。 Although I have researched a bit and found from AWS docs that I can create a JSON file where I can write all Secret Key/Value and then pass that file to AWS Secrets manager command:虽然我已经研究了一下,并从 AWS 文档中发现我可以创建一个JSON文件,我可以在其中写入所有密钥/值,然后将该文件传递给 AWS Secrets manager 命令:

aws secretsmanager create-secret --name MyTestDatabaseSecret \
--description "My test database secret created with the CLI" \
--secret-string file://mycreds.json

Is this a good way of doing this or can there be any other better way to store all these secrets all at once?这是这样做的好方法还是有其他更好的方法可以一次存储所有这些秘密?

testing in my AWS account this works like a charm:在我的 AWS 账户中测试这就像一个魅力:

aws secretsmanager create-secret --name TestMultiplesValues4 --description "Mytest with multiples values" --secret-string file://secretmanagervalues.json

Then the json file will be:那么 json 文件将是:

{"Juan":"1","Pedro":"2","Pipe":"3"}

where Juan is the key #1 and 1 the secret value of that key...其中 Juan 是密钥 #1 和 1 是该密钥的秘密值...

It is very simple and easy,它非常简单易行,

Note : this is to create one secret manager with multiples key/Value pair, not to create multiples secret managers with one Key/Value each one.注意这是创建一个具有多个键/值对的秘密管理器,而不是创建多个秘密管理器,每个秘密管理器具有一个键/值。 Be careful with this concept.小心这个概念。

Hope this help you more.希望这对您有更多帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM