I have some resources I'm conditionally creating d...
# typescript
m
I have some resources I'm conditionally creating depending on the stack or other factors. Is there a way to conditionally export a value only when a resource is created? In other languages there seems to be the ability to use a
pulumi.export('name', value)
but not in typescript.
v
You can do
export let varName
and then set it conditionally. Pulumi only exports the outputs if they’re not undefined
g
you can either use
export
in the
index.ts
or
exports["vpc_id"] = vpc.vpc.id;
, also search the thread or https://archive.pulumi.com/ for more creative solutions