You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

替换CloudFormation NATGateway为Fck-Nat后私有网络流量受阻求助

问题:Fck-Nat实例替换AWS NAT Gateway后,私有子网Lambda无法访问公网

为将每月成本从40美元降至约4美元,我尝试在CloudFormation YAML脚本中用Fck-Nat实例AMI替换AWS::EC2::NatGateway。部署无报错,但私有子网中的Lambda函数无法访问公网。已确认路由、IPv4分配正常,换回NATGateway则功能正常,请求排查Fck-Nat的网络转发问题。

关键配置差异

# NatGateway:
#   Type: AWS::EC2::NatGateway
#   Properties:
#     AllocationId: !GetAtt ElasticIp.AllocationId
#     SubnetId: !Ref PublicSubnet

VpcPrivateRouteTable:
  Type: AWS::EC2::RouteTable
  Properties:
    VpcId: !Ref StaticIpVpc

PrivateRoute:
  Type: AWS::EC2::Route
  DependsOn: VpcAttachment
  Properties:
    DestinationCidrBlock: 0.0.0.0/0
    RouteTableId: !Ref VpcPrivateRouteTable
    # NatGatewayId:  #!Ref NatGateway # - OLD Hook <===============
    NetworkInterfaceId: !Ref FckNatInterface # New Hook <===============Replaced with

PrivateSubnetRouteTableAssociation:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
  RouteTableId: !Ref VpcPrivateRouteTable
  SubnetId: !Ref PrivateSubnet

附加信息:Lambda需静态IP对接LimeLM。

内容的提问来源于stack exchange,提问作者Jamie Nicholl-Shelley

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.17 12:19:57