title: How to structure terraform templates for serverless applications
body: <p>I have several lambdas which either get triggered by messages from queues or through api gateway, have different storage types and so on. </p>
  
  <p>Each of these components seat in their respective repos but over all and together they are part of the same architecture. 
  I am attempting to structure my terraform templates but one point of concern for me was the fact that some of these lambdas have shared resources, for example storage tables or s3 buckets, so I was wondering if it would be a good idea to only have a main.tf file in each lambda's repo that only creates the lambda itself and not any of its other dependencies, this way I could redeploy the lambda through ci/cd without worrying about the other components, and I would place all the other parts of the architecture that are more or less long lasting in a central repo and only run them when necessary through this repos dedicated ci/cd pipeline. I was also thinking of having a tfvar file that has all the shared resource names. </p>
  
  <p>Is this a valid approach? What are the downsides? What are the alternatives?</p>