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 Antworten
0
Akzeptierte Antwort

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
EXPERTE
beantwortet vor einem Jahr
0

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

Kumuda
beantwortet vor 5 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen