Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create a lambda event template via terraform?

I can select an event from event template when I trigger a lambda function. How can I create a customized event template in terraform. I want to make it easier for developers to trigger the lambda by selecting this customized event template from the list.

I'd like to add an event on this list:

enter image description here

like image 452
Joey Yi Zhao Avatar asked Feb 20 '20 23:02

Joey Yi Zhao


1 Answers

Unfortunately, at the time of this answer (2020-02-21), there is no way to accomplish this via the APIs that AWS provides. Ergo, the terraform provider does not have the ability to accomplish this (it's limited to what's available in the APIs).

I also have wanted to be able to configure test events via terraform.

A couple of options

  • Propose to AWS that they expose some APIs for managing test events. This would give contributors to the AWS terraform provider the opportunity to add this resource.
  • Provide the developers with a PostMan collection, set of shell scripts (or other scripts) using the awscli, or some other mechanism to invoke the lambdas. This is essentially the same as pulling the templating functionality out of the console and into your own tooling.
like image 159
mjgpy3 Avatar answered Nov 01 '22 03:11

mjgpy3