stocky-sundown-45608
03/21/2023, 2:16 PMconst stack = pulumi.getStack();
const nodePoolStackRef = new pulumi.StackReference(`${org}/${orgName}/${stack}`);
let stackOutput = pulumi.interpolate`${nodePoolStackRef.getOutput("clusterNodePool")}`;
const primaryNodePool = stackOutput.apply(v => v.toString());
console.log(`nodepool: ${primaryNodePool}`);
little-cartoon-10569
03/21/2023, 9:22 PMconst stackOutput = nodePoolStackRef.getOutput("clusterNodePool");
The 4th line is a no-op, you can simply do const primaryNodePool = stackOutput;
.
The last line is trying to convert an Output<string> (which isn't available at run time, it's a future value) to a string. You can't do this. Instead, you call console.log()
in the future:
primaryNodePool.apply(pnp => console.log(`nodepool: ${pnp}`));
stocky-sundown-45608
03/22/2023, 10:17 AMconst nodePoolOut = stackOutput.apply(primaryNodePool => {
console.log(`nodepool: ${primaryNodePool}`);
-- rest of code is added here ---
return {
some exported values
}
});
little-cartoon-10569
03/22/2023, 8:00 PMstocky-sundown-45608
03/23/2023, 6:38 AM