【发布时间】:2021-08-27 05:44:08
【问题描述】:
我有一个带有私有/公共子网(使用 CDK 创建)的现有 VPC 和一个未处于待处理状态的现有 Transient Gateway(手动创建)。我现在正在尝试修改我的堆栈以创建 VPC 中转网关附件,但我的代码没有找到中转网关。代码如下:
// create a VPC attachment to the transit gateway
var transitGatewayAttachment = new CfnTransitGatewayAttachment(this, "TransitGatewayAttachment", new CfnTransitGatewayAttachmentProps
{
VpcId = Vpc.VpcId,
TransitGatewayId = "tgw-xxxxxx",
SubnetIds = Vpc.PrivateSubnets.Select(s => s.SubnetId).ToArray()
});
CDK 返回 Transit Gateway 不存在的错误。 CloudFormation 也是如此。我已经对 tgw id 进行了两次和三次检查,所以我很困惑可能是什么问题。
【问题讨论】:
-
不完全确定,但您可能必须通过 ARN 引用它,或者传递实际实例而不是字符串。
标签: amazon-web-services aws-cdk