sst / ion

SST v3
https://sst.dev
MIT License
1.88k stars 221 forks source link

Expose stack outputs to sst shell #512

Closed chrisandrewcl closed 3 months ago

chrisandrewcl commented 3 months ago

Currently, it seems only linked resources are injected in the env when running sst shell but stack outputs are also very useful in this context.

Is there any supported way to access them when running scripts?

* I am currently working around it by using a dummy linkable component that exports the stack outputs in its link properties, but it would be nice to have it baked in ion.

jayair commented 3 months ago

So any resource gets adding to the shell. It doesn't need to be linked but we have a feature coming soon that'll let you create a resource out of any output and that'll be exposed in the sst shell as well.

chrisandrewcl commented 3 months ago

The upcoming feature you mentioned sounds like it will do the trick!

* Also, what I meant to say was "only linkable resources are currenlty added to the env" 🤦

thdxr commented 3 months ago

this is released but not documented yet - you can do

new sst.Resource("MyResource", { any: "thing", foo: other.thing } )

and it will show up in sst shell

thdxr commented 3 months ago

it's linkable too