https://pulumi.com logo
Title
p

polite-ocean-13631

11/02/2022, 3:32 PM
https://www.pulumi.com/docs/reference/cli/pulumi_stack_graph/ I see there's a
pulumi stack graph
command that claims to "export a stack’s dependency graph to a file". How do you define a stack's dependencies? How are these dependencies used?
e

echoing-dinner-19531

11/02/2022, 3:33 PM
They dependencies are mostly built based on the Input/Output values (Every Output<T> tracks the resource that created it), but you can also set explicit dependencies via the dependsOn resource option.
p

polite-ocean-13631

11/02/2022, 3:34 PM
Ah, so it's tracking the dependencies between resources, rather than between stacks.
e

echoing-dinner-19531

11/02/2022, 3:34 PM
yes
b

bored-activity-40468

11/02/2022, 4:57 PM
By default, I believe all resources unless they have their parent set are children of a stack resource. If you create a component, add resources to it and assign their parent to the ComponentResource, it changes the graph.