-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to delete default VPC (Reason : IGW) #23488
Comments
In my case, I had created a default VPC using the AWS provider through terraform. I had also mentioned I tried to do |
I am getting the same issue due to the internet gateway not allowing the VPC to delete from terraform.
|
Hello, we are seeing this issue as well when trying to delete a default VPC. Getting something like |
We've managed to replicate this issue as well. The default VPC cannot be destroyed by Terraform because it depends on the default IGW.
|
There's no such thing as a default IGW, so the only way is to import it and destroy it afterwards. |
Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
aws_default_vpc
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Expected Behavior
When the
terraform destroy -target 'aws_default_vpc.default_vpc'
is run, expect the Internet gateway to get detached from the VPC and deleted. Followed by the VPC deletionActual Behavior
Important Factoids
There is no
force_destroy
option in Internet gateway and internet gateway attachment to get it added into the current state like in default_vpc, default_subnets. Without default internet gateway getting detached and deleted, there are no options to get the default VPC destroyed. This ruins the purpose of force_destroy in aws_default_vpc resource.The text was updated successfully, but these errors were encountered: