0 votes
1 view
in AWS by (5.8k points)

I created an internet gateway in AWS VPC dashboard, I attached it to a VPC then I want to detach it but I keep getting this error:

Network vpc-xxxx has some mapped public adresses, Please unmap those public addresses before detaching the gateway. ( Service: AmazonEC2; Status Code: 400; Error Code: DependencyViolation; Request ID: qfdqsdf)

What to do to detache this IGW ? Why exactly do I get this error?

I need to get rid of this IGW without deleting extra resources. please any ideas?

For information, the route table of the VPC does contain public addresses but they are routed to other targets. This IGW is not set as target anywhere.

1 Answer

+1 vote
by (18.5k points)
selected by
 
Best answer

Make sure that your route tables don't refer to the Internet gateway that you are trying to delete.

Another reason for this error might be that one of the resources in your VPC has been assigned an elastic IP address. You will have to delete the Elastic IP address before you can delete your Internet Gateway. In case the IP addresses were auto-assigned to the instances, you will have to stop the instances to remove the public IP addresses.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...