0
votes

I have a lambda function that I'd like to trigger via HTTP request.

When I click add trigger to a lambda function, I get an API Gateway API set up with:

 method: ANY

Great. Now, when viewing this lambda function, I see a trigger has been configured.

However, I would like to restrict the trigger to only allow POST requests.

So I deleted the API Gateway method ANY, and created a new method POST, under the same resource, using an integration type of Lambda Function. I select my region, and sure enough, my existing lambda function is autocompleted.

However, when I view the triggers tab on the lambda function itself, it shows that there are no triggers.

What am I missing?

1
I had the same exact issue. Lambda function gets triggered with POST method nonetheless. I assumed it must be a GUI issue and the trigger won't appear in the Triggers tab unless the method was ANY.Khalid T.

1 Answers

4
votes

If you need flexible control of the API, I would suggest to use the API Gateway console to mange your API. Lambda triggers should only be used for simple use-cases - API methods configured through API Gateway will not show up in the Lambda triggers list.