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.

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

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

回答问题的准则

相关内容