https://pulumi.com logo
Title
e

elegant-oyster-65027

03/10/2023, 1:53 AM
Hello, Is it possible to pass the output value of a stack as an environment variable to a lambda function in another stack? Specifically, I have a stack that creates a database cluster and outputs its endpoint, and I want to use this endpoint as an environment variable in a lambda function in another stack. I am fairly new to Pulumi, so could someone provide an example in Go if this is possible?
g

green-stone-37839

03/10/2023, 4:01 AM
Stack References are the way to accomplish this. https://www.pulumi.com/learn/building-with-pulumi/stack-references/
Note, these examples assume you are using the Pulumi Service backend. You will have a slightly different experience using s3, blob, etc backends