https://pulumi.com logo
#general
Title
# general
p

prehistoric-sandwich-7272

07/05/2022, 2:54 PM
What is the Go equivalent of Typescript’s export? I am trying to achieve this Typescript code:
Copy code
exports.vpcId = eksVpc.id
But in Golang. Anyone knows? In the docs there is no example for Golang
f

fancy-spoon-7206

07/05/2022, 2:56 PM
Copy code
ctx.Export("vpcId", vpc.VpcId)
@prehistoric-sandwich-7272
p

prehistoric-sandwich-7272

07/05/2022, 7:27 PM
@fancy-spoon-7206 Thanks! Do you happen to know maybe as well how to get output of a stack referense afterwards?
I understood that you need to export a variable and in order to use it in a different stack you need to get out put
I tried doing:
Copy code
s := stack.GetOutput(pulumi.String(key))
but it is returned as
pulumi.AnyOutput
- and I can’t manage to convert it to string
You will need the Appy func
p

prehistoric-sandwich-7272

07/05/2022, 7:39 PM
@fancy-spoon-7206 does it happen after the ctx.export?
f

fancy-spoon-7206

07/05/2022, 7:57 PM
Whereever you are trying to ingest the imported stack 🙂.
p

prehistoric-sandwich-7272

07/06/2022, 7:30 AM
thanks a lot!
3 Views