Is there a way to deploy multiple stacks in parall...
# help
p
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
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
How does sst know about dependence
a
Copy code
this.stack1.addDependency(this.stack2);
You can use that.
p
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
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.