I'm new to Pulumi, got a quick question. I have a...
# getting-started
h
I'm new to Pulumi, got a quick question. I have a project where I have organized code into multiple components. In a few cases, I have resources across these components where the order of creation matters (these resources are command.remote.Commands that run some scripts). I have dependency relationships set up via dependsOn between the components when they are instantiated, but the command resources within the components are running in parallel with command resources from other components, seemingly despite the dependsOn relationship. What's the "correct" way to get resources within different components to run in a certain order with regard to each other?
👀 1
s
dependsOn
is supposed to work for components. I would expect that if component B depends on component A, nothing in component B should happen until component A is fully complete, so this is what I would check: 1. Are you calling
registerOutputs()
at the end of your component constructor? 2. Are you parenting all resources in your component to
this
(or its equivalent in your language of choice)?
h
1. Yes 2. No, this isn't something I am aware of. Sounds like I need to read up on parenting and what that does
s
Yeah, every resource you create in a component should have
parent
set, which will bring along a lot of the other resource options. Here's the best place in the docs to see an example, plus the details: https://www.pulumi.com/docs/iac/guides/building-extending/components/build-a-component/