lambda 函数的安全异常

0

【以下的问题经过翻译处理】 当我测试我的 Lambda 函数时,我收到了以下错误:

"body": "{\"error\":{\"root_cause\":[{\"type\":\"security_exception\",\"reason\":\"no permissions for [indices:data/read/search] and User [name=arn:aws:iam::xxxxxx:role/service-role/testFunction-role-etjiy0ib

但是,如果我进入IAM控制台并进入 testFunction-role-etjiy0ib,该角色具有所有这些权限: Enter image description here

我哪里没做对?

profile picture
专家
已提问 5 个月前10 查看次数
1 回答
0

【以下的回答经过翻译处理】 Hi,我建议您从代码和截图中删除所有端点。

我看到您已经在这里提出了同样的问题:https://repost.aws/questions/QULkoc-0AkQ1yDgN0ANxE7lg/lambda-function-error-list-indices-must-be-integers-or-slices-not-str。你尝试过这个推荐的解决方法并成功 print 吗?您有一个堆栈跟踪表明它在哪里失败吗?

您似乎没有使用测试方法将 JSON 对象传递给函数,而是传递了一个对象列表。请您检查一下。

我还建议您参加像这样的研讨会:https://aws.amazon.com/getting-started/hands-on/run-serverless-code/ 以了解更多关于Lambda的知识。

希望能帮到您 Jon

profile picture
专家
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则