简体   繁体   中英

VPC peering of existing vpc and subnets

How can I perform VPC peering between an existing VPC and subnet?

I have two VPC CIDRs. First is 192.168.0.0/16 and second is 10.0.0.0/16 with existing subnet CIDR 192.168.1.0/24 and 10.0.1.0/24 .

So if I choose this CloudFormation template it will create a new VPC that I don't want. I want the existing VPC and subnet with peering.

How can I achieve this?

VPC Peering takes place between two VPCs. The subnets are automatically peered when the VPCs are peered.

The CloudFormation template you referenced creates new VPCs. If you want to peer existing VPCs, then you should remove the VPC and Subnet definitions from the template, otherwise it will create new ones.

You will need to add additional parameters into the template to ask which VPCs you wish to peer, and then use those values in the peering definition.

Remember -- everything defined in the Resources section will be created. If you don't want them created, you can instead refer to existing resources.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM