dry-pilot-49577
08/31/2023, 10:40 PMlocal.Command
that feeds into another local.Command
. The first command works, and I can even see the stdout
being saved correctly. The second item is created as
const cloud = service.stdout.apply(p => JSON.parse(p));
const app = new local.Command(
`${ns}-app`,
{
create: "./create.sh",
delete: "./delete.sh",
environment: pulumi.all([cloud.appId]).apply([appId] => ({TEST: "yes", APP_ID: appId})),
},
);
I dumped the env to a log file and TEST
is there, but APP_ID
isn't. service.stdout
exists and is set correctly according to pulumi stack export > p.json
1. Does local.Command
not check for dependencies before firing off its shell command?
2. If it does, is there some other syntax to ensure ${ns}-app
waits for service.stdout
to resolve correctly?little-cartoon-10569
08/31/2023, 11:05 PMpulumi.all([x]).apply([x] => ...)
is exactly the same as x.apply()
. Also, pulumi.interpolate
is sugar around x.apply()
, when you're only generating a string.dry-pilot-49577
08/31/2023, 11:09 PM.appId
property in the stdout JSON
It just... never makes it into the environment of the second command which has truly perplexed me.
I originally had environment as { APP_ID: cloud.appId }
but that also wasn't working.Error: Undefined struct type
)
01 - this file is the application (the cloud from previous). In its stdout from local.Command
is the property we pass onward (appId)
02 - an example of a downstream dependency on the app object. It's here where MONGO_APP_ID
comes up undefined, causing fromEnv()
to fail safely and avoid writing undefined values into the state
03 - The glue, a Component Resource, showing the stitching from the app object to the otherslittle-cartoon-10569
08/31/2023, 11:47 PMdry-pilot-49577
08/31/2023, 11:48 PMlittle-cartoon-10569
08/31/2023, 11:48 PMdry-pilot-49577
08/31/2023, 11:52 PMlittle-cartoon-10569
08/31/2023, 11:54 PMdry-pilot-49577
08/31/2023, 11:57 PM