Menu

AWS FinOps Field Notes (2026-11-09): Eliminating Idle NAT Gateways & Unattached EIPs with Python
πŸ“°

AWS FinOps Field Notes (2026-11-09): Eliminating Idle NAT Gateways & Unattached EIPs with Python

DEV Community: awsΒ·Ace7-coderΒ·about 22 hours ago
#gKIOQz1D
#devtoaws#devto#dev#gateways#boto3
Reading 0:00
15s threshold

While auditing cloud infrastructure costs this week, recurring configuration gaps continue to quietly inflate monthly cloud bills.

Field Insight: The Hidden Cost Trap

Migrating from self-managed NAT instances to AWS NAT Gateways often doubles monthly networking spend ($3k/mo jumping to $6k/mo). Between flat hourly fees across multiple AZs and $0.045/GB data processing charges on unrouted internal traffic, unmonitored NAT Gateways silently inflate monthly bills.

Automated Detection: Auditing Idle NAT Gateways and Unattached Elastic IPs with Boto3

import boto3 from datetime import datetime , timedelta , timezone

def audit_idle_network_costs ( region = ' us-east-1 ' ): ec2 = boto3 . client ( ' ec2 ' , region_name = region ) cw = boto3 . client ( ' cloudwatch ' , region_name = region ) now = datetime . now ( timezone . utc ) seven_days_ago = now - timedelta ( days = 7 )

# 1. Unassociated Elastic IPs ($0.005/hr = ~$3.60/month each) eips = ec2 . describe_addresses ().…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.