security exception on lambda function

0

When i'm testing my lambda function i get this error

"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

But if i go to IAM dashboard and go to the testFunction-role-etjiy0ib, this role has all this permissions: Enter image description here

What am i doing wrong?

2 回答
0
已接受的回答

Hi, I recommend you redact all endpoints from the code and screenshots.

I see you already asked the same question here: https://repost.aws/questions/QULkoc-0AkQ1yDgN0ANxE7lg/lambda-function-error-list-indices-must-be-integers-or-slices-not-str Have you tried the recommendations and managed to get the print to show? Do you have a stack trace that indicates where its failing?

It seems you are not passing a JSON object to the function using the Test method but rather a list of objects. Could you please check that?

I also recommend you go through a workshop like this: https://aws.amazon.com/getting-started/hands-on/run-serverless-code/ to learn more about Lambda.

Hope it helps Jon

profile pictureAWS
专家
已回答 1 年前
0

I'm facing the same error (security exception). Were you able to resolve this?

Kumuda
已回答 5 个月前

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

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

回答问题的准则