gpt4 book ai didi

networking - 云形成: Referencing a NAT gateway from a route gives Invalid id: "nat-0ad5d1c106dd74175"

转载 作者:行者123 更新时间:2023-12-03 07:45:52 25 4
gpt4 key购买 nike

我有以下 Cloud Formation 配置,其中包括子网、路由表/路由、nat 网关和弹性 IP:

  lambdaPointToIgwStaging:
Type: 'AWS::EC2::Subnet'
Properties:
VpcId: !Ref mainVpc
CidrBlock: '210.12.172.0/20'
AvailabilityZone: eu-west-1b
lambdaEipStaging:
Type: 'AWS::EC2::EIP'
Properties:
Domain: 'vpc'
lambdaNatGatewayStaging:
Type: 'AWS::EC2::NatGateway'
Properties:
AllocationId: !GetAtt lambdaEipStaging.AllocationId
SubnetId: !Ref lambdaPointToIgwStaging
lambdaNatRoute:
Type: 'AWS::EC2::Route'
Properties:
DestinationCidrBlock: '0.0.0.0/0'
InstanceId: !Ref lambdaNatGatewayStaging
RouteTableId: !Ref lambdaToNatStaging
DependsOn: lambdaNatGatewayStaging
lambdaToNatStaging:
Type: 'AWS::EC2::RouteTable'
Properties:
VpcId: !Ref mainVpc

创建lambdaNatRoute时失败,并出现错误Invalid id: "nat-0ad5d1c106dd74175",这是一个完全无用的错误。我尝试了各种dependsOn配置,但似乎都没有帮助。有什么想法吗?

最佳答案

最终通过了 AWS 支持,答案是在我的路由定义中使用 NatGatewayId 而不是 InstanceId:

  lambdaNatRoute:
Type: 'AWS::EC2::Route'
Properties:
DestinationCidrBlock: '0.0.0.0/0'
NatGatewayId: !Ref lambdaNatGatewayStaging
RouteTableId: !Ref lambdaToNatStaging

关于networking - 云形成: Referencing a NAT gateway from a route gives Invalid id: "nat-0ad5d1c106dd74175",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44708039/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com