无效选择:“batch-get-secret-value”AWS BatchGetSecretValue

问题描述 投票:0回答:1

AWS Secret Manager 最近添加了批量秘密检索功能,以允许获取多个秘密。请参阅文档 https://aws.amazon.com/about-aws/whats-new/2023/11/aws-secrets-manager-batch-retrieval-secrets/

但是,当我使用文档中指定的命令时(

BatchGetSecretValue
),我收到如下错误:

aws secretsmanager batch-get-secret-value  --secret-id-list X_L1YX95, X_GIRNAK, X_M8CM8D

错误:

aws: error: argument operation: Invalid choice, valid choices are:

CLI 命令的参考文档 - https://docs.aws.amazon.com/cli/latest/reference/secretsmanager/batch-get-secret-value.html

amazon-web-services aws-cli aws-secrets-manager
1个回答
0
投票

根据版本变更日志,添加对 BatchGetSecretValue 的支持后,将您的 awscli 安装更新到最新版本,或从 2.13.39 开始的任何版本。

$ aws --version
aws-cli/2.15.10 Python/3.11.6 Windows/10 exe/AMD64 prompt/off

以及批量获取秘密值的帮助:

# aws secretsmanager batch-get-secret-value help

batch-get-secret-value
^^^^^^^^^^^^^^^^^^^^^^


Description
***********

Retrieves the contents of the encrypted fields "SecretString" or
"SecretBinary" for up to 20 secrets. To retrieve a single secret, call
GetSecretValue .
© www.soinside.com 2019 - 2024. All rights reserved.