stale-answer-34162
11/09/2023, 1:19 PMconst dependenciesReady = pulumi.all([eksCluster.id, eksNodeGroup.id]).apply(() => {
require('./system')
require('./app')
})
in particular I am wondering if there is a better value for id
since it doesnt seem to promise the objects are in an active or ready state. Other tries I have done that don't work is
const dependenciesReady = pulumi.all([eksCluster.id, eksNodeGroup.id]).apply(() => {
createSystemResources()
createAppResources()
})
This method ignores the readiness of the of the objects and skips ahead to run the functions before the resources are ready. Also this one that looks appealing but:
pulumi.runtime.runInPulumiStack(() => {
if (eksCluster.status.get() === 'ACTIVE' && eksNodeGroup.status.get() === 'ACTIVE') {
require('./system')
require('./app')
}
})
this locks the stack before any provisioning takes place and is thus useless. Admittedly I have not tried ==
as I assumed it would do the same thing.dry-keyboard-94795
11/09/2023, 1:51 PMcluster.ts
, and have your system
+ apps
files import the resources from there.
Your index.ts
can import everything safely.
It's also worth looking into Component Resources, which use classes that you can initialise with dependencies.
https://www.pulumi.com/docs/concepts/resources/components/