gpt4 book ai didi

amazon-web-services - AWS IAM Lambda "is not authorized to perform: lambda:GetFunction"

转载 作者:行者123 更新时间:2023-12-04 16:50:58 25 4
gpt4 key购买 nike

当我将 lambda 执行角色的 IAM 策略设置为:

{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"lambda:GetFunction"
],
"Resource": [
"*"
],
"Effect": "Allow"
}
]
}

我收到此错误:
[AccessDeniedException: User:
arn:aws:sts::xxx:assumed-role/supercoolsoftware-dev-us-west-2-lambdaRole/supercoolsoftware-dev-addEmail
is not authorized to perform:
lambda:GetFunction on resource:
arn:aws:lambda:us-west-2:xxx:function:supercoolsoftware-dev-dailyEmail]

但是,当我将策略设置为:
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"lambda:*"
],
"Resource": [
"*"
],
"Effect": "Allow"
}
]
}

错误消失了......我还需要添加什么?

最佳答案

弄清楚了。显然,SDK 也使用“lambda:GetFunctionConfiguration”。一旦我把它包括在内,一切都奏效了。

{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"lambda:GetFunction",
"lambda:GetFunctionConfiguration"
],
"Resource": [
"*"
],
"Effect": "Allow"
}
]
}

关于amazon-web-services - AWS IAM Lambda "is not authorized to perform: lambda:GetFunction",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44381104/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com