How can I specify apigateway's role to give permission to invoke a lambda?

I am using AWS apigateway to trigger a lambda function. I deployed them from serverless framework, the configuration looks like:

handler:
  handler: src/index.handler
  name: handler
  tracing: true
  role: updateRole
  events:
    - http:
        path: /contact/{id}
        method: patch
        integration: lambda
        request:
          parameters:
              paths:
                id: true

after deploy, it works perfect. But what I don’t understand is how I can find out where the iam role/policy defined for this API integration?

When open AWS console, it shows me the right configuration in the "Integration Request" tab:

But I can’t find anywhere it specifies the IAM role to this integration. How can I find it or update it?

enter image description here

>Solution :

Permissions to execute a function from API, are set using resource-based policies for lambda, not IAM role. In lambda console they are listed as:

enter image description here

Leave a Reply