[英]AWS lambda function to use secret manager
created a secret manager key (non-rotational)with plain text option and encrypted.使用纯文本选项创建了一个秘密管理器密钥(非旋转)并加密。 When i tried to get the value in lambda function, I am getting the error as permission denied.
当我尝试获取 lambda function 中的值时,我收到错误,因为权限被拒绝。 Could you please help how to resolve the issue
你能帮忙解决这个问题吗
You need to assign the role to lambda function to read from the secret manager.您需要将角色分配给 lambda function 才能从密钥管理器中读取。
AWS role The following IAM policy allows read access to all resources that you create in AWS Secrets Manager. AWS 角色以下 IAM 策略允许对您在 AWS Secrets Manager 中创建的所有资源进行读取访问。 This policy applies to resources that you have created already and all resources that you create in the future.
此策略适用于您已经创建的资源以及您将来创建的所有资源。
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"secretsmanager:GetResourcePolicy",
"secretsmanager:GetSecretValue",
"secretsmanager:DescribeSecret",
"secretsmanager:ListSecretVersionIds"
],
"Resource": ["*"]
}
]
}
You can find more specific example below iam-policy-examples-asm-secrets
您可以在iam-policy-examples-asm-secrets下面找到更具体的示例
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.