1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

AWS Secrets Manager で値の一括取得が可能に - BatchGetSecretValue

Posted at

内容

新しい API である BatchGetSecretValue で、複数のシークレットを同時に取得できるようになりました。

この機能により、一度に 1 つのシークレットを取得するために繰り返し呼び出したり、複数のシークレットを取得する際に部分的な失敗を考慮したりする必要がなくなり、全体的な効率が向上します。

やってみる

適当な シークレットを 2 つ準備。
スクリーンショット 2023-12-03 1.49.58.png

AWS CLI で実行

aws secretsmanager batch-get-secret-value --secret-id-list "secret001" "secret002"

結果

{
    "SecretValues": [
        {
            "ARN": "arn:aws:secretsmanager:ap-northeast-1:123456789012:secret:secret002-MxP9hU",
            "Name": "secret002",
            "VersionId": "45d9265e-8bb9-4718-94fe-cdce3fd02540",
            "SecretString": "{\"user\":\"user002\",\"pass\":\"pass002\"}",
            "VersionStages": [
                "AWSCURRENT"
            ],
            "CreatedDate": "2023-12-03T01:48:31.571000+09:00"
        },
        {
            "ARN": "arn:aws:secretsmanager:ap-northeast-1:123456789012:secret:secret001-K7ddGd",
            "Name": "secret001",
            "VersionId": "0682d67a-210a-4efa-a396-ac5ed1942131",
            "SecretString": "{\"user\":\"user001\",\"pass\":\"pass001\"}",
            "VersionStages": [
                "AWSCURRENT"
            ],
            "CreatedDate": "2023-12-03T01:47:49.148000+09:00"
        }
    ],
    "Errors": []
}
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?