【问题标题】:AWS --Cloudformation --SubnetRouteTableAssociation --Failed to Stabilize in TimeAWS --Cloudformation --SubnetRouteTableAssociation --未能及时稳定
【发布时间】:2018-03-09 02:47:20
【问题描述】:

我有一个堆栈一直建到底部,但由于某些原因,我似乎无法弄清楚它开始在一个奇怪的地方中断,导致 CREATE_FAILED 错误。
有问题的错误代码: A AWS::EC2::SubnetRouteTableAssociation SubnetRouteTableAssociationMain 子网路由表关联 rtbassoc-894281e2 未能在预期时间内稳定
现在我发现这真的很有趣,因为在构建的早期我与这个子网关联有类似的错误,但它有时会工作,有时会失败。这是有问题的代码库以及可能与此设置冲突的任何其他内容,似乎失败的是倒数第二个代码块。

SocoDrIGW:
    Type: AWS::EC2::InternetGateway
    Properties: 
        Tags:
        - 
            Key: SOCODR
            Value: InternetGateway


RouteTableSocoDrMain:
    Type: AWS::EC2::RouteTable
    DependsOn: SocoDrVPC
    Properties:
                VpcId: 
                    Ref: SocoDrVPC

RouteDrMain:
    Type: AWS::EC2::Route
    DependsOn:
            - RouteTableSocoDrMain
            - SocoDrIGW
            - SocoDrSubnet01
    Properties:
        RouteTableId: 
            Ref: RouteTableSocoDrMain
        DestinationCidrBlock: 0.0.0.0/0
        GatewayId: 
            Ref: SocoDrIGW

#ERROR OCCURS HERE
SubnetRouteTableAssociationMain:
    Type: AWS::EC2::SubnetRouteTableAssociation
    Properties:
                SubnetId:
                        Ref: SocoDrSubnet01
                RouteTableId:
                        Ref: RouteTableSocoDrMain

SocoDrSubnet01:
    Type: AWS::EC2::Subnet
    Properties:
        AvailabilityZone: !Join [ '', [ !Ref 'AWS::Region', !Ref AvailabilityZones ] ]
        VpcId: 
                Ref: SocoDrVPC
        CidrBlock: 10.10.8.0/24

        Tags:
        - 
            Key: SOCODR
            Value: Subnet

【问题讨论】:

  • 我在错误地跨不同堆栈导入相同的路由表 ID 后遇到了这个问题 - 如果您使用 ImportValue,请确保返回到您过去的堆栈,看看您是否犯了错误。

标签: amazon-web-services amazon-cloudformation amazon-vpc


【解决方案1】:

但我发现它有什么问题。 According to the white pages: VPC 中的每个子网都必须关联一个路由表;该表控制子网的路由。一个子网一次只能与一个路由表关联,但您可以将多个子网与同一个路由表关联。

我的配置是两个子网路由表关联相互抵消,因为它们都连接到同一个子网。

【讨论】:

    猜你喜欢
    • 2022-01-11
    • 2020-07-14
    • 2020-10-10
    • 2017-08-11
    • 2022-08-03
    • 2018-09-17
    • 2017-06-25
    • 2017-10-16
    • 1970-01-01
    相关资源
    最近更新 更多