I have a serverless project with 3 "layers" - api
, services
and db
. Each layer is just a set of function deployed individually (I have setting package.individually === true
in .serverless.yml
). All layers able to communicate using invocation mechanism from the top (api) to the bottom (db). Only api
layer has API Gateway URL, all functions in other layers do not need to be exposed by API url.
Now project grow and we have more developers. I want to prevent issues when somebody uses const accountDb = require('../db/account')
in, say, api
modules (api
must call db
layer only through invocation wrapper).
I'd like to split single serverless project to 3 different projects but stuck on local running. I can run they locally on different ports but unable to invoke lambdas in db
project from api
one. It is clear why.
Question: is it possible to call one lambda in project1 from lambda in project2 while both running locally without exposing API url (I know that I can call it by AJAX).