How do I find the IP(s) blocking deletion of an InternetGateway?

0

I am trying to delete a CloudFormation stack, but have run into errors deleting a few resources. Of 28 resources, 5 failed to delete: AWS::EC2::InternetGateway, 2x AWS::EC2::Subnet, AWS::EC2::VPC, and AWS::EC2::VPCGatewayAttachment. The InternetGateway, Subnets, and VPC all show an error stating there are dependencies and cannot be deleted. The VPCGatewayAttachment says the VPC "has some mapped public address(es). Please unmap those public address(es) before detaching the gateway."

If I try an manually detach the InternetGateway from the VPC, I get the same error that the VPC "has some mapped public address(es). Please unmap those public address(es) before detaching the gateway."

I cannot find any Elastic IPs in this VPC that haven't already been deleted. How do I find what is preventing these resources from deleting?

已提問 2 年前檢視次數 3544 次
2 個答案
0

The first thing I would try is to run aws ec2 describe-addresses using the AWS CLI and then track down the instance(s) using those IPs by looking at their network interface.

profile pictureAWS
專家
已回答 2 年前
0

If the aws ec2 describe-addresses from the other answer does not work, please check that you have deleted any NAT Gateway(s). They have EIPs and have caused for me a similar issue that you are seeing

profile pictureAWS
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南