Another TS question: Pulumi stores state using nod...
# typescript
l
Another TS question: Pulumi stores state using node's
async_hooks
. Is this capable of crossing module boundaries? I've noticed that if I call
new pulumi.Config()
in a dependency, it doesn't have access to Pulumi's state, for example
new pulumi.Config()
is empty.
This seems to only be a problem when my program is running under a debugger, which is absolutely bizarre
l
I don't understand the reason it works this way, but I have noticed this too. My solution was to go fully DI: all config is now read in my main app, not component resources. I inject all config via constructors. This eliminates the symptoms of the problem, allowing me to inspect my resources when debugging. The strict rule is: component resources are for storing data only. Don't do any actions in them, like looking up configuration.
l
Bit annoying tbh, but you're right, that probably is the way to do it.