https://pulumi.com logo
Title
b

busy-magazine-6225

01/22/2022, 1:05 AM
Like even code this simple doesn’t work
/** 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

little-cartoon-10569

01/23/2022, 8:44 PM
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

busy-magazine-6225

01/24/2022, 7:05 PM
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.