I'm trying to create a Virtual Private Gateway and...
# aws
r
I'm trying to create a Virtual Private Gateway and create a route propagation. Issue is that the Gateway is stil
attaching
while Pulumi states that it's created and my code then errors out. Is there a way to check that Gatway is attached and then do the creation of
VpnGatewayRoutePropagation
. Sample code and errors bellow:
Copy code
Code:

        new aws.ec2.VpnGatewayAttachment("vpnAttachment", {
            vpcId: vpc.id,
            vpnGatewayId: vpnGatewayId,
        });

        let counter = 0;
        vpc.vpc.mainRouteTableId.apply(id => {
            new aws.ec2.VpnGatewayRoutePropagation(`rtp0-0`, {
                routeTableId: id,
                vpnGatewayId: vpnGatewayId,
            });
        });

Error: 
  aws:ec2:VpnGatewayRoutePropagation (rtp0-0):
    error: 1 error occurred:
        * error enabling Route Table (rtb-0758b4e60d9497beb) VPN Gateway (vgw-059b13ce88dec40dd) route propagation: Gateway.NotAttached: resource vgw-059b13ce88dec40dd
        status code: 400, request id: d67fdaa0-7ecf-4019-bc97-1c33007dfd51
s
try adding a dependency to the VpnGatewayRoutePropagation for the VpnGatewayAttachment
r
I will try. But, Pulumi
VpnGatewayAttachment
markes as created even if it is sill attaching.
Ok, look like
dependsOn
works. Tnx, I totally forgot about it
s
Glad it worked
Yea it can report created even tho its actually imported. I’ve noticed that too. But it works properly.