https://pulumi.com logo
Title
b

blue-hair-78768

03/22/2023, 3:49 PM
Hi all, I'm trying to destroy a stack that creates a VPC however I am getting the below error. Is anyone able to assist?
aws:ec2:Vpc (eu-west-1-sandbox):
    error: deleting urn:pulumi:core-sandbox::core::aws:ec2/vpc:Vpc::eu-west-1-sandbox: 1 error occurred:
        * error deleting EC2 VPC (vpc-082befcf081fca371): DependencyViolation: The vpc 'vpc-082befcf081fca371' has dependencies and cannot be deleted.
s

stocky-restaurant-98004

03/22/2023, 3:51 PM
You have something in the VPC that's preventing it from being deleted. If you try to delete in the console, it'll tell you what's blocking the deletion.
b

blue-hair-78768

03/22/2023, 3:53 PM
Thanks - so I did try that but it didn't list anything blocking the deletion as I'm able to delete the VPC via the console. All it says is the VPC will be permanently deleted and the that internet gateway resource will also be deleted.
s

stocky-restaurant-98004

03/22/2023, 3:53 PM
I think the IGW is what's blocking deletion.
This is a bug I've seen a few times - IGWs sometimes fail to delete in a timely manner.
b

blue-hair-78768

03/22/2023, 3:56 PM
I've manually detached the IGW and ran pulumi destroy which has destroyed the VPC. Thank you!
s

stocky-restaurant-98004

03/22/2023, 5:04 PM
You're welcome!
b

bored-branch-92019

03/23/2023, 5:00 AM
I also ran into this today, so this was a helpful thread.