What is the Go equivalent of Typescript’s export? ...
# general
p
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
Copy code
ctx.Export("vpcId", vpc.VpcId)
@prehistoric-sandwich-7272
p
@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
@fancy-spoon-7206 does it happen after the ctx.export?
f
Whereever you are trying to ingest the imported stack 🙂.
p
thanks a lot!