Terraform is best suited for managing more persistent shared infrastructure, while Serverless is a good fit to manage the application-specific infrastructure. Check above for the example of sharing information between Terraform and Serverless, and you can find the full example here in the GitHub repo.