AWS Cross-Region VPC Peering Cloudformation 无法识别其他区域的 VPC
AWS Cross-Region VPC Peering Cloudformation doesn't recognise the VPC in the other region
我一直致力于创建一个 VPC 对等连接,它可以使用 cloudformation 从 eu-west-1 对等到 us-east-1。这是截至目前的 cloudformation:
AWSTemplateFormatVersion: 2010-09-09
Description: This templates creates a VPC Peering connection. (Requester Account)
Parameters:
PeerName:
Description: Name of the VPC Peer
MaxLength: 255
Type: String
PeerVPCID:
AllowedPattern: '^vpc-[0-9a-f]{17}$'
ConstraintDescription: Must have a prefix of "vpc-". Followed by 17 characters (numbers, letters "a-f")
Description: ID of the VPC with which you are creating the VPC peering connection
Type: AWS::EC2::VPC::Id
VPCID:
Description: ID of the VPC
Type: AWS::EC2::VPC::Id
PeerRegion:
Description: Region of the VPC Accepter (not required)
Type: String
Resources:
VPCPeeringConnection:
Type: AWS::EC2::VPCPeeringConnection
Properties:
VpcId: !Ref VPCID
PeerVpcId: !Ref PeerVPCID
PeerOwnerId: !Ref "AWS::AccountId"
PeerRegion: !Ref PeerRegion
Tags:
- Key: Name
Value: !Ref PeerName
Outputs:
VPCPeeringConnectionId:
Description: VPC Peering Connection ID
Value: !Ref VPCPeeringConnection
这些是参数的值:
PeerName: Connector
PeerVPCID: vpc-1234567
VPCID: vpc-7654321
PeerRegion: us-east-1
我知道我需要一个接受者来批准 us-east-1 中的连接,但当前的 cloudformation 输出它无法识别 VPCID 是有效的(位于另一个区域的 VPCID 到我正在使用的 AWS 账户)。
当我在 GUI 中创建 VPC 对等连接时,它没有抛出任何错误,我只需要接受连接并更新路由表,一切正常...我应该对当前的云形成?
感谢您的帮助!
要解决该更改:
Type: AWS::EC2::VPC::Id
进入
Type: String
对于远程 VPC,即来自您部署堆栈的区域以外的区域的 VPC。
我一直致力于创建一个 VPC 对等连接,它可以使用 cloudformation 从 eu-west-1 对等到 us-east-1。这是截至目前的 cloudformation:
AWSTemplateFormatVersion: 2010-09-09
Description: This templates creates a VPC Peering connection. (Requester Account)
Parameters:
PeerName:
Description: Name of the VPC Peer
MaxLength: 255
Type: String
PeerVPCID:
AllowedPattern: '^vpc-[0-9a-f]{17}$'
ConstraintDescription: Must have a prefix of "vpc-". Followed by 17 characters (numbers, letters "a-f")
Description: ID of the VPC with which you are creating the VPC peering connection
Type: AWS::EC2::VPC::Id
VPCID:
Description: ID of the VPC
Type: AWS::EC2::VPC::Id
PeerRegion:
Description: Region of the VPC Accepter (not required)
Type: String
Resources:
VPCPeeringConnection:
Type: AWS::EC2::VPCPeeringConnection
Properties:
VpcId: !Ref VPCID
PeerVpcId: !Ref PeerVPCID
PeerOwnerId: !Ref "AWS::AccountId"
PeerRegion: !Ref PeerRegion
Tags:
- Key: Name
Value: !Ref PeerName
Outputs:
VPCPeeringConnectionId:
Description: VPC Peering Connection ID
Value: !Ref VPCPeeringConnection
这些是参数的值:
PeerName: Connector
PeerVPCID: vpc-1234567
VPCID: vpc-7654321
PeerRegion: us-east-1
我知道我需要一个接受者来批准 us-east-1 中的连接,但当前的 cloudformation 输出它无法识别 VPCID 是有效的(位于另一个区域的 VPCID 到我正在使用的 AWS 账户)。
当我在 GUI 中创建 VPC 对等连接时,它没有抛出任何错误,我只需要接受连接并更新路由表,一切正常...我应该对当前的云形成?
感谢您的帮助!
要解决该更改:
Type: AWS::EC2::VPC::Id
进入
Type: String
对于远程 VPC,即来自您部署堆栈的区域以外的区域的 VPC。