Can you access the output of a resource from anoth...
# general
h
Can you access the output of a resource from another stack? Or only stack outputs?
e.g. we have a
gcp:storage/bucket:Bucket
created in an
infra
stack and want to access its name in another stack. In the
infra
stack’s JSON representation, I see that resource has a series of outputs including a
name
field. Can that be accessed programmatically?
p
you can always export the output of the given resource 🙂
So to answer your question more directly - AFAIK you can only access stack outputs from another stack but as I said above, it’s not a problem to export additional values from created resources.
if you need more help, paste the code snippet where you create a bucket or at least tell us what programming lang you use 😉
h
Sorry, just saw your response! Yeah, we use stack outputs for now. However, it’s duplicative — especially for component resources where we end up having to produce outputs both on the component resource and on the stack. (We’re using Go ftr)