Hi, is it possible to shared a global vpc in a pro...
# general
h
Hi, is it possible to shared a global vpc in a project, for example, i will create a aws eks cluter and rds postgres server, they are in same vpc , how to organization the codes? do we have an example ?
e
I think the common recommendation for sharing resources is to set them up in a separate project and then use a stack reference to get their IDs and other outputs.
🙌 2
s
So I usually keep my VPC and default AWS account creation code separate from application infra code. Then if you need to pull the VPC info you can pull it from your stack state like this
Copy code
const stateConfig = new pulumi.StackReference('myorg/myproject/my.dev')
then if you output your VPC id you can pull it in with stateConfig.output('myvpcid')
h
do you have any code repo that i can reference?
e