简体   繁体   English

现有vpc和子网的VPC对等

[英]VPC peering of existing vpc and subnets

How can I perform VPC peering between an existing VPC and subnet? 如何在现有VPC和子网之间执行VPC对等?

I have two VPC CIDRs. 我有两个VPC CIDR。 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 . 第一个是192.168.0.0/16 ,第二个是10.0.0.0/16具有现有子网CIDR 192.168.1.0/2410.0.1.0/24

So if I choose this CloudFormation template it will create a new VPC that I don't want. 因此,如果我选择此CloudFormation模板 ,它将创建一个我不需要的新VPC。 I want the existing VPC and subnet with peering. 我希望现有的VPC和子网具有对等关系。

How can I achieve this? 我该如何实现?

VPC Peering takes place between two VPCs. VPC对等在两个VPC之间进行。 The subnets are automatically peered when the VPCs are peered. 当VPC被对等时,子网将自动被对等。

The CloudFormation template you referenced creates new VPCs. 您引用的CloudFormation模板将创建新的VPC。 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. 如果要对等现有VPC,则应从模板中删除VPC和子网定义,否则它将创建新的。

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. 您将需要在模板中添加其他参数,以询问您希望对等的VPC,然后在对等定义中使用这些值。

Remember -- everything defined in the Resources section will be created. 请记住,将创建“ Resources部分中定义的所有内容。 If you don't want them created, you can instead refer to existing resources. 如果您不希望创建它们,则可以引用现有资源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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