Skip to main content
A NAT gateway is billed every hour it exists, plus a charge per GB it processes. When no instance sends traffic through it, only the hourly charge remains. nOps finds NAT gateways that have been billed for months without processing any data, and shows their hourly charge as the saving.

Why it matters

NAT gateways are among the more expensive networking resources to leave running, and one is often created per Availability Zone.

How nOps finds it

nOps reads the last 90 days of billing for each NAT gateway. One is flagged when its hourly charge was billed on at least 85 of those days and in the last 2 days, and it processed zero bytes in the whole 90 days. The saving is the hourly charge billed in the last 30 days, and must be at least $1.

Before you start

Permission to delete NAT gateways and release addresses (ec2:DeleteNatGateway, ec2:ReleaseAddress).

How to implement

  1. Note the NAT gateway’s Elastic IP: aws ec2 describe-nat-gateways --nat-gateway-ids ID.
  2. Find route tables that still point at it (aws ec2 describe-route-tables --filters Name=route.nat-gateway-id,Values=ID) and remove or replace those routes.
  3. Delete it: VPC → NAT gateways → Actions → Delete NAT gateway, or aws ec2 delete-nat-gateway --nat-gateway-id ID.
  4. Release its Elastic IP afterwards, or it keeps billing as an idle public IPv4 address.
  5. Remove it from Terraform or CloudFormation so it is not recreated.

Risks and considerations

  • Routes that still target the deleted NAT gateway become blackhole routes. Fix them first.
  • Deletion cannot be undone; a new NAT gateway gets a new ID, and a new IP unless you reuse the Elastic IP.

FAQs

Yes. Deleting the NAT gateway does not release its Elastic IP, which then bills as an idle address.