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 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南