【发布时间】:2019-08-22 20:42:19
【问题描述】:
我正在不同区域的 2 个 VPC 之间创建一个 VPC 对等互连。对于对等连接设置的 VpcId,我正在尝试从之前创建 VPC 的另一个堆栈导入 VPC ID。这是我的代码:
VpcPeeringConnection:
Type: "AWS::EC2::VPCPeeringConnection"
Properties:
VpcId:
- Fn::ImportValue: !Sub ${VpcStack}-vpcId
PeerVpcId: !Ref PeerVPCId
PeerRegion: !Ref PeerRegion
我收到以下错误
Template error: the attribute in Fn::ImportValue must not depend on any resources, imported values, or Fn::GetAZs
【问题讨论】:
-
您是否将 VPC id 导出为其他堆栈的输出?更多详情here
标签: amazon-cloudformation amazon-vpc