Drew
09/10/2021, 6:10 PMFrank
ec2.Vpc.fromLookup(this, "ImportedVPC", {
vpcId
});
More details hereFrank
CoreStack
that either creates or imports the foundational resources.Drew
09/10/2021, 6:30 PMFrank
if (stage === "dev-main") {
this.vpc = new ec2.Vpc(...)
}
else if (stage.startsWith ("dev-")) {
this.vpc = ec2.Vpc.lookup(...)
}
So you create the VPC only in dev-main
stage, and dev-drew
, dev-frank
stages imports its VPC.Drew
09/10/2021, 6:38 PMDrew
09/10/2021, 6:38 PMdev-main
deploy we want it to create the VPC if it doesn’t exist….Adrián Mouly
09/10/2021, 6:41 PMJay
Frank