Hi <@U01JVDKASAC>, I’m migrating an app from serve...
# sst
d
Hi @Frank, I’m migrating an app from serverless to SST and I’ve got a question about deployment phases using SST on seed.run. Previously, I had a monorepo with different services -- AppSync, Dynamo, Auth, etc. I deployed those on seed.run and each service was deployed in a phase. I think I had about 4 phases, some containing multiple services. But with SST, deployment is different. It seems that lib/index.ts describes my services and their deployment order. Before, I used phases to deploy services in a specific order. Do I need to think about phases on seed.run while using SST, or is this handled by lib/index.ts?
f
Hey @David Martin, that’s right! It’s handled by lib/index.ts. For example, if you have cross stack references like this:
Copy code
const dbStack = new DBStack(app, "database");
new ApiStack(app, "api", { myTable: dbStack.myTable });
SST will deploy the
DBStack
, then the
ApiStack
If u migrated over all your SLS services to SST, you will likely have just 1 SST service.
d
Ok, awesome! Just wanted to make sure I wasn’t missing something.
l
Hey @Frank, so if I wish to pass some outputs from one stack to another I'd have to add the outputs in first stack (
this.addOutputs(...)
) and reference them in the second.. how exactly? 🙂 I tried using what you've shown above (
dbStack.myTable
) on one of my props but IDE's cringing due to params not being assignable to StackProps type
f
Hey @Lukasz K, you don’t need to add the outputs, just reference them and SST will automatically add the output.
It seems like you are using TypeScript, in that case, you’d need to extend the
StackProps
type. It’s fairly straight forward, here’s an example of referencing the
api
construct across stack https://docs.serverless-stack.com/constructs/Api#sharing-an-api-across-stacks
Just select the
TypeScript
tab on the code sample.
Let me know if that makes sense.
l
Thanks @Frank! After writing the message I came up with the no-brainer idea of extending the type (or adding 4th param). It makes total sense, I was just looking for the proper way in seed docs instead of sst ones