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
질문됨 일 년 전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
답변함 일 년 전
profile pictureAWS
전문가
검토됨 일 년 전
  • 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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠