To better manage your VPC resources, it's recommended to remove any unused Internet Gateways (IGWs) and Egress-Only Internet Gateways (EIGWs) from your AWS VPC environment. This will not only help you adhere to best practices, but it will also prevent you from approaching the service limit (by default, you are limited to 5 IGWs and 5 EIGWs per AWS region). To identify and remove any unused VPC IGWs and EIGWs, you should look for any gateways that are not attached to an AWS Virtual Private Cloud (VPC). These gateways are considered unused and can be safely removed from your VPC environment.
To remediate the presence of unused Internet Gateways in your VPC, you can follow these steps:
It's important to note that before deleting any Internet Gateways, you should verify that they are not required for your application or business needs. Additionally, you should also ensure that there are no active resources, such as EC2 instances or VPC endpoints, that are still using the Internet Gateway before deleting it.
By regularly checking for and removing any unused Internet Gateways in your VPC, you can help reduce unnecessary costs and avoid reaching the service limit.