https://pulumi.com logo
Title
v

victorious-dusk-75271

08/06/2022, 2:49 AM
Diagnostics:
  aws:ec2:Vpc (rds-vpc-vpc):
    error: deleting urn:pulumi:dev::allrites-infrastructure::aws:ec2/vpc:Vpc::rds-vpc-vpc: 1 error occurred:
        * error deleting EC2 VPC (vpc-076d9d57f5bfecac7): DependencyViolation: The vpc 'vpc-076d9d57f5bfecac7' has dependencies and cannot be deleted.
        status code: 400, request id: 8f586580-0c6f-4134-8606-e2c3aaa0c19f

  pulumi:pulumi:Stack (allrites-infrastructure-dev):
    error: update failed
how do i solve this problem?
s

steep-toddler-94095

08/06/2022, 3:00 AM
you might be able to more easily figure out what these dependencies are through the AWS console. for example, try deleting the VPC through the console and see what the popup message says
v

victorious-dusk-75271

08/06/2022, 3:10 AM
i mean i do not want to remove it. for some reason pulumi thought i want to delete it
now every time i run up. its trying to delete that vpc
s

steep-toddler-94095

08/06/2022, 3:11 AM
You changed something in your program that's causing pulumi to think you want it deleted. It could be that you renamed it or you accidentally removed the class instantiation from your code, etc.
v

victorious-dusk-75271

08/06/2022, 3:15 AM
yes you are right. is there away to skip this task?
s

steep-toddler-94095

08/06/2022, 3:17 AM
nope! you will need to fix your program to not delete the VPC. any other way would be breaking the declarative model of Pulumi
v

victorious-dusk-75271

08/06/2022, 3:21 AM
it shows up on the up. exactly same resource.

https://puu.sh/JeNvt/a32d3ec590.png

s

steep-toddler-94095

08/06/2022, 3:22 AM
no, these are different resources. the first is
eks-vpc-vpc
and the second is
rds-vpc-vpc
v

victorious-dusk-75271

08/06/2022, 3:23 AM
You are right but
rds-vpc-vpc
exits

https://puu.sh/JeNwp/29d26a9bca.png

s

steep-toddler-94095

08/06/2022, 3:25 AM
interesting, the preview doesn't say it will delete the VPC but
up
attempts to delete it? Can you try running
pulumi refresh
just to rule out weird state drift
v

victorious-dusk-75271

08/06/2022, 3:26 AM
exactly. I have tried
pulumi refresh
and it did'nt help
pulumi refresh
Resources:
    43 unchanged

Duration: 4s
s

steep-toddler-94095

08/06/2022, 3:29 AM
i don't know, this is weird 😐 what if you try `import`ing the VPC?
oh, so the text output shows that the VPC will be deleted. maybe the console output is buggy and didn't display it
can you verify in your typescript code that you DO have a VPC named
"rds-vpc-vpc"
v

victorious-dusk-75271

08/06/2022, 3:31 AM
yes i do have it
s

steep-toddler-94095

08/06/2022, 3:31 AM
and you didn't change the provider?
v

victorious-dusk-75271

08/06/2022, 3:32 AM
thats correct
s

steep-toddler-94095

08/06/2022, 3:33 AM
in your code where you're creating the VPC can you try `import`ing the VPC
v

victorious-dusk-75271

08/06/2022, 3:33 AM
i dont know how to import
s

steep-toddler-94095

08/06/2022, 3:35 AM
v

victorious-dusk-75271

08/06/2022, 3:49 AM
since i am just developing it the IaC, I just removed pulumi stack and i will use this to nuke the aws account
s

steep-toddler-94095

08/06/2022, 3:49 AM
💥