[英]Secrets Manager can't find the specified secret value for staging label
I've been trying to create secret on the command line as follows:我一直在尝试在命令行上创建秘密,如下所示:
~/$ aws secretsmanager create-secret --name first-secret
{
"ARN": "arn:aws:secretsmanager:us-east-2:123456789012:secret:first-secret-9ez7W2",
"Name": "first-secret"
}
~/$ aws secretsmanager get-secret-value --secret-id first-secret
An error occurred (ResourceNotFoundException) when calling the GetSecretValue operation: Secrets Manager can't find the specified secret value for staging label: AWSCURRENT
If I create secret on AWS Console (accepting default choices), I can "get-secret-value" without problem.如果我在 AWS 控制台上创建秘密(接受默认选择),我可以毫无问题地“获取秘密值”。
What's the difference between AWS Console and command line in this regard? AWS 控制台和命令行在这方面有什么区别?
The (unhelpful) error message is thrown because the secret value hasn't been set after creation.抛出(无用的)错误消息是因为在创建后尚未设置秘密值。
Here's how you can get things working:以下是如何让事情正常进行:
$ aws secretsmanager create-secret --name first-secret
$ aws secretsmanager put-secret-value --secret-id first-secret --secret-string "foo@"
$ aws secretsmanager get-secret-value --secret-id first-secret
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.