https://serverless-stack.com/ logo
#sst
Title
# sst
j

Jack Fraser

09/29/2021, 5:46 PM
What is the recommend way to only have some of your stacks in dev (websocket) mode for development? We have quite a few stacks (around 12) but only really interested in running 1 or 2 in debug at any one time?
We also make use of Sharing APIs across stacks, where I would want to deploy the main stack but only 1 of the sub stacks
t

thdxr

09/29/2021, 5:50 PM
You can conditionally initialize stacks in your app
Copy code
if (!app.local) {
  new NonLocalStack()
}
app.local == true for
sst start
j

Jack Fraser

09/29/2021, 5:51 PM
OK that is what I am kinda doing, but was not sure if that was the best approach. šŸ‘
a

AdriƔn Mouly

09/29/2021, 6:36 PM
Oh didnā€™t know about app.local.
j

Jack Fraser

09/29/2021, 9:36 PM
would it be somehow possible to force some functions to NOT changed into debug mode. With the CUSTOM defaultAuthorizer sitting in the parent main stack if I then debug a child stack (leaving the rest of the children "deployed" then as the Authorizer lambda for all of them is in parent it the causes every request needing auth to hit my local machine regardless of stack. Obviously I could just have no defaultAuthorizer but that feels rubbish! @thdxr
t

thdxr

09/29/2021, 9:59 PM
Yeah afk right now but search docs for liveDebug
It's a boolean to turn it off
j

Jack Fraser

09/30/2021, 4:14 PM