In the template defining the VPC, specify the VPC ID in the output section:
"Outputs" : {
"VPC" : {
"Value" : {"Ref":"VPC"},
"Description" : "VPC ID"
},
...
}
In the template for the stack using VPC, define the parameter for the VPC ID:
"Parameters" : {
"VPC" : {
"Type" : "String",
},
...
}
When creating this stack, call describe-stackon the stack defining the VPC to get the identifier from the outputs and pass it as a parameter VPCto create-stack.
source
share