Hi everyone, I am trying to delete the default VPC...
# general
c
Hi everyone, I am trying to delete the default VPC using Sdk I see that code
Copy code
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

// Delete the default VPC
const defaultVpc = new aws.ec2.DefaultVpc("defaultVpc", {
  forceDestroy: true,
});
and run
pulumi up
, the result is nothing happen. try to run
pulumi destroy
throw and error dependencies what I do wrong please?
f
I think you do not have that resource in your stack so what you can do is to import it into your stack first before you run the up or destroy command.
c
@flaky-finland-22550 thanks but on previwe I see the stack
f
From the code you have provided, you are creating an aws.ec2.DefaultVpc.
c
is from Pulumi AI, every account by default has default VPC with dependencies inside (subnets) and I wanna to delete the defaults. the code you see is the answer of the Pulumi AI
f
Okay please. Which error do you get when you run the destroy command?
c
DependencyViolation: The vpc ’ has dependencies and cannot be deleted.
@flaky-finland-22550 also in
Pulumi Ai
, tell you when you being and forceDestroy equal to true should deleted by
pulumi up