惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
WordPress大学
WordPress大学
博客园 - 【当耐特】
Engineering at Meta
Engineering at Meta
IT之家
IT之家
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
美团技术团队
S
SegmentFault 最新的问题
The GitHub Blog
The GitHub Blog
Martin Fowler
Martin Fowler
Recorded Future
Recorded Future
H
Help Net Security
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
博客园_首页
A
About on SuperTechFans
MongoDB | Blog
MongoDB | Blog
阮一峰的网络日志
阮一峰的网络日志
V
Visual Studio Blog
D
DataBreaches.Net
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
B
Blog
The Register - Security
The Register - Security
I
InfoQ
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
雷峰网
雷峰网
Last Week in AI
Last Week in AI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
有赞技术团队
有赞技术团队
Stack Overflow Blog
Stack Overflow Blog
Jina AI
Jina AI
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News - Newest:
Hacker News - Newest: "LLM"
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
W
WeLiveSecurity
Latest news
Latest news
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
博客园 - 叶小钗
L
Lohrmann on Cybersecurity
博客园 - Franky
Recent Commits to openclaw:main
Recent Commits to openclaw:main
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Top 5 AWS NAT Gateway Mistakes Teams Make & How to Fix Them
Jay Mahyavan · 2026-05-21 · via DEV Community

Introduction

NAT Gateway is the AWS service most teams overpay for, and they usually don't notice until the bill is already in four figures. Every time I run an AWS NAT Gateway cost optimization review for clients, the same mistakes show up on the bill.

NAT Gateway charges are one of the most common hidden costs in AWS, not because the pricing is literally hidden. It's right on the VPC pricing page: $0.045 per hour idle, $0.045 per GB processed, $0.09 per GB for internet egress on top. What stays hidden is how much traffic is actually flowing through the gateway. Most teams never go back to check after the initial setup. A few terabytes of accidental S3 or ECR traffic move through the gateway every month, and the bill keeps growing before anyone notices.

After five years of building VPCs on AWS for in-house and client-led projects, these are the five AWS NAT Gateway mistakes I keep seeing. Each one has a fix that takes less than a day and saves a big amount on your AWS bills.

Mistake 1: Routing S3 and DynamoDB traffic through NAT Gateway

This is the most common AWS NAT Gateway mistake teams make. A Lambda function in a private subnet reads from an S3 bucket in the same region, with the route table sending 0.0.0.0/0 to the NAT Gateway. Nobody thinks about how the S3 reads will leave the subnet. Every byte the Lambda pulls gets charged $0.045/GB in NAT data processing, even though in-region S3 traffic is free.

I caught this on a recent client audit. A reporting Lambda was pulling 2 TB a week from S3, costing $0 on the S3 line but $390 a week on the NAT line for the same data movement.

The fix: Create Gateway VPC Endpoints for S3 and DynamoDB and add them to the route table for your private subnets. These endpoints are free: no hourly charge, no per-GB charge. They route S3 and DynamoDB traffic directly through AWS's private network, bypassing the NAT Gateway entirely.

Mistake 2: Forgetting NAT Gateways running in dev and staging accounts

Every team I've worked with has had at least one forgotten NAT Gateway sitting in a dev or staging account, costing $32.85/month in us-east-1 hourly charges. Multiply that by three AZs and a few environments, and the bill passes your budgeted estimate, for gateways nobody's using on weekends.

A team I worked with had three forgotten gateways in a single staging account, running for six months before a routine audit caught them. That's $32.85/month for three gateways over six months, about $590 in hourly charges.

The fix: Run aws ec2 describe-nat-gateways once a month against every account and check the CloudWatch BytesOutToDestination metric for each gateway. If one has been idle for 30 days, delete it. AWS Compute Optimizer also flags idle gateways automatically now. Turning it on takes about thirty seconds.

Mistake 3: Pulling ECR images through NAT in EKS or ECS clusters

In EKS and ECS, nodes pull container images constantly. By default, every pull goes through the NAT Gateway and gets charged $0.045/GB on the full image size.

A client I worked with last year ran into this on their EKS rollout. They were running 30 services on 12 nodes with 400 MB images on rolling deploys. Within two weeks, the NAT data processing line on their bill had quadrupled, and VPC Flow Logs traced close to 8 TB of monthly traffic to ECR pulls. This is the biggest AWS NAT Gateway mistake I see on EKS engagements.

The fix: Create two Interface Endpoints in each AZ (com.amazonaws.<region>.ecr.api and com.amazonaws.<region>.ecr.dkr) plus a Gateway Endpoint for S3, where ECR stores its layer data. Once these are in place, container pulls stay on AWS's private network instead of going through the NAT Gateway. The Interface Endpoints cost $0.01/GB plus an hourly per-ENI charge; the S3 Gateway Endpoint is free. We did this for our client, and their NAT data processing dropped about 78% the month after cutover.

If you're running EKS or ECS at scale and want this done properly without involving your in-house engineers in other work, this is a good place to hire AWS developers who've done it before.

Mistake 4: Running a single NAT Gateway for multiple AZs to save money

Some teams deploy a single NAT Gateway in us-east-1a and route private subnets from 1b and 1c through it to save $32/month. The setup looks clean on the diagram. The catch is cross-AZ data transfer. Every byte from 1b and 1c now pays $0.01/GB to reach the NAT Gateway, on top of the $0.045/GB NAT data processing charge.

We had this setup on an internal data ingestion service that pulled metrics from third-party APIs. Workers in 1b and 1c routed through a single NAT Gateway in 1a to save $64/month, but the cross-AZ fees passed the cost of a second NAT Gateway inside three weeks.

The fix: Deploy one NAT Gateway per AZ for any workload pushing more than ~3 TB/month of cross-AZ traffic. Below that, single-AZ NAT can still be cheaper. If you don't know which side of the line you're on, VPC Flow Logs will tell you in an afternoon.

Mistake 5: Ignoring VPC Flow Logs until the AWS bill forces a look

This is the key NAT Gateway mistake that enables all the others. Most teams don't enable VPC Flow Logs on their NAT Gateway's ENI until something on the bill forces them to look, by which point the gateway has been burning money for months. The architecture diagram tells one story. The traffic tells another.

The fix: Flow Logs on the NAT Gateway's ENI, queried weekly. In AWS Cost Explorer, group by Usage Type and filter for NatGateway-Bytes and NatGateway-Hours. You're looking for two patterns: AWS service IPs (candidates for endpoints) and small chatty destinations (candidates for caching or batching). Five minutes a week. You can't catch AWS NAT Gateway mistakes without it.

Ending Note

Five years of building and reviewing AWS infrastructure have put me in front of a lot of NAT Gateway mistakes people make. The conclusion is almost always the same. The gateway itself is rarely the problem. The problem is the traffic flowing through it that nobody on the team realizes is there. Once that traffic shows up in Flow Logs, most of the fix is a route table change.

If your NAT bill is climbing and you're not sure why, start with VPC Flow Logs on the NAT ENI. Look at the top destinations. If S3, DynamoDB, or ECR are in there, you've already found money. Most teams hit two or three of these AWS NAT Gateway mistakes the first time they actually look.

For teams that have looked at their Flow Logs, tried the fixes above, and are still seeing high NAT bills, or are dealing with exceptional cases that don't fit the patterns in this article, they can get help from an AWS consulting services provider to assess the current NAT setup, recommend the right fixes, and implement them with their team.