Hey guys, I’m loving Pulumi and now I am creating ...
# getting-started
c
Hey guys, I’m loving Pulumi and now I am creating another project that uses stack references to reference another one. I’m using Typescript. My question is: Is there a way to generate Typescript types for stack outputs so when using
new pulumi.StackReference
we enjoy an strict schema? Thank you!
And a side question: I am exporting an entire k8s cluster as an output (not sure if it’s the best idea). When referencing this output from another project, the whole output is a secret. Why is this? Is this because the output is a complex object that contains a secret (?) then the wrapping object is now a secret?
e
Is there a way to generate Typescript types for stack outputs so when using
new pulumi.StackReference
we enjoy an strict schema?
No but it's a good idea. Something we've thought about adding at some point.
Why is this? Is this because the output is a complex object that contains a secret (?) then the wrapping object is now a secret?
Yup pretty much. You can use "pulumi.unsecret" on specific parts to unsecret them if you want.
c
That makes sense! Thank you 🙏 congrats on our work, it’s a great product
s
As an aside, we generally recommend exporting specific properties instead of the entire object (so, specific properties of the Kubernetes cluster instead of the entire cluster object).
c
Yeah! That’s what I end up doing. Much easier, cleaner and I only import/export what I need. Sleek
s
I had a colleague here at Pulumi describe stack outputs as “the API of the Pulumi project”: expose only what’s needed, and leave the rest as internal implementation details. That was helpful for me, as before that I tended to export everything (just in case I needed it).
c
That’s a good way to put it indeed! Makes absolute sense