Like even code this simple doesn’t work ``` /**...
# typescript
b
Like even code this simple doesn’t work
Copy code
/** Create vpc */
    const vpc = new aws.ec2.Vpc(
      `${opts.name}-vpc`,
      {
        cidrBlock: opts.vpcCidr,
        enableDnsHostnames: true,
        tags: { Name: `${opts.name}-vpc` }
      },
      { parent: this }
    );

    /** Create internet gateway for VPC */
    const internetGateway = new aws.ec2.InternetGateway(
      `${opts.name}-igw`,
      {
        vpcId: vpc.id,
        tags: { Name: `${opts.name}-igw` }
      },
      { parent: this, dependsOn: vpc }
    );
It always deletes the VPC first
l
Should work 😞 Would you like to try re-parenting the IG to the VPC first (via
up
), then seeing if that dependency works? It's just a workaround and shouldn't be necessary...
b
State got into a bad place. Had to manually destroy everything. Afterwards the same exact code worked fine building / being destroyed in order. Not sure what happened just yet.