amazon web services - Api Gateway can't invoke Lambda function -


following this tutorial on aws, hit roadblock when trying test api through web console (as many others did):

thu nov 10 22:54:48 utc 2016 : execution failed due configuration error: invalid permissions on lambda function

i've read every relevant post on , aws forums find, can't figure out how grant permission api gateway invoke lambda function.

web console method:

thanks this mate found quick fix:

go web console , select

the resource method > integration request > pencil next lambda function > check mark next lambda function (don't change name)

a popup window should warn granting permissions api execute lambda function.


api method:

also, richard downer code explanation:

a resource policy different iam policy, setting iam policy not work.

you need use add-lmpermission api call after creation of write-agintegration.

here example:

add-lmpermission -functionname myfunction -action lambda:invokefunction -principal apigateway.amazonaws.com -sourcearn arn:aws:execute-api:us-west-2:iamaccountnumber:*/*/post/apiendpoint -statementid description


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -