https://serverless-stack.com/ logo
#help
Title
# help
p

Pavan Kumar

12/03/2021, 6:14 AM
Is there a way to deploy multiple stacks in parallel, in seed.run. For example, we have
Copy code
new StackA();
new StackB();
new StackC();
new StackD();
Scenario 1: Deploy all the stacks in parallel. Scenario 2: Deploy
StackA
and
StackB
in parallel and
StackC
and
StackD
depends on
StackA
and
StackB
hence deploy
StackC and StackD
in parallel, but in second stage?
f

Frank

12/03/2021, 7:54 AM
Hey @Pavan Kumar, SST will try to deploy the stacks in parallel if there are not interdependent.
If A, B, C, D are not dependent on each other, SST will deploy all 4 stacks concurrently.
p

Pavan Kumar

12/03/2021, 8:03 AM
How does sst know about dependence
a

Adrián Mouly

12/03/2021, 12:27 PM
Copy code
this.stack1.addDependency(this.stack2);
You can use that.
p

Pavan Kumar

12/07/2021, 6:51 AM
What happens in the following case?
Copy code
const stackA = new StackA(scope, "StackA");

// 
new StackB(scope, "StackB", { url: stackA.url });
Does both
stackA
and
stackB
deployed parallelly? Or
StackB
waits till
StackA
gets deployed so that it can get the
url
?
f

Frank

12/08/2021, 7:32 PM
Depends on if StackB uses the StackA’s url. If it is being used, then yes, StackA deploys, and then StackB deploys.
Behind the scene, SST creates an CFN export in StackA, and StackB imports it.
2 Views