TL;DR. I would like to ready output from previous stack in newer one with local Pulumi stack saving. For example to create a AWS Fargate ECS cluster in previously created VPC/Subnets. How to do that in Python?
I've created dev
Pulumi stack, applied code:
$ mkdir pulumi-infra-az
$ pulumi login --local
$ pulumi stack init dev
And got such Outputs
:
...
Outputs:
pulumi-private-subnet-ids: [
[0]: "subnet-0dcbaabe273db8feb"
[1]: "subnet-08c63207611c6bae2"
[2]: "subnet-00fa346a71a323551"
]
pulumi-public-subnet-ids : [
[0]: "subnet-02c50846690f2cd70"
[1]: "subnet-06282506863db7ac1"
[2]: "subnet-0cfae8a4f5e4fc03c"
]
pulumi-vpc-id : "vpc-0767f0d49e3a59d42"
Resources:
~ 3 updated
22 unchanged
Duration: 10s
Permalink: file:///root/.pulumi/stacks/dev.json
...
As you can see here I am using local stack placement /root/.pulumi/stacks/dev.json
. So far so good. Now in other dir I would like to create fargate cluster description:
$ mkdir pulumi-ecs-fargate
$ pulumi stack init dev-ecs # by the way can I use the same `dev` stack name here?
And here I need to read previously created pulumi-private-subnet-ids
, pulumi-public-subnet-ids
, pulumi-vpc-id
output values? How to do that correct?
I've found only https://app.pulumi.com backend examples:
https://www.pulumi.com/docs/intro/concepts/organizing-stacks-projects/#inter-stack-dependencies
https://www.pulumi.com/docs/intro/concepts/programming-model/#stack-references
https://www.pulumi.com/docs/tutorials/aws/aws-py-stackreference/
Could anybody provide local or AWS s3 example how to read output in other stack/dir?