简体   繁体   English

Secrets Manager 找不到用于暂存的指定秘密值 label

[英]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.

相关问题 Google Secret Manager 秘密似乎不起作用,但我没有发现任何问题 - Google Secret Manager secrets do not seem to work yet I can find nothing wrong 无法从 Google Cloud 访问存储在 Secrets Manager 中的机密 Function - Can't access secret stored in Secrets Manager from Google Cloud Function 如何检索 AWS Secrets Manager 密钥的特定值? - How do retrieve the specific value of an AWS Secrets Manager secret? GKE Secrets 或 Google 机密管理器 - GKE Secrets OR Google Secret manager Lambda function 无法访问 Secrets Manager - Lambda function can't access Secrets Manager 如何使用 ECS 任务访问 Secret Manager 机密? - How to access Secret Manager secrets with ECS task? AWS CLI Secrets Manager 创建密钥 - AWS CLI Secrets Manager Create Secret 将 Secrets Manager 参数引用到秘密字符串 - Reference Secrets Manager Parameters to Secret String 通过 Powershell 获取 AWS Secrets Manager 中特定密钥的特定 Secret 值 - Fetch specific Secret value for a specific key in AWS Secrets Manager via Powershell AWS Secrets Manager 和 Cloud Formation - 无法创建秘密,因为它已经存在 - AWS Secrets Manager and Cloud Formation - can not create secret because it already exists
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM