I have several services split up where serveral of these services are a lambda + api gateway which I decided to use the Serverless Application Model (SAM) tool that AWS provides so I can make use of local start-api while I am working locally on these services.
However, my main infrastructure is not written within SAM, and instead is written in Terraform. I know that if I wrote directly in SAM or Cloudformation my infrastructure would be built as a stack which would allow me to reference resources within the service's SAM template so that I can build those services making use of resource properties I wish to use. Is there a way within the SAM template to retrieve resource parameters (that already exist) for example subnet_id's, vpc_names ect?
The solution I have at the moment is to use the CLI to retrieve the properties I wish and pass them into SAM template as variables, is there a more elegant solution?