Lambda invoke fail

0

I'm trying to test a Lambda within the console but I get the following error whether or not I run my function or even something as basic as a print statement: "Calling the invoke API action failed with this message: The role defined for the function cannot be assumed by Lambda."

I've read what feels like an infinite number of guides/ tutorials/ stack overflow questions that involve updating trust policies/ permissions/ whatever and nothing appears to have any effect on the response. The regions match, and everything should have all of the access it needs to perform a simple execution and then some. I'm also the root user on this personal account, if that's a factor.

This problem has persisted over multiple days and a few attempts starting from scratch, but the end result is always the same error. Any leads and/or guidance are welcome and appreciated, thank you for your time.

Kevin
已提問 1 年前檢視次數 384 次
1 個回答
1

You have assigned a role to the Lambda function. This role should have a trust policy that looks like this:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": "lambda.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
profile pictureAWS
專家
kentrad
已回答 1 年前
profile pictureAWS
專家
已審閱 1 年前
  • As it happens, I have exactly that but the error still persists. I've tried adding other services and actions but to no avail. If this additional information is helpful, I've also tried attaching both existing Lambda policies and custom ones to the role but the end result is always the same.

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

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

回答問題指南