`depends` will probably help me create my dynamic ...
# general
w
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
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
@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
The state file includes details of dependencies.
s
But deletion order will be wrong as they're two runs
w
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
@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