LoginSignup
2
1

More than 5 years have passed since last update.

CloudFormationでRoute did not stabilize in expected timeが出る場合

Last updated at Posted at 2018-03-25

CloudFormationで以下のようなエラーが出る場合があります。

Route did not stabilize in expected time

以下のtemplateでPNPrivateRoute(AWS::EC2::Route) を作成する際に発生しました。5分くらい処理が止まり、このエラーが出て終了してしまいます。

...

  PNNatGateway:
    Type: 'AWS::EC2::NatGateway'
    Properties:
      AllocationId: eipalloc-xxxxxx
      SubnetId: !Ref PNPublicSubnet
  PNPrivateRouteTable:
    Type: 'AWS::EC2::RouteTable'
    Properties:
      VpcId: !Ref PrivateNet
  PNPrivateRoute:
    Type: 'AWS::EC2::Route'
    Properties:
      RouteTableId: !Ref PNPrivateRouteTable
      DestinationCidrBlock: 0.0.0.0/0
      GatewayId: !Ref PNNatGateway

...

対応

GatewayIdで指定している箇所をNatGatewayIdに変更する。

...

  PNNatGateway:
    Type: 'AWS::EC2::NatGateway'
    Properties:
      AllocationId: eipalloc-xxxxxx
      SubnetId: !Ref PNPublicSubnet
  PNPrivateRouteTable:
    Type: 'AWS::EC2::RouteTable'
    Properties:
      VpcId: !Ref PrivateNet
  PNPrivateRoute:
    Type: 'AWS::EC2::Route'
    Properties:
      RouteTableId: !Ref PNPrivateRouteTable
      DestinationCidrBlock: 0.0.0.0/0
      NatGatewayId: !Ref PNNatGateway

...

原因

上記のとおり、GatewayIdはあくまでAWS::EC2::InternetGatewayのIDを指定するプロパティでありAWS::EC2::NatGatewayを指定したい場合はNatGatewayIdを利用しなければならないためです。

備考

あまりにも挙動とエラーメッセージがわかりにくい..。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1