It’s a good practice to split the infrastructure into multiple stacks that group related resources together. Naturally, there will be dependencies between the stacks.
For example, one stack creates a VPC with subnets, and another stack creates some resources into those subnets. The stacks need to be created and updated in a certain order to ensure that the dependencies can be satisfied. For example, you need to have the subnets ready before you can create other resources into them.
You specify the stacks that a stack depends on by using the depends
property which accepts a single stack path or a list of stack paths.
A single dependency:
A single dependency with region:
Multiple dependencies:
Using a relative stack path:
depends
property can be defined in:
When depends
property is defined in a blueprint configuration file:
When depends
property is defined in a stack configuration file:
The depends property must satisfy these requirements: