How do I cloudform an API gateway resource with a lambda proxy integration

后端 未结 3 951
一整个雨季
一整个雨季 2021-02-07 04:05

I\'ve been trying to work out how to express (in cloudformation) an API Gateway Resource that has a Lambda function integration type using the Lambda Proxy integration.

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-07 04:35

    We faced this exact issue. We are using Ansible for our Infrastructure. Could apply to CLI or Cloudformation or even the SDK

    The solution to our problem was to make sure that the Lambda policy was defined in a granular manner for the endpoint verbs in API Gateway for the lambda you are attempting to use.

    For instance, We had multiple routes. Each route(or sets of routes) needs its own lambda policy defined that allows lambda:InvokeFunction. This is defined in the Lambda Policy module for Ansible. With this, the lambda trigger was enabled automatically.

提交回复
热议问题