Hi all, I'm having a little difficulty determining...
# python
n
Hi all, I'm having a little difficulty determining exactly how to import outputs from another stack in AWS. Specifically, I have a VPC stack I'm using for all my networking and I need to pull in VPC ID and a bunch of subnet IDs. I have those outputting properly but the example on the site isn't very clear for AWS... Is it as simple as defining a StackReference, then pulling in the output from stack.get_output(), like so?
Copy code
infra = pulumi.StackReference("my/project/stack")
public_subnet_ids = pulumi_aws.Provider("aws", {'public_subnet_ids': infra.get_output('Public Subnet IDs'))
private_subnet_ids = 'pulumi_aws.Provider("aws", {'web_subnet_ids': infra.get_output('Web Private Subnet IDs')
vpc_id = pulumi_aws.Provider("aws", {'vpc_id': infra.get_output('vpc_id')})
h
I think so. Haven't had a chance to use them myself, but I believe that's how they work?
n
¯\_(ツ)_/¯
h
what's the actual problem you're having?
n
Understanding how this is supposed to work...the code above doesn't work, even after fixing the obvious typos
I'm digging around and tracing back where things are failing but was hoping someone on here has already solved this problem
h
it might help if you actually said what the problem was
n
How can I pull in output variables from a different stack, for AWS, in Python? I can't find working examples
h
the cloud doesn't matter to pulumi
... you're remembering to export them, right?
n
Yes, they are exporting properly
h
refer to stack by
org/project/stack
(eg,
astraluma/myproject/dev
)
the output names should match the name given in the export
n
Thank you, I hadn't found that page. That is what I was looking for.
This isn't returning the output information, just a pulumi.output.Output object that I can't do anything with. Has anyone done this in practice and can advise? Thank you!
h
oh, that's pulumi futurish/prommisish async value