I’ve provisioned a lambda function successfully using Terraform. However, I noticed that there’s no attributes under aws_lambda_function
that allows me to define test events; Just to be clear, the "tests" I am referring to are JSON that I can define by clicking the "test" button in AWS Lambda console to simulate an event.
Is it possible to define tests events using Terraform scripts? If it is not possible, what other options do I have other than manually adding them via AWS Lambda console?
2
Answers
When the question was posted, I did not know the correct term to search for. The correct term is "lambda events".
A quick search shows a similar question has been raised 3 years ago.
The short answer is this is not possible at this time as there is no AWS API that supports this functionality which is what the Terraform AWS Provider is limited by.
This looks to be the closest thing I could find on Terraform documentation: Lambda invocation.