https://pulumi.com logo
#general
Title
# general
s

some-continent-7311

09/13/2023, 2:15 PM
Hello all. When defining resources in Pulumi there is an option to specify a
parent
or a list of dependencies via
dependsOn
. Are there any best practices for using one or the other (or both)? E.g. if I want to deploy a GKE cluster I need to create a network and a subnet. Should I use
parent
or
dependsOn
in this scenario? Should the network be a parent of the subnet, and the subnet, in return, be a parent of the cluster? Or should the depend on each other? What is the difference between the two properties?
b

billowy-army-68599

09/13/2023, 3:09 PM
if you need to create a relationship between two resources, use
dependsOn
. Parent only applies to inheriting resources options, and outside of a component is primarily used for UI.
s

some-continent-7311

09/13/2023, 4:43 PM
Thank you!