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

wide-holiday-59376

08/29/2019, 8:24 PM
depends
will probably help me create my dynamic resource after the e2c instance is created, but does
depends
guarantee destruction in the reverse order?
w

white-balloon-205

08/29/2019, 9:12 PM
Establishing a dependency will ensure your resource is deleted before the resource it depends on. To ensure this works as expected during replacements, you will also need to ensure that the property you use to depend on the EC2 instance ID returns replacements from
diff
when the instance ID changes so that you trigger a cascading replacement of your resource (to run scripts on the new instance).
s

some-doctor-62800

08/29/2019, 10:04 PM
@white-balloon-205 this is very related to my question, is there some way to help pulumi see deps and deletion order across stacks?
w

white-balloon-205

08/29/2019, 10:09 PM
The state file includes details of dependencies.
s

some-doctor-62800

08/29/2019, 10:10 PM
But deletion order will be wrong as they're two runs
w

white-balloon-205

08/29/2019, 10:13 PM
Not sure I follow "two runs"? Are these in separate stacks? There is indeed no general purpose way to do this across stacks - though I also don't have a full picture of exactly what you are trying to do.
s

some-doctor-62800

08/29/2019, 10:13 PM
@wide-holiday-59376 sorry for shortly hijacking your thread, I'll continue here https://pulumi-community.slack.com/archives/C84L4E3N1/p1567097634048500?thread_ts=1567097634.048500&cid=C84L4E3N1