broad-helmet-79436
04/11/2025, 7:48 AMstack.preview(…)
, it wants to delete my stack outputs.
Fair enough, I didn’t really do anything to export my stack outputs from the inline program.
I’ve tried a few things:
1. Returning values from my program
function
2. Creating a new Stack resource, and returning values from the init
function
3. Asking the Pulumi AI. It told me to call stack.export(…)
, which doesn’t exist. Then it said to call pulumi.export(…)
, which also doesn’t exist. Finally, it told me to use pulumi.output(…)
, which… does not do what I want
I also looked at the Automation API examples repo, and found two seemingly relevant examples – [nodejs/crossLanguage-tsnode](https://github.com/pulumi/automation-api-examples/tree/124e3e3ed839f1dc026f686e826b6b646d9f136a/nodejs/crossLanguage-tsnode) and [go/multi_stack_orchestration](https://github.com/pulumi/automation-api-examples/tree/124e3e3ed839f1dc026f686e826b6b646d9f136a/go/multi_stack_orchestration) – but in both examples, the program that actually exports stack outputs is written in Go, and exports outputs with ctx.Export(…)
, which doesn’t really have a TypeScript equivlent 😅
Does anyone have any suggestions? 😄 😄 😄echoing-dinner-19531
04/11/2025, 7:57 AM1. Returning values from myShould be that one. Return something likefunctionprogram
{myOutput: true}
.echoing-dinner-19531
04/11/2025, 7:58 AMconst program = async () => {
const config = new Config();
return {
exp_static: "foo",
exp_cfg: config.get("bar"),
exp_secret: config.getSecret("buzz"),
};
};
broad-helmet-79436
04/11/2025, 8:08 AMbroad-helmet-79436
04/11/2025, 8:26 AM