Open lucknerjb opened 1 year ago
Ah snap... I just realized that we're generating a resource of type AWS::Serverless::Function
whereas the example code is generating a resource of type AWS::Lambda::Function
. Is there any way to bridge the gap here?
Hello,
We're currently using Terraform and AWS SAM together and the lines are just blurry enough in terms of where certain things should live (like Cloudwatch alarms) that this sparked our interest as a way to continue to define all of our infrastructure in TF but continue to leverage AWS SAM for local development.
For extra context, the reason we're using TF and SAM together is that TF sets up the base infra (DB, Redis, etc...) and handles the Route53, SSM, Cloudfront, etc... infra for review apps / staging / production. Our devs started with SAM and we worked TF into the mix after.
Through my research and testing, there does not appear to be a way to create a Lambda application (set of functions grouped together) with Terraform and if I understand AWS SAM correctly, the application is what is run when we invoke
sam local start-api
.Here is an excerpt of the SAM template generated by the example code in this repo:
And here's an excerpt for a sample function we have in one of our SAM apps:
Is there a way to achieve the same SAM template configuration? (Notice the missing
Events
section in the example-generated yaml.Thanks!