未知服务:'secretsmanager'或AWS Secrets Manager服务不在AWS CLI列表中

Ner*_*eph 7 amazon-web-services aws-secrets-manager

我试图使用AWS秘密管理器服务来存储密钥.我可以将密钥存储在秘密管理器中,但是在使用它们提供的代码检索密钥时,我收到了此错误.

UnknownServiceError:未知服务:'secretsmanager'.有效的服务名称是:acm,alexaforbusiness,...

我尝试在AWS CLI上进行搜索,该服务也不在列表中.

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

acm                                      | alexaforbusiness                        
apigateway                               | application-autoscaling                 
appstream                                | appsync     
.
.
.
Run Code Online (Sandbox Code Playgroud)

我需要某种aws cli更新吗?可能是因为我正在使用的CLI版本.那么,我该如何更新呢.我试过了

sudo apt-get install -y awscli
Run Code Online (Sandbox Code Playgroud)

它说

awscli is already the newest version (1.11.13-1ubuntu1~16.04.0).
Run Code Online (Sandbox Code Playgroud)

Tho*_*rge 11

secretsmanager只能从aws cli版本1.15.8及更高版本获得

aws --version

aws-cli/1.15.10 Python/2.7.10 Darwin/17.5.0 botocore/1.10.10

您可能需要手动安装/更新aws cli

  • 如果使用 boto3 并收到相同的错误,请通过 pip install boto3 --upgrade 升级到最新版本 (2认同)