2017-06-22 5 views
0

Ich habe folgende Wolkenbildung Aufbau eines Subnetzes aus, Routentabelle/route, NAT-Gateway und elastische IP:Wolkenbildung: ein NAT-Gateway von einer Route Referenzierung gibt ungültige ID: "nat-0ad5d1c106dd74175"

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 

Es scheitert an der lambdaNatRoute Erstellung, mit dem Fehler Invalid id: "nat-0ad5d1c106dd74175", die ein völlig nicht hilfreicher Fehler ist. Ich habe eine Vielzahl von dependsOn-Konfigurationen ausprobiert, aber keine scheint zu helfen. Irgendwelche Ideen?

Antwort

0

Ging durch AWS Unterstützung am Ende und die Antwort war NatGatewayId statt InstanceId in meiner Routendefinition zu verwenden:

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