<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Muhammad Umar</title>
    <description>The latest articles on DEV Community by Muhammad Umar (@devopswithumar).</description>
    <link>https://dev.to/devopswithumar</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4225969%2Fbb028841-536e-4488-87d0-5997447e819e.jpg</url>
      <title>DEV Community: Muhammad Umar</title>
      <link>https://dev.to/devopswithumar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/devopswithumar"/>
    <language>en</language>
    <item>
      <title>Why your GitHub Actions pipeline is slow, and the fix</title>
      <dc:creator>Muhammad Umar</dc:creator>
      <pubDate>Tue, 24 Nov 2026 09:00:00 +0000</pubDate>
      <link>https://dev.to/devopswithumar/why-your-github-actions-pipeline-is-slow-and-the-fix-33do</link>
      <guid>https://dev.to/devopswithumar/why-your-github-actions-pipeline-is-slow-and-the-fix-33do</guid>
      <description>&lt;p&gt;In short:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Measure first: the run's timing view shows which step eats the minutes.&lt;/li&gt;
&lt;li&gt;Cache dependencies and Docker layers, keyed on the lock file.&lt;/li&gt;
&lt;li&gt;Run only what changed, run jobs in parallel, and cancel stale build runs (but never deploys).&lt;/li&gt;
&lt;li&gt;Deploy to production only from main, behind branch protection and a protected environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A slow GitHub Actions pipeline is more than an annoyance. When a deploy is taking too long, say fifteen minutes, people batch their changes, deploy less often, and each deploy becomes riskier. Fast feedback is what keeps releases small and boring.&lt;/p&gt;

&lt;p&gt;Most slow GitHub Actions workflows share the same handful of problems: no cache, everything running on every push, jobs running one after another, Docker images rebuilt from scratch, and stuck jobs nobody stops. Here is how to find which one is yours, and the fix for each.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is GitHub Actions slow? Measure before you tune
&lt;/h2&gt;

&lt;p&gt;Open a recent run in the Actions tab and click into the slowest job. Every step shows its duration, so you can see exactly where the minutes go. Fix the biggest step first, then measure again. The slowest step is often not the one you expect.&lt;/p&gt;

&lt;p&gt;What you usually find:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What the timing shows&lt;/th&gt;
&lt;th&gt;The likely cause&lt;/th&gt;
&lt;th&gt;Fix below&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;npm ci&lt;/code&gt;, &lt;code&gt;pip install&lt;/code&gt; or &lt;code&gt;go mod download&lt;/code&gt; takes minutes&lt;/td&gt;
&lt;td&gt;No dependency cache&lt;/td&gt;
&lt;td&gt;Problem 1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The workflow ran for a README or docs change&lt;/td&gt;
&lt;td&gt;No path filters&lt;/td&gt;
&lt;td&gt;Problem 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Two or three runs queued for the same branch&lt;/td&gt;
&lt;td&gt;Stale runs not cancelled&lt;/td&gt;
&lt;td&gt;Problem 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lint, tests and build run one after another&lt;/td&gt;
&lt;td&gt;One long job instead of parallel jobs&lt;/td&gt;
&lt;td&gt;Problem 3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;docker build&lt;/code&gt; reinstalls everything each time&lt;/td&gt;
&lt;td&gt;No Docker layer cache&lt;/td&gt;
&lt;td&gt;Problem 4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A job ran for hours before it failed&lt;/td&gt;
&lt;td&gt;No timeout&lt;/td&gt;
&lt;td&gt;Problem 5&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Problem 1: No GitHub Actions cache, so dependencies download every run
&lt;/h2&gt;

&lt;p&gt;If every run starts with &lt;code&gt;npm ci&lt;/code&gt; or &lt;code&gt;pip install&lt;/code&gt; from scratch, you are downloading the same packages hundreds of times. Caching restores them in seconds.&lt;/p&gt;

&lt;p&gt;For Node, the setup action has caching built in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v5&lt;/span&gt;

&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@v6&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;
    &lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm&lt;/span&gt;

&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm ci&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Other ecosystems work the same way. The Python, Java and Go setup actions all have a cache option, and &lt;code&gt;actions/cache&lt;/code&gt; covers everything else:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/cache@v4&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;~/.cache/pip&lt;/span&gt;
    &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pip-${{ runner.os }}-${{ hashFiles('requirements.txt') }}&lt;/span&gt;
    &lt;span class="na"&gt;restore-keys&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;
      &lt;span class="s"&gt;pip-${{ runner.os }}-&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;key&lt;/code&gt; changes only when &lt;code&gt;requirements.txt&lt;/code&gt; changes, so most runs get an exact hit. When it does change, &lt;code&gt;restore-keys&lt;/code&gt; falls back to the most recent cache with the same prefix, so you still start from most of your packages.&lt;/p&gt;

&lt;p&gt;How the GitHub Actions cache behaves, from the &lt;a href="https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching" rel="noopener noreferrer"&gt;dependency caching reference&lt;/a&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Rule&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Default size limit&lt;/td&gt;
&lt;td&gt;10 GB per repository&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unused entries removed after&lt;/td&gt;
&lt;td&gt;7 days&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;When the limit is reached&lt;/td&gt;
&lt;td&gt;Least recently used caches go first&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Which caches a run can read&lt;/td&gt;
&lt;td&gt;Its own branch first, then the default branch&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two habits make caches work for you: key them on your lock file, so they refresh when dependencies change, and keep them small, because restoring a huge cache can cost as much as it saves. Never put the commit SHA in a cache key: every run then misses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem 2: Everything runs on every push
&lt;/h2&gt;

&lt;p&gt;A typo fix in the README should not trigger a full build and deploy. Two settings stop that waste.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Path filters&lt;/strong&gt; run the workflow only when relevant files change:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;main&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"src/**"&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"package*.json"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Concurrency&lt;/strong&gt; cancels an older run when a newer one starts on the same branch, so a quick succession of pushes does not queue up:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;concurrency&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;group&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ci-${{ github.ref }}&lt;/span&gt;
  &lt;span class="na"&gt;cancel-in-progress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One warning, because this is a classic mistake: use &lt;code&gt;cancel-in-progress&lt;/code&gt; for build and test jobs, but not for production deploys. Cancelling a deploy halfway through can leave you in a half-updated state. For deploy jobs, set it to &lt;code&gt;false&lt;/code&gt; so runs queue instead.&lt;/p&gt;

&lt;p&gt;Also note that path filters interact with required status checks. If a required check is skipped by a filter, the pull request can get stuck waiting. Plan for that before you make a check mandatory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem 3: One long job instead of parallel jobs
&lt;/h2&gt;

&lt;p&gt;Steps inside a job always run one after another. Jobs run in parallel unless you tell them to wait. So a single job that lints, then tests, then builds is the slowest possible layout.&lt;/p&gt;

&lt;p&gt;Split independent work into separate jobs, and use &lt;code&gt;needs&lt;/code&gt; only where one really depends on another:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;lint&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-24.04&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v5&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm ci &amp;amp;&amp;amp; npm run lint&lt;/span&gt;

  &lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-24.04&lt;/span&gt;
    &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;matrix&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;shard&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v5&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm ci &amp;amp;&amp;amp; npm test -- --shard=${{ matrix.shard }}/3&lt;/span&gt;

  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;needs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;lint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;test&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-24.04&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v5&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm ci &amp;amp;&amp;amp; npm run build&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lint and the three test shards now run at the same time, and the build starts only when all of them pass. The total time becomes the slowest of them, not the sum.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem 4: Docker images rebuilt from scratch
&lt;/h2&gt;

&lt;p&gt;A &lt;code&gt;docker build&lt;/code&gt; on a fresh runner has no layers to reuse, so it reinstalls every package on every run. The &lt;code&gt;docker/build-push-action&lt;/code&gt; can store layers in the GitHub Actions cache:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;docker/setup-buildx-action@v3&lt;/span&gt;

&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;docker/build-push-action@v6&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;.&lt;/span&gt;
    &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ env.IMAGE }}:${{ github.sha }}&lt;/span&gt;
    &lt;span class="na"&gt;cache-from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;type=gha&lt;/span&gt;
    &lt;span class="na"&gt;cache-to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;type=gha,mode=max&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Order your Dockerfile so the layers that change least come first: copy the lock file and install dependencies before you copy the source code. Then a code change reuses the dependency layer instead of rebuilding it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem 5: No timeout, so stuck jobs burn minutes
&lt;/h2&gt;

&lt;p&gt;A test that hangs, or a deploy waiting on a resource that never appears, keeps running until GitHub's default job timeout of 6 hours. On a private repository those are billed minutes, and the run blocks the queue.&lt;/p&gt;

&lt;p&gt;Set a timeout close to how long the job normally takes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-24.04&lt;/span&gt;
    &lt;span class="na"&gt;timeout-minutes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Production with no gate
&lt;/h2&gt;

&lt;p&gt;Speed means nothing if anything can ship to production. A deploy job that runs on any push to any branch is one bad merge away from an outage.&lt;/p&gt;

&lt;p&gt;Put three layers in front of it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Only deploy from main.&lt;/strong&gt; Add a branch condition to the job:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;   &lt;span class="na"&gt;deploy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
     &lt;span class="na"&gt;if&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;github.ref == 'refs/heads/main'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Protect the main branch.&lt;/strong&gt; Require pull requests, passing checks, and at least one review before merging.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use a GitHub Environment for production.&lt;/strong&gt; Environments can require a manual approval before a job runs and can hold secrets that only that job can read.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;   &lt;span class="na"&gt;deploy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
     &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;production&lt;/span&gt;
     &lt;span class="na"&gt;concurrency&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
       &lt;span class="na"&gt;group&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;deploy-production&lt;/span&gt;
       &lt;span class="na"&gt;cancel-in-progress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And if the deploy talks to AWS, authenticate with short-lived OIDC credentials instead of stored access keys. I wrote that up in &lt;a href="https://devopswithumar.com/blog/github-actions-aws-oidc/" rel="noopener noreferrer"&gt;Deploy to AWS from GitHub Actions without access keys&lt;/a&gt;, with a real example in the &lt;a href="https://devopswithumar.com/blog/case-study-github-actions-oidc-startup/" rel="noopener noreferrer"&gt;OIDC case study&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;You have looked at the timing breakdown of a recent run.&lt;/li&gt;
&lt;li&gt;Dependencies are cached and keyed on the lock file, with restore-keys as a fallback.&lt;/li&gt;
&lt;li&gt;Workflows run only when relevant files change.&lt;/li&gt;
&lt;li&gt;Older build runs are cancelled automatically, but deploys are not.&lt;/li&gt;
&lt;li&gt;Independent work runs in parallel jobs; &lt;code&gt;needs&lt;/code&gt; only where it must wait.&lt;/li&gt;
&lt;li&gt;Docker builds use a layer cache, and the Dockerfile installs dependencies before copying code.&lt;/li&gt;
&lt;li&gt;Every job has a &lt;code&gt;timeout-minutes&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Production deploys only from main, behind branch protection and a protected environment.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If a workflow file will not run, paste it into the free &lt;a href="https://devopswithumar.com/tools/yaml-formatter/" rel="noopener noreferrer"&gt;YAML validator&lt;/a&gt; to find the line, and read &lt;a href="https://devopswithumar.com/blog/yaml-mistakes-kubernetes-github-actions/" rel="noopener noreferrer"&gt;3 YAML mistakes that break Kubernetes and GitHub Actions deploys&lt;/a&gt;. Running Terraform from your pipeline? The same caching and gating rules apply, and the CI/CD guides are collected in the &lt;a href="https://devopswithumar.com/blog/topic/cicd/" rel="noopener noreferrer"&gt;CI/CD topic guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you want your pipeline reviewed or rebuilt, see &lt;a href="https://devopswithumar.com/services/cicd-pipelines/" rel="noopener noreferrer"&gt;CI/CD pipeline setup&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why is GitHub Actions so slow?
&lt;/h3&gt;

&lt;p&gt;Usually because every run starts from nothing: it downloads all dependencies, rebuilds Docker images without a layer cache, and runs every job one after another on every push. Caching, path filters, parallel jobs and cancelling stale runs fix most of it.&lt;/p&gt;

&lt;h3&gt;
  
  
  How long does the GitHub Actions cache last?
&lt;/h3&gt;

&lt;p&gt;GitHub removes cache entries that have not been accessed for 7 days. When a repository reaches its cache limit, the least recently used caches are removed first.&lt;/p&gt;

&lt;h3&gt;
  
  
  How big can the GitHub Actions cache be?
&lt;/h3&gt;

&lt;p&gt;By default 10 GB per repository. Usage above that is billed, and the limit can be raised in the repository, organization or enterprise settings.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why is my GitHub Actions cache not being used?
&lt;/h3&gt;

&lt;p&gt;Most often the key changes on every run (for example it includes the commit SHA), the cache was saved on another branch that this run cannot read, or it was evicted after 7 days without use. Key it on the lock file and add restore-keys as a fallback.&lt;/p&gt;

&lt;h3&gt;
  
  
  Should I use cancel-in-progress on deploy jobs?
&lt;/h3&gt;

&lt;p&gt;No. Cancel stale build and test runs, but let deploys finish: a deploy stopped halfway can leave production half-updated. Give deploy jobs their own concurrency group with cancel-in-progress set to false.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/mPJ6AGib4q0" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://devopswithumar.com/blog/github-actions-slow-pipeline/" rel="noopener noreferrer"&gt;DevOps with Umar&lt;/a&gt;. I keep free browser tools for this kind of work there: an &lt;a href="https://devopswithumar.com/tools/aws-cost-calculator/" rel="noopener noreferrer"&gt;AWS savings estimator&lt;/a&gt;, a &lt;a href="https://devopswithumar.com/tools/cron-generator/" rel="noopener noreferrer"&gt;cron expression generator&lt;/a&gt; and more in &lt;a href="https://devopswithumar.com/tools/" rel="noopener noreferrer"&gt;the tools list&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>githubactions</category>
      <category>devops</category>
      <category>cicd</category>
      <category>docker</category>
    </item>
    <item>
      <title>AWS NAT gateway cost: why it is so high and 5 ways to cut it</title>
      <dc:creator>Muhammad Umar</dc:creator>
      <pubDate>Sat, 21 Nov 2026 09:00:00 +0000</pubDate>
      <link>https://dev.to/devopswithumar/aws-nat-gateway-cost-why-it-is-so-high-and-5-ways-to-cut-it-1ge7</link>
      <guid>https://dev.to/devopswithumar/aws-nat-gateway-cost-why-it-is-so-high-and-5-ways-to-cut-it-1ge7</guid>
      <description>&lt;p&gt;In short:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each NAT gateway costs about $33 a month before any traffic, and every GB through it costs another $0.045.&lt;/li&gt;
&lt;li&gt;Gateway endpoints for S3 and DynamoDB are free and take that traffic off the NAT gateway completely.&lt;/li&gt;
&lt;li&gt;Dev and staging rarely need a NAT gateway per availability zone; production usually does, or a regional NAT gateway.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A NAT gateway is one of the most common surprises on a startup's AWS bill. It looks harmless in the VPC diagram, and then Cost Explorer shows &lt;strong&gt;EC2-Other&lt;/strong&gt; or &lt;strong&gt;NatGateway-Bytes&lt;/strong&gt; as one of the top lines. The reason is that you pay twice: &lt;strong&gt;$0.045 per hour for each gateway, plus $0.045 for every GB of data it processes&lt;/strong&gt; (us-east-1 prices, &lt;a href="https://aws.amazon.com/vpc/pricing/" rel="noopener noreferrer"&gt;VPC pricing&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Most of that money is avoidable. In the accounts I review, the biggest share of NAT traffic is usually going to AWS services that the VPC could reach for free. This post shows where NAT cost comes from, how to measure it, and five fixes in order of effort.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a NAT gateway actually costs
&lt;/h2&gt;

&lt;p&gt;Two charges, both in every region where you run one:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Charge&lt;/th&gt;
&lt;th&gt;us-east-1 price&lt;/th&gt;
&lt;th&gt;What it means&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hourly&lt;/td&gt;
&lt;td&gt;$0.045 per gateway hour&lt;/td&gt;
&lt;td&gt;About $32.85 a month per gateway, even with zero traffic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data processing&lt;/td&gt;
&lt;td&gt;$0.045 per GB&lt;/td&gt;
&lt;td&gt;Every GB in or out through the gateway, on top of normal data transfer&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The standard "high availability" layout puts one NAT gateway in each availability zone, so three zones means about $99 a month before a single byte moves. Then the traffic:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Monthly traffic through NAT&lt;/th&gt;
&lt;th&gt;Processing charge&lt;/th&gt;
&lt;th&gt;With 3 gateways&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;100 GB&lt;/td&gt;
&lt;td&gt;$4.50&lt;/td&gt;
&lt;td&gt;about $103 a month&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1 TB&lt;/td&gt;
&lt;td&gt;$46&lt;/td&gt;
&lt;td&gt;about $145 a month&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10 TB&lt;/td&gt;
&lt;td&gt;$461&lt;/td&gt;
&lt;td&gt;about $560 a month&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;And if the traffic leaves AWS for the internet, normal data transfer out is billed as well. A container that pulls a 1 GB image from a public registry 300 times a month moves 300 GB through NAT: about $13.50 in processing alone, before transfer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: find out what goes through your NAT gateways
&lt;/h2&gt;

&lt;p&gt;Do not guess. Start with the bill:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ce get-cost-and-usage \
  --time-period &lt;span class="nv"&gt;Start&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2026-10-01,End=2026-11-01 \
  --granularity MONTHLY --metrics UnblendedCost \
  --filter &lt;span class="s1"&gt;'{"Dimensions":{"Key":"SERVICE","Values":["EC2 - Other"]}}'&lt;/span&gt; \
  --group-by &lt;span class="nv"&gt;Type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;DIMENSION,Key=USAGE_TYPE \
  --query &lt;span class="s1"&gt;'ResultsByTime[].Groups[].[Keys[0],Metrics.UnblendedCost.Amount]'&lt;/span&gt; \
  --output text &lt;span class="o"&gt;|&lt;/span&gt; grep NatGateway
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will see lines like &lt;code&gt;USE1-NatGateway-Hours&lt;/code&gt; and &lt;code&gt;USE1-NatGateway-Bytes&lt;/code&gt;. If &lt;code&gt;Bytes&lt;/code&gt; is bigger than &lt;code&gt;Hours&lt;/code&gt;, traffic is the problem; if &lt;code&gt;Hours&lt;/code&gt; dominates, you have more gateways than you need.&lt;/p&gt;

&lt;p&gt;Then look at each gateway's traffic. This sums the bytes sent to destinations over the last 7 days:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws cloudwatch get-metric-statistics --namespace AWS/NATGateway \
  --metric-name BytesOutToDestination \
  --dimensions &lt;span class="nv"&gt;Name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;NatGatewayId,Value=nat-0abc123def4567890 \
  --start-time &lt;span class="s2"&gt;"$(date -u -d '-7 days' +%Y-%m-%dT%H:%M:%SZ)"&lt;/span&gt; \
  --end-time &lt;span class="s2"&gt;"$(date -u +%Y-%m-%dT%H:%M:%SZ)"&lt;/span&gt; \
  --period 604800 --statistics Sum
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To see &lt;em&gt;where&lt;/em&gt; the traffic goes, turn on VPC Flow Logs for the NAT gateway's network interface for a day or two and group by destination. The usual top destinations are S3, ECR, CloudWatch Logs, Docker Hub or GitHub, and your own services in another VPC.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix 1: free gateway endpoints for S3 and DynamoDB
&lt;/h2&gt;

&lt;p&gt;This is the biggest and safest win. A &lt;strong&gt;gateway VPC endpoint&lt;/strong&gt; for S3 or DynamoDB routes that traffic inside AWS, without the NAT gateway, and it has &lt;strong&gt;no hourly charge and no data charge&lt;/strong&gt; (&lt;a href="https://aws.amazon.com/vpc/pricing/" rel="noopener noreferrer"&gt;VPC pricing&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;In Terraform, one resource per service, attached to your private route tables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="n"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_vpc_endpoint"&lt;/span&gt; &lt;span class="s2"&gt;"s3"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;vpc_id&lt;/span&gt;            &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;aws_vpc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;
  &lt;span class="n"&gt;service_name&lt;/span&gt;      &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"com.amazonaws.${var.region}.s3"&lt;/span&gt;
  &lt;span class="n"&gt;vpc_endpoint_type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Gateway"&lt;/span&gt;
  &lt;span class="n"&gt;route_table_ids&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;aws_route_table&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;private&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_vpc_endpoint"&lt;/span&gt; &lt;span class="s2"&gt;"dynamodb"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;vpc_id&lt;/span&gt;            &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;aws_vpc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;
  &lt;span class="n"&gt;service_name&lt;/span&gt;      &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"com.amazonaws.${var.region}.dynamodb"&lt;/span&gt;
  &lt;span class="n"&gt;vpc_endpoint_type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Gateway"&lt;/span&gt;
  &lt;span class="n"&gt;route_table_ids&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;aws_route_table&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;private&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nothing changes in your code: the SDK still calls the normal S3 endpoint, and the route table sends it through the gateway endpoint. If a bucket policy limits access by source IP, switch it to &lt;code&gt;aws:SourceVpce&lt;/code&gt; first, because traffic through the endpoint no longer comes from the NAT gateway's public IP.&lt;/p&gt;

&lt;p&gt;ECR stores image layers in S3, so the S3 gateway endpoint also removes most of the cost of pulling images from your own ECR repositories.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix 2: interface endpoints for busy AWS services
&lt;/h2&gt;

&lt;p&gt;Other services, such as ECR's API, CloudWatch Logs, STS, Secrets Manager and SQS, need &lt;strong&gt;interface endpoints&lt;/strong&gt;. These are not free: about $0.01 per hour per availability zone (about $7.30 a month per zone) plus $0.01 per GB processed.&lt;/p&gt;

&lt;p&gt;They are worth it when a service moves a lot of data. Compare for one service across 3 zones:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Traffic to the service per month&lt;/th&gt;
&lt;th&gt;Through NAT ($0.045/GB)&lt;/th&gt;
&lt;th&gt;Interface endpoint (3 zones + $0.01/GB)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;50 GB&lt;/td&gt;
&lt;td&gt;$2.25&lt;/td&gt;
&lt;td&gt;$22.40&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;500 GB&lt;/td&gt;
&lt;td&gt;$22.50&lt;/td&gt;
&lt;td&gt;$26.90&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2 TB&lt;/td&gt;
&lt;td&gt;$92&lt;/td&gt;
&lt;td&gt;$42&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;So: add interface endpoints for the services that carry hundreds of GB a month (often CloudWatch Logs and ECR's &lt;code&gt;ecr.api&lt;/code&gt; and &lt;code&gt;ecr.dkr&lt;/code&gt; for clusters that scale a lot), and leave quiet services on NAT. The &lt;a href="https://devopswithumar.com/tools/nat-gateway-cost-calculator/" rel="noopener noreferrer"&gt;NAT gateway cost calculator&lt;/a&gt; does this comparison with your own numbers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix 3: stop pulling the same images and packages from the internet
&lt;/h2&gt;

&lt;p&gt;Every &lt;code&gt;docker pull&lt;/code&gt; from Docker Hub or GitHub Container Registry, every &lt;code&gt;pip install&lt;/code&gt; and &lt;code&gt;npm ci&lt;/code&gt; on a private instance goes through NAT. Common fixes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ECR pull-through cache.&lt;/strong&gt; Point your clusters at ECR, which caches Docker Hub, GitHub and other public images the first time and serves them from your account after that. With the S3 gateway endpoint, repeat pulls stop touching NAT.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bigger, longer-lived nodes.&lt;/strong&gt; Image layers are cached per node. Fifty small nodes that come and go every hour pull far more than ten that stay.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build in CI, not on the server.&lt;/strong&gt; Instances that install packages at boot pay for that download every time they start.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Fix 4: right-size how many NAT gateways you run
&lt;/h2&gt;

&lt;p&gt;One NAT gateway per zone is the right answer for production: if a zone fails, the other zones keep their internet access. It is usually the wrong answer for dev, staging and preview environments.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Environment&lt;/th&gt;
&lt;th&gt;Sensible layout&lt;/th&gt;
&lt;th&gt;Monthly hourly cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Production, 3 zones&lt;/td&gt;
&lt;td&gt;3 zonal NAT gateways, or one regional NAT gateway&lt;/td&gt;
&lt;td&gt;about $99&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Staging&lt;/td&gt;
&lt;td&gt;1 NAT gateway shared by all zones&lt;/td&gt;
&lt;td&gt;about $33&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dev, short-lived previews&lt;/td&gt;
&lt;td&gt;1 NAT gateway, or a NAT instance&lt;/td&gt;
&lt;td&gt;$3 to $33&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;With one shared NAT gateway, traffic from the other zones crosses availability zones to reach it, which adds $0.01 per GB each way. For low-traffic environments that is far less than two extra gateways.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What about the regional NAT gateway?&lt;/strong&gt; Since November 2025, a NAT gateway can be created in &lt;em&gt;regional&lt;/em&gt; mode (&lt;a href="https://aws.amazon.com/about-aws/whats-new/2025/11/aws-nat-gateway-regional-availability" rel="noopener noreferrer"&gt;AWS announcement&lt;/a&gt;). One regional NAT gateway serves every zone in the VPC, needs no public subnet, and expands to new zones on its own (&lt;a href="https://aws.amazon.com/blogs/networking-and-content-delivery/introducing-amazon-vpc-regional-nat-gateway" rel="noopener noreferrer"&gt;AWS blog&lt;/a&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ec2 create-nat-gateway --vpc-id vpc-0abc123def4567890 --availability-mode regional
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is billed per hour &lt;strong&gt;for each zone it runs in&lt;/strong&gt;, at the same rate, plus the same per-GB charge. So it does not cut the bill by itself. What it removes is the work: one gateway ID, one route, no per-zone NAT setup to forget when you add a zone. For new production VPCs it is a good default; for an existing VPC that already works, move to it only when you are touching the network anyway.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix 5: no NAT at all, where you can
&lt;/h2&gt;

&lt;p&gt;Some private workloads do not need the internet:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Lambda function or ECS task that only talks to S3, DynamoDB, SQS and Secrets Manager can use endpoints and skip NAT entirely.&lt;/li&gt;
&lt;li&gt;Databases in private subnets almost never need outbound internet. Give them their own subnets with no route to NAT.&lt;/li&gt;
&lt;li&gt;For tiny dev environments, a &lt;strong&gt;NAT instance&lt;/strong&gt; on a &lt;code&gt;t4g.nano&lt;/code&gt; costs a few dollars a month. The trade-off is real: you patch it, it is a single point of failure, and its bandwidth is small. Never use one for production.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What these fixes save: a real example
&lt;/h2&gt;

&lt;p&gt;A startup with one production VPC across 3 zones and a staging VPC across 3 zones, moving 3 TB a month through NAT. 2 TB of it is S3 and ECR layer traffic.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Item&lt;/th&gt;
&lt;th&gt;Before&lt;/th&gt;
&lt;th&gt;After&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Gateways&lt;/td&gt;
&lt;td&gt;6 ($197)&lt;/td&gt;
&lt;td&gt;4: 3 in production, 1 in staging ($131)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data processed&lt;/td&gt;
&lt;td&gt;3 TB ($138)&lt;/td&gt;
&lt;td&gt;1 TB ($46)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;S3 gateway endpoints&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;td&gt;2 (free)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Monthly NAT cost&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;about $335&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;about $177&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That is about $1,900 a year back, from two free endpoints and one smaller staging layout, with no change to application code.&lt;/p&gt;

&lt;h2&gt;
  
  
  NAT gateway cost checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Check the NAT lines in Cost Explorer: running hours and data processed.&lt;/li&gt;
&lt;li&gt;Look at each gateway's traffic in CloudWatch, and turn on Flow Logs briefly to see destinations.&lt;/li&gt;
&lt;li&gt;Add free gateway endpoints for S3 and DynamoDB to every VPC.&lt;/li&gt;
&lt;li&gt;Add interface endpoints only for services that move hundreds of GB a month.&lt;/li&gt;
&lt;li&gt;Cache container images in ECR instead of pulling from the internet.&lt;/li&gt;
&lt;li&gt;Use one NAT gateway in dev and staging; keep one per zone, or one regional NAT gateway, in production.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If your private subnets also hold leftovers that bill you every hour, see &lt;a href="https://devopswithumar.com/blog/aws-charges-billing-you-for-nothing/" rel="noopener noreferrer"&gt;3 hidden AWS charges&lt;/a&gt;. Planning a new VPC? Get the ranges right first with &lt;a href="https://devopswithumar.com/blog/vpc-cidr-subnet-planning/" rel="noopener noreferrer"&gt;the VPC CIDR planning guide&lt;/a&gt;. For a full review of your network and bill, see the &lt;a href="https://devopswithumar.com/services/aws-cost-optimization/" rel="noopener noreferrer"&gt;AWS cost optimization service&lt;/a&gt; or start with a &lt;a href="https://devopswithumar.com/checkup/" rel="noopener noreferrer"&gt;Free AWS Review&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Prices are from the &lt;a href="https://aws.amazon.com/vpc/pricing/" rel="noopener noreferrer"&gt;Amazon VPC pricing page&lt;/a&gt; and PrivateLink pricing for us-east-1, checked in November 2026. Other regions are slightly different.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why is my NAT gateway so expensive?
&lt;/h3&gt;

&lt;p&gt;You pay twice: $0.045 per hour for each gateway (about $33 a month) and $0.045 for every GB it processes. Most of the surprise comes from the per-GB part, usually from S3, ECR image pulls or logs going through the NAT gateway when they could use VPC endpoints.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is a regional NAT gateway cheaper?
&lt;/h3&gt;

&lt;p&gt;Not by itself. A regional NAT gateway is billed per hour for each availability zone it runs in, at the same rate as a zonal one, plus the same per-GB charge. Its value is simpler setup and automatic expansion to new zones, not a lower price.&lt;/p&gt;

&lt;h3&gt;
  
  
  Are S3 gateway endpoints really free?
&lt;/h3&gt;

&lt;p&gt;Yes. Gateway VPC endpoints for S3 and DynamoDB have no hourly charge and no data processing charge. Interface endpoints for other services do cost money.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I run without a NAT gateway?
&lt;/h3&gt;

&lt;p&gt;Sometimes. If private workloads only talk to AWS services that have VPC endpoints, you can skip NAT entirely. For small dev environments, a NAT instance is cheaper but you manage and patch it yourself.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do I see how much traffic goes through my NAT gateway?
&lt;/h3&gt;

&lt;p&gt;Look at the BytesOutToDestination and BytesInFromDestination metrics in CloudWatch, or the NatGateway-Bytes usage type in Cost Explorer. VPC Flow Logs show which destinations the traffic goes to.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://devopswithumar.com/blog/nat-gateway-cost/" rel="noopener noreferrer"&gt;DevOps with Umar&lt;/a&gt;. Free tool for this: the &lt;a href="https://devopswithumar.com/tools/nat-gateway-cost-calculator/" rel="noopener noreferrer"&gt;NAT gateway cost calculator&lt;/a&gt;. More in &lt;a href="https://devopswithumar.com/tools/" rel="noopener noreferrer"&gt;the tools list&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>cloud</category>
      <category>finops</category>
    </item>
    <item>
      <title>EKS extended support: the 6x control plane bill and how to avoid it</title>
      <dc:creator>Muhammad Umar</dc:creator>
      <pubDate>Thu, 19 Nov 2026 09:00:00 +0000</pubDate>
      <link>https://dev.to/devopswithumar/eks-extended-support-the-6x-control-plane-bill-and-how-to-avoid-it-1f44</link>
      <guid>https://dev.to/devopswithumar/eks-extended-support-the-6x-control-plane-bill-and-how-to-avoid-it-1f44</guid>
      <description>&lt;p&gt;In short:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An EKS cluster on standard support costs $0.10 an hour (about $73 a month). On extended support it costs $0.60 an hour (about $438 a month).&lt;/li&gt;
&lt;li&gt;Kubernetes 1.34 leaves standard support on 2 December 2026, and 1.33 already moved to extended support on 29 July 2026.&lt;/li&gt;
&lt;li&gt;Set the upgrade policy to STANDARD on every cluster so an old version can never quietly start billing at the higher rate.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;EKS extended support has a simple price: &lt;strong&gt;$0.60 per cluster per hour instead of $0.10.&lt;/strong&gt; That is about $438 a month for each cluster's control plane instead of about $73, six times more, for running a Kubernetes version that is more than 14 months old. Nothing about the cluster gets better. You are paying AWS to keep patching an old version for you.&lt;/p&gt;

&lt;p&gt;This matters right now. Kubernetes 1.33 moved to extended support on 29 July 2026, and &lt;strong&gt;1.34 follows on 2 December 2026&lt;/strong&gt;. If your startup created an EKS cluster in late 2025 and never upgraded it, it is about to cost six times more for the same thing.&lt;/p&gt;

&lt;p&gt;This post shows how to find every cluster and its support status, stop the higher rate from ever starting by surprise, and upgrade with a plan you can repeat every few months.&lt;/p&gt;

&lt;h2&gt;
  
  
  How EKS support and pricing work
&lt;/h2&gt;

&lt;p&gt;Every Kubernetes version on EKS goes through two phases (&lt;a href="https://aws.amazon.com/blogs/containers/amazon-eks-extended-support-for-kubernetes-versions-pricing" rel="noopener noreferrer"&gt;AWS pricing post&lt;/a&gt;):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Phase&lt;/th&gt;
&lt;th&gt;How long&lt;/th&gt;
&lt;th&gt;Control plane price&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Standard support&lt;/td&gt;
&lt;td&gt;14 months after the version is released on EKS&lt;/td&gt;
&lt;td&gt;$0.10 per cluster hour&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Extended support&lt;/td&gt;
&lt;td&gt;12 more months&lt;/td&gt;
&lt;td&gt;$0.60 per cluster hour&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;End of extended support&lt;/td&gt;
&lt;td&gt;after 26 months&lt;/td&gt;
&lt;td&gt;AWS upgrades the cluster for you&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The charge is per cluster, not per node. A small startup with a production cluster, a staging cluster and a dev cluster on an old version pays about $1,095 a month more than it needs to. That is $13,000 a year for doing nothing.&lt;/p&gt;

&lt;p&gt;Your worker nodes, Fargate pods, load balancers and EBS volumes are billed exactly the same in both phases. Only the control plane line changes, which is why it is easy to miss in Cost Explorer.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 2026 calendar
&lt;/h2&gt;

&lt;p&gt;These are the dates that matter for clusters running today (&lt;a href="https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html" rel="noopener noreferrer"&gt;EKS version lifecycle&lt;/a&gt;, mirrored on &lt;a href="https://endoflife.date/amazon-eks" rel="noopener noreferrer"&gt;endoflife.date&lt;/a&gt;):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Version&lt;/th&gt;
&lt;th&gt;End of standard support&lt;/th&gt;
&lt;th&gt;End of extended support&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1.32&lt;/td&gt;
&lt;td&gt;23 March 2026 (already on extended)&lt;/td&gt;
&lt;td&gt;23 March 2027&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.33&lt;/td&gt;
&lt;td&gt;29 July 2026 (already on extended)&lt;/td&gt;
&lt;td&gt;29 July 2027&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.34&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;2 December 2026&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2 December 2027&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.35&lt;/td&gt;
&lt;td&gt;27 March 2027&lt;/td&gt;
&lt;td&gt;27 March 2028&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.36&lt;/td&gt;
&lt;td&gt;2 August 2027&lt;/td&gt;
&lt;td&gt;2 August 2028&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.37&lt;/td&gt;
&lt;td&gt;1 December 2027&lt;/td&gt;
&lt;td&gt;1 December 2028&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If you are on 1.32 or 1.33 today, you are already paying $0.60. If you are on 1.34, you have a few weeks. The safest target for an upgrade now is 1.35 or 1.36: both stay in standard support well into 2027.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: find every cluster, its version and its support type
&lt;/h2&gt;

&lt;p&gt;Clusters live in regions, so check all of them. This prints each cluster with its region, version and upgrade policy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; r &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;$(&lt;/span&gt;aws ec2 describe-regions --query &lt;span class="s1"&gt;'Regions[].RegionName'&lt;/span&gt; --output text&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; c &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;$(&lt;/span&gt;aws eks list-clusters --region &lt;span class="s2"&gt;"$r"&lt;/span&gt; --query &lt;span class="s1"&gt;'clusters[]'&lt;/span&gt; --output text&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    aws eks describe-cluster --region &lt;span class="s2"&gt;"$r"&lt;/span&gt; --name &lt;span class="s2"&gt;"$c"&lt;/span&gt; \
      --query &lt;span class="s1"&gt;'[cluster.name, cluster.version, cluster.upgradePolicy.supportType]'&lt;/span&gt; \
      --output text &lt;span class="o"&gt;|&lt;/span&gt; sed &lt;span class="s2"&gt;"s/^/$r /"&lt;/span&gt;
  &lt;span class="k"&gt;done&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;us-east-1 prod-api 1.33 EXTENDED
us-east-1 staging 1.34 EXTENDED
eu-west-1 dev 1.35 STANDARD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;EXTENDED&lt;/code&gt; here means the cluster is allowed to go into extended support when its version gets old. It does not always mean it is paying the higher rate yet. Compare the version with the table above: &lt;code&gt;prod-api&lt;/code&gt; on 1.33 is paying $0.60 today, and &lt;code&gt;staging&lt;/code&gt; on 1.34 will start on 2 December.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: make sure no cluster can drift into extended support
&lt;/h2&gt;

&lt;p&gt;Each cluster has an upgrade policy. The default lets a cluster move into extended support and the higher price. Setting it to &lt;code&gt;STANDARD&lt;/code&gt; turns that off (&lt;a href="https://docs.aws.amazon.com/eks/latest/userguide/disable-extended-support.html" rel="noopener noreferrer"&gt;AWS docs&lt;/a&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws eks update-cluster-config --name staging --upgrade-policy &lt;span class="nv"&gt;supportType&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;STANDARD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With &lt;code&gt;STANDARD&lt;/code&gt; set, a cluster that reaches the end of standard support is upgraded to the next version by AWS instead of being billed at $0.60. Two things to know before you rely on that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;You can only set it while the cluster is still on standard support.&lt;/strong&gt; For a cluster already on extended support, the only way back to $0.10 is to upgrade it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An automatic upgrade happens on AWS's timing, not yours.&lt;/strong&gt; It is a safety net against the bill, not an upgrade plan. Your workloads should already have been tested on the next version.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In Terraform, set it on the cluster resource so new clusters get it from day one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="n"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_eks_cluster"&lt;/span&gt; &lt;span class="s2"&gt;"main"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;name&lt;/span&gt;     &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"prod-api"&lt;/span&gt;
  &lt;span class="n"&gt;role_arn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;aws_iam_role&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cluster&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;arn&lt;/span&gt;
  &lt;span class="n"&gt;version&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"1.35"&lt;/span&gt;

  &lt;span class="n"&gt;vpc_config&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;subnet_ids&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;private_subnet_ids&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="n"&gt;upgrade_policy&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;support_type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"STANDARD"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;upgrade_policy&lt;/code&gt; block needs a recent AWS provider (it arrived in the 5.x series). Run &lt;code&gt;terraform plan&lt;/code&gt; and check it shows &lt;strong&gt;update in-place&lt;/strong&gt;, not a replacement of the cluster.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: check what will break before you upgrade
&lt;/h2&gt;

&lt;p&gt;Most failed EKS upgrades are caused by something inside the cluster still using an API that the next version removed. EKS checks this for you with &lt;strong&gt;upgrade insights&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws eks list-insights --cluster-name prod-api \
  --query &lt;span class="s1"&gt;'insights[].[name,insightStatus.status]'&lt;/span&gt; --output table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Any insight that is not &lt;code&gt;PASSING&lt;/code&gt; needs work before the upgrade. To see details, including which clients called a deprecated API recently:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws eks describe-insight --cluster-name prod-api --id &lt;span class="s2"&gt;"$INSIGHT_ID"&lt;/span&gt;  &lt;span class="c"&gt;# an id from list-insights&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also check these, in this order:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Add-ons.&lt;/strong&gt; VPC CNI, CoreDNS, kube-proxy and the EBS CSI driver each have versions tied to the Kubernetes version. List the supported versions with &lt;code&gt;aws eks describe-addon-versions --kubernetes-version 1.35 --addon-name vpc-cni&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Helm charts you installed yourself.&lt;/strong&gt; Ingress controllers, cert-manager, the AWS Load Balancer Controller and autoscalers like Karpenter all have a supported Kubernetes range in their release notes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node AMIs.&lt;/strong&gt; Managed node groups need an AMI for the new version. Amazon Linux 2 AMIs stopped at 1.32, so newer versions mean Amazon Linux 2023 or Bottlerocket nodes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 4: upgrade one minor version at a time
&lt;/h2&gt;

&lt;p&gt;EKS only moves the control plane up one minor version per upgrade. Going from 1.33 to 1.35 is two rounds of this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Control plane (takes roughly 10 to 20 minutes, the API stays available)&lt;/span&gt;
aws eks update-cluster-version --name prod-api --kubernetes-version 1.34
aws eks &lt;span class="nb"&gt;wait&lt;/span&gt; cluster-active --name prod-api

&lt;span class="c"&gt;# 2. Add-ons, to the version that matches 1.34 (ADDON_VERSION from describe-addon-versions)&lt;/span&gt;
aws eks update-addon --cluster-name prod-api --addon-name vpc-cni \
  --addon-version &lt;span class="s2"&gt;"$ADDON_VERSION"&lt;/span&gt; --resolve-conflicts PRESERVE

&lt;span class="c"&gt;# 3. Managed node groups (nodes are replaced with a rolling update)&lt;/span&gt;
aws eks update-nodegroup-version --cluster-name prod-api --nodegroup-name default
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Repeat for the next version. If Terraform manages the cluster, change &lt;code&gt;version&lt;/code&gt; in Terraform instead, one step at a time, so the code and the cluster never disagree.&lt;/p&gt;

&lt;p&gt;Three habits keep this boring:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Upgrade staging first&lt;/strong&gt; and leave it on the new version for a few days of normal traffic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check PodDisruptionBudgets&lt;/strong&gt; before the node group update. A PDB that allows zero disruptions blocks the rolling update until it times out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep a note of what you did.&lt;/strong&gt; You will do this again in about a year, and next time it takes half the time.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What the upgrade is worth
&lt;/h2&gt;

&lt;p&gt;For one cluster that is already on extended support:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Support&lt;/th&gt;
&lt;th&gt;Hourly&lt;/th&gt;
&lt;th&gt;Monthly (730 hours)&lt;/th&gt;
&lt;th&gt;Yearly&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Extended support&lt;/td&gt;
&lt;td&gt;$0.60&lt;/td&gt;
&lt;td&gt;$438&lt;/td&gt;
&lt;td&gt;$5,256&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Standard support&lt;/td&gt;
&lt;td&gt;$0.10&lt;/td&gt;
&lt;td&gt;$73&lt;/td&gt;
&lt;td&gt;$876&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Saving&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;$0.50&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$365&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$4,380&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For three clusters, that is over $13,000 a year back, for roughly a day of planned work per cluster. Few cost fixes on AWS pay back faster. If you want to see the dates and cost for your own versions, the &lt;a href="https://devopswithumar.com/tools/eks-version-support-checker/" rel="noopener noreferrer"&gt;EKS version support checker&lt;/a&gt; does the maths.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stay out of extended support for good
&lt;/h2&gt;

&lt;p&gt;The calendar repeats: a new Kubernetes version arrives on EKS about every four months, and each one leaves standard support 14 months later. A simple routine keeps you ahead:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Every cluster has &lt;code&gt;supportType=STANDARD&lt;/code&gt;.&lt;/strong&gt; Put it in your Terraform module so new clusters get it automatically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Two upgrades a year.&lt;/strong&gt; Pick two dates, for example March and September, and move every cluster to the newest version that has been on EKS for at least a month.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A calendar reminder 60 days before each end-of-standard-support date&lt;/strong&gt; for the versions you run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A budget alert on EKS.&lt;/strong&gt; A jump from $73 to $438 per cluster is easy to spot if something is watching. See &lt;a href="https://devopswithumar.com/blog/aws-monitoring-alerts-before-customers/" rel="noopener noreferrer"&gt;how to set up alerts that reach a person&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  EKS extended support checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;List every cluster in every region with its version and upgrade policy.&lt;/li&gt;
&lt;li&gt;Compare each version with the calendar and note which ones pay $0.60 now or soon.&lt;/li&gt;
&lt;li&gt;Set &lt;code&gt;supportType=STANDARD&lt;/code&gt; on every cluster still on standard support.&lt;/li&gt;
&lt;li&gt;Run upgrade insights and fix anything not passing.&lt;/li&gt;
&lt;li&gt;Upgrade staging one minor version at a time: control plane, add-ons, then nodes.&lt;/li&gt;
&lt;li&gt;Repeat on production, and put the upgrade policy in your Terraform module.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Running pods that restart for no clear reason after an upgrade? Start with &lt;a href="https://devopswithumar.com/blog/kubernetes-mistakes-crash-pods/" rel="noopener noreferrer"&gt;3 Kubernetes mistakes that crash your pods&lt;/a&gt;. If you would rather have someone plan and run the upgrade with you, the &lt;a href="https://devopswithumar.com/services/kubernetes-eks/" rel="noopener noreferrer"&gt;EKS setup and upgrade service&lt;/a&gt; covers it, or start with a &lt;a href="https://devopswithumar.com/checkup/" rel="noopener noreferrer"&gt;Free AWS Review&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Prices are from the &lt;a href="https://aws.amazon.com/blogs/containers/amazon-eks-extended-support-for-kubernetes-versions-pricing" rel="noopener noreferrer"&gt;Amazon EKS extended support pricing post&lt;/a&gt; and dates from the &lt;a href="https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html" rel="noopener noreferrer"&gt;EKS Kubernetes version lifecycle&lt;/a&gt;, checked in November 2026.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How much does EKS extended support cost?
&lt;/h3&gt;

&lt;p&gt;$0.60 per cluster per hour, against $0.10 on standard support. That is about $438 a month per cluster instead of about $73. Worker nodes, Fargate and EBS are billed the same either way.&lt;/p&gt;

&lt;h3&gt;
  
  
  When does Kubernetes 1.34 leave standard support on EKS?
&lt;/h3&gt;

&lt;p&gt;On 2 December 2026. From that day a 1.34 cluster bills at the extended support rate unless you upgrade it or its upgrade policy is set to STANDARD.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I turn off extended support for a cluster that is already on it?
&lt;/h3&gt;

&lt;p&gt;No. You can only change the upgrade policy while the cluster is still on standard support. A cluster already on extended support goes back to $0.10 an hour once you upgrade it to a version in standard support.&lt;/p&gt;

&lt;h3&gt;
  
  
  What happens if I set the upgrade policy to STANDARD and forget to upgrade?
&lt;/h3&gt;

&lt;p&gt;AWS upgrades the control plane to the next Kubernetes version when standard support ends. That avoids the extra charge, but your workloads meet a new version on AWS's schedule instead of yours, so plan the upgrade before that date.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do I have to upgrade one version at a time?
&lt;/h3&gt;

&lt;p&gt;Yes. EKS upgrades the control plane one minor version at a time, so 1.32 to 1.35 means three upgrades. Nodes and add-ons should follow each step.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://devopswithumar.com/blog/eks-extended-support-cost/" rel="noopener noreferrer"&gt;DevOps with Umar&lt;/a&gt;. Free tool for this: the &lt;a href="https://devopswithumar.com/tools/eks-version-support-checker/" rel="noopener noreferrer"&gt;EKS version support checker&lt;/a&gt;. More in &lt;a href="https://devopswithumar.com/tools/" rel="noopener noreferrer"&gt;the tools list&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>kubernetes</category>
      <category>devops</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Does AWS charge for stopped instances? 3 hidden charges</title>
      <dc:creator>Muhammad Umar</dc:creator>
      <pubDate>Tue, 17 Nov 2026 09:00:00 +0000</pubDate>
      <link>https://dev.to/devopswithumar/does-aws-charge-for-stopped-instances-3-hidden-charges-33g2</link>
      <guid>https://dev.to/devopswithumar/does-aws-charge-for-stopped-instances-3-hidden-charges-33g2</guid>
      <description>&lt;p&gt;In short:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unattached EBS volumes bill every month until you delete them. Snapshot anything you are unsure about, then delete.&lt;/li&gt;
&lt;li&gt;AWS charges for every public IPv4 address, about $3.60 a month each. Release the ones nothing uses.&lt;/li&gt;
&lt;li&gt;A stopped EC2 instance still pays for its disks. Schedule dev servers to stop, and terminate what you no longer need.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Does AWS charge for stopped instances? Not for the compute, but yes for the disks and IP addresses attached to them. Most AWS bills have a few lines like that, paying for nothing at all. No traffic, no users, no running code. They are leftovers: a disk from a server someone deleted, an IP address from a test, an instance that was stopped "for now" months ago.&lt;/p&gt;

&lt;p&gt;None of these show up as errors. They just sit on the invoice. Here are the three I find most often, the AWS CLI commands to find them, and how to remove them without breaking anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a stopped instance still costs
&lt;/h2&gt;

&lt;p&gt;AWS is clear about it: a stopped instance is not charged for usage or data transfer, but "charges are incurred for the storage of any Amazon EBS volumes" (&lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html" rel="noopener noreferrer"&gt;EC2 instance lifecycle&lt;/a&gt;). A typical forgotten test server in us-east-1:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Part&lt;/th&gt;
&lt;th&gt;While running&lt;/th&gt;
&lt;th&gt;While stopped&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;t3.medium compute&lt;/td&gt;
&lt;td&gt;about $30 a month&lt;/td&gt;
&lt;td&gt;$0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;30 GiB gp3 root volume&lt;/td&gt;
&lt;td&gt;$2.40 a month&lt;/td&gt;
&lt;td&gt;$2.40 a month&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;100 GiB gp2 data volume&lt;/td&gt;
&lt;td&gt;$10 a month&lt;/td&gt;
&lt;td&gt;$10 a month&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Elastic IP&lt;/td&gt;
&lt;td&gt;$3.60 a month&lt;/td&gt;
&lt;td&gt;$3.60 a month&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Total&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;about $46&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$16 for nothing&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Ten of those across a few accounts is $160 a month, or close to $2,000 a year, for servers nobody uses. Storage at $0.08 (gp3) and $0.10 (gp2) per GB-month is from the &lt;a href="https://aws.amazon.com/ebs/pricing/" rel="noopener noreferrer"&gt;EBS pricing page&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Unattached EBS volumes
&lt;/h2&gt;

&lt;p&gt;When you terminate an EC2 instance, its root volume is usually deleted with it. But any extra volume you attached later is not. Its "delete on termination" setting is off by default, so the disk stays behind and keeps billing you every month, for every gigabyte.&lt;/p&gt;

&lt;p&gt;Find every volume that is not attached to anything:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ec2 describe-volumes \
  --filters &lt;span class="nv"&gt;Name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;status,Values=available \
  --query &lt;span class="s1"&gt;'Volumes[].[VolumeId,Size,CreateTime]'&lt;/span&gt; \
  --output table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A status of &lt;code&gt;available&lt;/code&gt; means the volume exists but no instance is using it. Before you delete one, take a snapshot. Snapshots are much cheaper than the volume, and they let you restore it if someone turns out to need the data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ec2 create-snapshot --volume-id vol-0abc123 --description &lt;span class="s2"&gt;"before delete"&lt;/span&gt;
aws ec2 delete-volume --volume-id vol-0abc123
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While you are looking at volumes, check for old &lt;code&gt;gp2&lt;/code&gt; volumes too. Moving them to &lt;code&gt;gp3&lt;/code&gt; is 20% cheaper per gigabyte and needs no downtime: see &lt;a href="https://devopswithumar.com/blog/gp2-vs-gp3-ebs/" rel="noopener noreferrer"&gt;gp2 vs gp3&lt;/a&gt; for the commands.&lt;/p&gt;

&lt;h2&gt;
  
  
  Idle public IP addresses
&lt;/h2&gt;

&lt;p&gt;Since 1 February 2024, AWS charges $0.005 per hour for every public IPv4 address, which is roughly $3.60 a month each, "whether attached to a service or not" (&lt;a href="https://aws.amazon.com/blogs/aws/new-aws-public-ipv4-address-charge-public-ip-insights/" rel="noopener noreferrer"&gt;AWS announcement&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The easiest ones to remove are Elastic IPs that are not attached to anything at all:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ec2 describe-addresses \
  --query &lt;span class="s1"&gt;'Addresses[?AssociationId==null].[PublicIp,AllocationId]'&lt;/span&gt; \
  --output table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If nothing should use an address, release it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ec2 release-address --allocation-id eipalloc-0abc123
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Be careful with addresses that are written into DNS records, firewall rules or a partner's allowlist. Once released, you will not get the same IP back. Check where it is used first.&lt;/p&gt;

&lt;p&gt;To see how much you pay for public IPs overall, open Cost Explorer, filter by the service "Amazon Virtual Private Cloud" and group by usage type. Idle and in-use public IPv4 addresses show up as separate lines.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does AWS charge for stopped instances?
&lt;/h2&gt;

&lt;p&gt;Stopping an EC2 instance stops the compute charge. It does not stop the storage charge. Every EBS volume attached to a stopped instance keeps billing, and so does an Elastic IP that stays associated with it. An auto-assigned public IP is released on stop (and the instance gets a new one when it starts), so that one stops costing.&lt;/p&gt;

&lt;p&gt;List what is stopped:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ec2 describe-instances \
  --filters &lt;span class="nv"&gt;Name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;instance-state-name,Values=stopped \
  --query &lt;span class="s1"&gt;'Reservations[].Instances[].[InstanceId,LaunchTime,Tags[?Key==`Name`]|[0].Value]'&lt;/span&gt; \
  --output table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For each one, decide which of these it is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Not needed any more.&lt;/strong&gt; Take a snapshot or create an AMI if you might want it back, then terminate it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A dev or test server.&lt;/strong&gt; Keep it, but stop it on a schedule. A server that runs 50 hours a week instead of 168 costs about 70% less on compute.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Production that was stopped by mistake.&lt;/strong&gt; Find out why before you touch it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Bonus: old snapshots and AMIs
&lt;/h2&gt;

&lt;p&gt;Snapshots are cheaper than volumes, about $0.05 per GB-month for standard snapshots, but they never expire on their own. Accounts that snapshot "just in case" for years pay for every one of them, and an AMI keeps its snapshots alive until you deregister it.&lt;/p&gt;

&lt;p&gt;List your own snapshots, oldest first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ec2 describe-snapshots --owner-ids self \
  --query &lt;span class="s1"&gt;'sort_by(Snapshots,&amp;amp;StartTime)[].[SnapshotId,VolumeSize,StartTime,Description]'&lt;/span&gt; \
  --output table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep the ones a backup policy needs, deregister AMIs nobody launches, and use Amazon Data Lifecycle Manager or AWS Backup so new snapshots expire on a schedule.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check every region
&lt;/h2&gt;

&lt;p&gt;All three commands only look at the region your CLI is set to. Leftovers love regions nobody looks at, usually the one someone used for a quick test. Loop over every region:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; r &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;$(&lt;/span&gt;aws ec2 describe-regions --query &lt;span class="s1"&gt;'Regions[].RegionName'&lt;/span&gt; --output text&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"== $r"&lt;/span&gt;
  aws ec2 describe-volumes --region &lt;span class="s2"&gt;"$r"&lt;/span&gt; \
    --filters &lt;span class="nv"&gt;Name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;status,Values=available \
    --query &lt;span class="s1"&gt;'Volumes[].[VolumeId,Size]'&lt;/span&gt; --output text
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Swap in the other two commands the same way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop new leftovers from appearing
&lt;/h2&gt;

&lt;p&gt;Cleaning up once is good. Not creating the mess again is better:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Manage infrastructure with Terraform.&lt;/strong&gt; When a resource is removed from code, &lt;code&gt;terraform apply&lt;/code&gt; removes it from AWS, including the volume and the IP.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tag everything with an owner.&lt;/strong&gt; An untagged volume nobody recognises is the hardest thing to delete with confidence.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set a monthly budget with an 80% alert&lt;/strong&gt; so a growing bill reaches you before the invoice does.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For more savings beyond these three, such as lifecycle rules for old S3 data and Cost Anomaly Detection, read &lt;a href="https://devopswithumar.com/blog/cut-your-aws-bill-quick-wins/" rel="noopener noreferrer"&gt;3 quick ways to cut your AWS bill without breaking anything&lt;/a&gt;, or work through the free &lt;a href="https://devopswithumar.com/aws-cost-checklist/" rel="noopener noreferrer"&gt;AWS cost checklist&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Want a rough number first? The free &lt;a href="https://devopswithumar.com/tools/aws-cost-calculator/" rel="noopener noreferrer"&gt;AWS savings estimator&lt;/a&gt; turns what you find into a monthly saving range.&lt;/p&gt;

&lt;p&gt;If you would like someone to go through your account and show you exactly where the money goes, my &lt;a href="https://devopswithumar.com/checkup/" rel="noopener noreferrer"&gt;Free AWS Review&lt;/a&gt; covers cost as well as security.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Does AWS charge for stopped EC2 instances?
&lt;/h3&gt;

&lt;p&gt;Not for compute or data transfer. You still pay for every EBS volume attached to the instance, and for any Elastic IP that stays associated with it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does a stopped instance keep its public IP address?
&lt;/h3&gt;

&lt;p&gt;An auto-assigned public IPv4 address is released when the instance stops, and it gets a new one on start. An Elastic IP stays associated, and keeps costing $0.005 an hour.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is it cheaper to stop or terminate an EC2 instance?
&lt;/h3&gt;

&lt;p&gt;Terminating is cheaper: a stopped instance still pays for its disks. If you might need it again, create an AMI or a snapshot, then terminate. Snapshots cost about half as much per GB as gp2 storage.&lt;/p&gt;

&lt;h3&gt;
  
  
  How much does an unused Elastic IP cost?
&lt;/h3&gt;

&lt;p&gt;$0.005 per hour, about $3.60 a month. Since February 2024 AWS charges the same rate for every public IPv4 address, in use or not.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do I pay for a stopped RDS database?
&lt;/h3&gt;

&lt;p&gt;Yes for its storage and backups, not for the instance hours. AWS also starts a stopped RDS instance again automatically after seven days, so stopping is not a way to park a database for good.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/-nwwa0VE3FM" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://devopswithumar.com/blog/aws-charges-billing-you-for-nothing/" rel="noopener noreferrer"&gt;DevOps with Umar&lt;/a&gt;. I keep free browser tools for this kind of work there: an &lt;a href="https://devopswithumar.com/tools/aws-cost-calculator/" rel="noopener noreferrer"&gt;AWS savings estimator&lt;/a&gt;, a &lt;a href="https://devopswithumar.com/tools/cron-generator/" rel="noopener noreferrer"&gt;cron expression generator&lt;/a&gt; and more in &lt;a href="https://devopswithumar.com/tools/" rel="noopener noreferrer"&gt;the tools list&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>finops</category>
      <category>devops</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Case study: ECS Fargate pipeline with Terraform and OIDC</title>
      <dc:creator>Muhammad Umar</dc:creator>
      <pubDate>Sun, 15 Nov 2026 15:16:12 +0000</pubDate>
      <link>https://dev.to/devopswithumar/case-study-ecs-fargate-pipeline-with-terraform-and-oidc-46de</link>
      <guid>https://dev.to/devopswithumar/case-study-ecs-fargate-pipeline-with-terraform-and-oidc-46de</guid>
      <description>&lt;p&gt;In short:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A fixed-price, five-day client project: a container app on AWS, deployed by a pipeline, with all the infrastructure as code.&lt;/li&gt;
&lt;li&gt;Terraform builds the network, load balancer, registry, service and alarms. GitHub Actions deploys every merge to main with OIDC, so no AWS keys are stored.&lt;/li&gt;
&lt;li&gt;Skipping the NAT gateway saves about $32 a month, and one command builds or removes the whole stack.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This was a fixed-price, five-day client project: a container app on AWS, deployed by a pipeline, with the infrastructure written as code. I am keeping the client private, and the repository is private too, so there is no link to it.&lt;/p&gt;

&lt;p&gt;The diagram above is the handover map. This post explains what is in it and why.&lt;/p&gt;

&lt;h2&gt;
  
  
  What was built
&lt;/h2&gt;

&lt;p&gt;A small Node.js API runs as a container on AWS ECS Fargate behind an application load balancer. Everything in AWS is created by Terraform, and every merge to &lt;code&gt;main&lt;/code&gt; deploys through GitHub Actions. The pieces are:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Piece&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Network&lt;/td&gt;
&lt;td&gt;A VPC (10.20.0.0/16) with two public subnets in two availability zones and an internet gateway&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Load balancer&lt;/td&gt;
&lt;td&gt;An application load balancer with a health check on &lt;code&gt;/health&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Registry&lt;/td&gt;
&lt;td&gt;An Amazon ECR repository with immutable image tags and scan on push&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Service&lt;/td&gt;
&lt;td&gt;An ECS Fargate service, 256 CPU units and 512 MiB of memory per task&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pipeline&lt;/td&gt;
&lt;td&gt;GitHub Actions: test, build, push, deploy, and wait until the service is stable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Access&lt;/td&gt;
&lt;td&gt;An IAM deploy role that GitHub assumes with OIDC, no stored keys&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Monitoring&lt;/td&gt;
&lt;td&gt;CloudWatch logs kept 14 days, one dashboard and three alarms, with an SNS topic for email&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;State&lt;/td&gt;
&lt;td&gt;Terraform state in S3 with KMS encryption, versioning and native locking&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The Terraform code is split into modules (&lt;code&gt;network&lt;/code&gt;, &lt;code&gt;alb&lt;/code&gt;, &lt;code&gt;ecr&lt;/code&gt;, &lt;code&gt;ecs&lt;/code&gt;, &lt;code&gt;github_oidc&lt;/code&gt;, &lt;code&gt;monitoring&lt;/code&gt;) and one environment folder that wires them together. Every value lives in a &lt;code&gt;terraform.tfvars&lt;/code&gt; file and no variable has a default, so nothing is hidden in the modules.&lt;/p&gt;

&lt;h2&gt;
  
  
  How a deploy works
&lt;/h2&gt;

&lt;p&gt;A pull request runs the unit tests and nothing else. A merge to &lt;code&gt;main&lt;/code&gt; runs the tests again, builds the Docker image, pushes it to ECR tagged with the commit SHA, registers a new task definition and updates the ECS service. The job waits until the service is stable, so a green run means the new version is serving traffic.&lt;/p&gt;

&lt;p&gt;In a live test of the pipeline, a full run from merge to a stable service took 2 minutes 47 seconds, and the page showed the new version number straight after.&lt;/p&gt;

&lt;p&gt;Two details make this safe to leave running:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Rollback is automatic.&lt;/strong&gt; The service uses the ECS deployment circuit breaker with rollback, so a version that fails its health checks is rolled back instead of taking the app down. See the AWS description of the &lt;a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeploymentCircuitBreaker.html" rel="noopener noreferrer"&gt;deployment circuit breaker&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Images cannot be overwritten.&lt;/strong&gt; ECR tags are immutable, and each image is tagged with its commit SHA, so you can always tell which code is running and go back to any earlier build.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  No stored AWS keys
&lt;/h2&gt;

&lt;p&gt;The pipeline signs in to AWS with OIDC. GitHub issues a short-lived token for each run, and AWS exchanges it for temporary credentials. The only repository variable is the role ARN, which is not a secret.&lt;/p&gt;

&lt;p&gt;The role trusts one repository, the &lt;code&gt;main&lt;/code&gt; branch and the &lt;code&gt;deploy.yml&lt;/code&gt; workflow. It can push to one ECR repository and update one ECS service, nothing else. GitHub changed the format of the token subject for newer repositories, so the trust policy accepts both the plain and the numeric form, and it works whichever the repository uses. The full pattern is in &lt;a href="https://devopswithumar.com/blog/github-actions-aws-oidc/" rel="noopener noreferrer"&gt;Deploy to AWS from GitHub Actions without access keys&lt;/a&gt;, and the GitHub side is described in &lt;a href="https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services" rel="noopener noreferrer"&gt;Configuring OpenID Connect in Amazon Web Services&lt;/a&gt;. A different team's move from keys to OIDC is in &lt;a href="https://devopswithumar.com/blog/case-study-github-actions-oidc-startup/" rel="noopener noreferrer"&gt;this case study&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Design choices worth explaining
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;No NAT gateway.&lt;/strong&gt; The tasks run in public subnets with a public IP so they can pull images from ECR and write logs. That saves about $32 a month compared with a NAT gateway. The tasks are still not reachable from the internet, because their security group only accepts traffic from the load balancer. A production setup would use private subnets with NAT or VPC endpoints, and the &lt;a href="https://devopswithumar.com/blog/nat-gateway-cost/" rel="noopener noreferrer"&gt;NAT gateway cost&lt;/a&gt; post shows the numbers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Terraform does not manage the running image.&lt;/strong&gt; The pipeline creates new task definition revisions, so the service ignores changes to the task definition and the desired count. Otherwise the next &lt;code&gt;terraform apply&lt;/code&gt; would put the first image back.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Remote state with native locking.&lt;/strong&gt; State lives in an S3 bucket with KMS encryption, versioning and a TLS-only policy. Locking uses the S3 lockfile, which needs Terraform 1.10 or newer, so there is no DynamoDB table to pay for or maintain. The setup is explained in &lt;a href="https://devopswithumar.com/blog/terraform-remote-state-s3-kms/" rel="noopener noreferrer"&gt;Terraform remote state on S3 with KMS&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One command to build, one to remove.&lt;/strong&gt; A Makefile has &lt;code&gt;make up&lt;/code&gt; to create everything and &lt;code&gt;make destroy&lt;/code&gt; to delete it. For a demo or test environment, that means the bill stops when the work stops.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you can see once it runs
&lt;/h2&gt;

&lt;p&gt;The CloudWatch dashboard shows requests and errors, response time, healthy and unhealthy targets, ECS CPU and memory, running tasks and the latest application logs on one screen. Three alarms watch for 5xx errors, high CPU and unhealthy targets, and they notify an SNS topic that can send email. This is the same approach as in &lt;a href="https://devopswithumar.com/blog/aws-monitoring-alerts-before-customers/" rel="noopener noreferrer"&gt;AWS monitoring alerts before customers do&lt;/a&gt;: know before someone tells you.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would add for production
&lt;/h2&gt;

&lt;p&gt;This project was scoped as a clean, working base. For a production workload I would add:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Private subnets, with NAT or VPC endpoints, so tasks have no public IP.&lt;/li&gt;
&lt;li&gt;HTTPS on the load balancer, with a certificate and a redirect from port 80.&lt;/li&gt;
&lt;li&gt;Autoscaling on CPU or request count, instead of a fixed task count.&lt;/li&gt;
&lt;li&gt;A second environment for staging, using the same modules with different values.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of this needs a redesign, because the modules and the pipeline already separate these concerns. The CIDR ranges were chosen with room for more subnets, as described in &lt;a href="https://devopswithumar.com/blog/vpc-cidr-subnet-planning/" rel="noopener noreferrer"&gt;VPC CIDR and subnet planning&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Handover
&lt;/h2&gt;

&lt;p&gt;The handover is the code in the client's GitHub repository, a README with the commands and design choices, and the diagram. The walkthrough follows one live change: edit the app, open a pull request, merge it and watch it deploy. If you are choosing between ECS and Kubernetes for your own project, &lt;a href="https://devopswithumar.com/blog/ec2-vs-ecs-vs-eks/" rel="noopener noreferrer"&gt;ECS vs EC2 vs EKS&lt;/a&gt; is the place to start.&lt;/p&gt;

&lt;p&gt;If you want a pipeline like this, or a review of the one you have, the &lt;a href="https://devopswithumar.com/services/cicd-pipelines/" rel="noopener noreferrer"&gt;CI/CD pipelines service&lt;/a&gt; page has the packages, and the &lt;a href="https://devopswithumar.com/checkup/" rel="noopener noreferrer"&gt;Free AWS Review&lt;/a&gt; is the quickest way to start.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why ECS Fargate and not EC2 or EKS?
&lt;/h3&gt;

&lt;p&gt;For a small stateless API there are no servers to patch or size, and nothing runs when the service is stopped. EKS adds a control plane and a lot to learn that this app did not need. The ECS vs EC2 vs EKS comparison on this site goes through when each one fits.&lt;/p&gt;

&lt;h3&gt;
  
  
  How does the pipeline deploy without AWS access keys?
&lt;/h3&gt;

&lt;p&gt;GitHub Actions asks GitHub for a short-lived token and exchanges it for temporary AWS credentials through OIDC. The deploy role only trusts this repository, the main branch and the deploy workflow, so nothing stored in GitHub can be reused elsewhere.&lt;/p&gt;

&lt;h3&gt;
  
  
  What happens if a new version is broken?
&lt;/h3&gt;

&lt;p&gt;The ECS service has the deployment circuit breaker with rollback turned on. If the new tasks keep failing their health checks, ECS stops the rollout and returns to the previous task definition, so the app stays up on the old version.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why does Terraform ignore the task definition?
&lt;/h3&gt;

&lt;p&gt;The pipeline creates a new task definition revision on every deploy. If Terraform managed the image too, the next terraform apply would roll the service back to the first image. The service ignores changes to the task definition and the desired count, and Terraform keeps managing everything else.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is this setup ready for production?
&lt;/h3&gt;

&lt;p&gt;It is a solid base: remote state, least-privilege deploy role, alarms and automatic rollback. For production I would add private subnets with NAT or VPC endpoints, HTTPS on the load balancer with a certificate, and autoscaling. The README lists what is deliberately kept small.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://devopswithumar.com/blog/case-study-ecs-fargate-terraform-github-actions/" rel="noopener noreferrer"&gt;DevOps with Umar&lt;/a&gt;. I keep free browser tools for this kind of work there: an &lt;a href="https://devopswithumar.com/tools/aws-cost-calculator/" rel="noopener noreferrer"&gt;AWS savings estimator&lt;/a&gt;, a &lt;a href="https://devopswithumar.com/tools/cron-generator/" rel="noopener noreferrer"&gt;cron expression generator&lt;/a&gt; and more in &lt;a href="https://devopswithumar.com/tools/" rel="noopener noreferrer"&gt;the tools list&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>terraform</category>
      <category>devops</category>
      <category>githubactions</category>
    </item>
    <item>
      <title>gp2 vs gp3: switch EBS volumes, save 20%, no downtime</title>
      <dc:creator>Muhammad Umar</dc:creator>
      <pubDate>Wed, 04 Nov 2026 10:42:44 +0000</pubDate>
      <link>https://dev.to/devopswithumar/gp2-vs-gp3-switch-ebs-volumes-save-20-no-downtime-5d2n</link>
      <guid>https://dev.to/devopswithumar/gp2-vs-gp3-switch-ebs-volumes-save-20-no-downtime-5d2n</guid>
      <description>&lt;p&gt;In short:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;gp3 costs $0.08 per GB-month against $0.10 for gp2, and includes 3,000 IOPS and 125 MiB/s at any size.&lt;/li&gt;
&lt;li&gt;You can switch a volume from gp2 to gp3 while it stays attached and in use.&lt;/li&gt;
&lt;li&gt;gp2 volumes of 334 GiB and up lose throughput, and those over 1 TiB lose IOPS, unless you set both on gp3.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;gp2 vs gp3 has a short answer: &lt;strong&gt;gp3 is the better EBS volume for almost every workload, and it costs 20% less.&lt;/strong&gt; gp3 storage is $0.08 per GB-month against $0.10 for gp2, and every gp3 volume gets 3,000 IOPS and 125 MiB/s included, whatever its size. You can switch a live volume in place, without stopping the instance.&lt;/p&gt;

&lt;p&gt;Most AWS accounts I review still have gp2 volumes. They were created by old launch templates, old Terraform modules, or an EKS cluster's default StorageClass, and nobody went back. This post shows how to find them, switch them safely, and stop new ones from appearing.&lt;/p&gt;

&lt;h2&gt;
  
  
  gp2 vs gp3 at a glance
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;gp2&lt;/th&gt;
&lt;th&gt;gp3&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Price (us-east-1)&lt;/td&gt;
&lt;td&gt;$0.10 per GB-month&lt;/td&gt;
&lt;td&gt;$0.08 per GB-month&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Baseline IOPS&lt;/td&gt;
&lt;td&gt;3 per GiB (100 minimum)&lt;/td&gt;
&lt;td&gt;3,000 at any size&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Burst&lt;/td&gt;
&lt;td&gt;Up to 3,000 IOPS on volumes under 1 TiB, while credits last&lt;/td&gt;
&lt;td&gt;No burst needed, performance is constant&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Maximum IOPS&lt;/td&gt;
&lt;td&gt;16,000&lt;/td&gt;
&lt;td&gt;80,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Throughput&lt;/td&gt;
&lt;td&gt;128 to 250 MiB/s, depending on size&lt;/td&gt;
&lt;td&gt;125 MiB/s included, up to 2,000 MiB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Extra performance&lt;/td&gt;
&lt;td&gt;Only by making the volume bigger&lt;/td&gt;
&lt;td&gt;Paid separately: $0.005 per IOPS, $0.04 per MiB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The important difference is the last row. On gp2, IOPS are tied to size: a 100 GiB gp2 volume gets 300 baseline IOPS, and the only way to get more is to buy more disk. On gp3, size and performance are separate, so you pay for the storage you need and add performance only if you need it.&lt;/p&gt;

&lt;p&gt;gp3 limits went up in September 2025: a gp3 volume can now be up to 64 TiB, with 80,000 IOPS and 2,000 MiB/s (&lt;a href="https://aws.amazon.com/about-aws/whats-new/2025/09/amazon-ebs-size-provisioned-performance-gp3-volumes" rel="noopener noreferrer"&gt;AWS announcement&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  What gp2 to gp3 saves: real numbers
&lt;/h2&gt;

&lt;p&gt;Here is what the switch does for typical volumes in us-east-1:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Volume&lt;/th&gt;
&lt;th&gt;gp2 per month&lt;/th&gt;
&lt;th&gt;gp3 per month&lt;/th&gt;
&lt;th&gt;Saving&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;10 root volumes of 30 GiB&lt;/td&gt;
&lt;td&gt;$30&lt;/td&gt;
&lt;td&gt;$24&lt;/td&gt;
&lt;td&gt;$6 (20%), and 3,000 IOPS each instead of 100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;500 GiB database volume&lt;/td&gt;
&lt;td&gt;$50&lt;/td&gt;
&lt;td&gt;$40 (+$5 to keep 250 MiB/s)&lt;/td&gt;
&lt;td&gt;$5 to $10, and 3,000 IOPS instead of 1,500&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2,000 GiB volume, matching gp2 performance&lt;/td&gt;
&lt;td&gt;$200&lt;/td&gt;
&lt;td&gt;$180&lt;/td&gt;
&lt;td&gt;$20 (10%)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The 2,000 GiB row is the one to watch. A gp2 volume that size has 6,000 IOPS and 250 MiB/s. To match it on gp3 you pay for 3,000 extra IOPS ($15) and 125 extra MiB/s ($5) on top of $160 of storage. It is still cheaper, but only if you set those numbers. That is the mistake in the next section.&lt;/p&gt;

&lt;p&gt;Storage is rarely the biggest line on an AWS bill, but this is the safest saving there is: no code change, no restart, no risk. For the bigger wins, see &lt;a href="https://devopswithumar.com/blog/cut-your-aws-bill-quick-wins/" rel="noopener noreferrer"&gt;how to reduce your AWS bill&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The big-volume IOPS trap
&lt;/h2&gt;

&lt;p&gt;When you change a volume to gp3 without saying anything else, AWS gives it the gp3 baseline: 3,000 IOPS and 125 MiB/s.&lt;/p&gt;

&lt;p&gt;For IOPS that is more than gp2 gives any volume under 1 TiB. For throughput, and for very big volumes, it can be less:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A 2,000 GiB gp2 volume runs at 6,000 IOPS. Switched with defaults, it drops to 3,000.&lt;/li&gt;
&lt;li&gt;Any gp2 volume of 334 GiB or more delivers 250 MiB/s. Switched with defaults, it drops to 125 MiB/s.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before you switch a large volume, check its baseline (size × 3, up to 16,000) and look at its real usage in CloudWatch (&lt;code&gt;VolumeReadOps&lt;/code&gt;, &lt;code&gt;VolumeWriteOps&lt;/code&gt;, &lt;code&gt;VolumeReadBytes&lt;/code&gt;, &lt;code&gt;VolumeWriteBytes&lt;/code&gt;). Then set &lt;code&gt;--iops&lt;/code&gt; and &lt;code&gt;--throughput&lt;/code&gt; to what it actually uses, not what gp2 happened to give it. Many big volumes use far less than their gp2 baseline, which makes the saving bigger.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: find every gp2 volume
&lt;/h2&gt;

&lt;p&gt;Volumes live in regions, so check them all. This lists every gp2 volume in the account with its region, size and state:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;for &lt;/span&gt;r &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;aws ec2 describe-regions &lt;span class="nt"&gt;--query&lt;/span&gt; &lt;span class="s1"&gt;'Regions[].RegionName'&lt;/span&gt; &lt;span class="nt"&gt;--output&lt;/span&gt; text&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
  &lt;/span&gt;aws ec2 describe-volumes &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$r&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--filters&lt;/span&gt; &lt;span class="nv"&gt;Name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;volume-type,Values&lt;span class="o"&gt;=&lt;/span&gt;gp2 &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--query&lt;/span&gt; &lt;span class="s1"&gt;'Volumes[].[VolumeId,Size,State]'&lt;/span&gt; &lt;span class="nt"&gt;--output&lt;/span&gt; text |
    &lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="s2"&gt;"s/^/&lt;/span&gt;&lt;span class="nv"&gt;$r&lt;/span&gt;&lt;span class="s2"&gt; /"&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Volumes in the &lt;code&gt;available&lt;/code&gt; state are not attached to anything. Do not convert those: snapshot them and delete them instead, as explained in &lt;a href="https://devopswithumar.com/blog/aws-charges-billing-you-for-nothing/" rel="noopener noreferrer"&gt;3 hidden AWS charges&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: switch a volume from gp2 to gp3, live
&lt;/h2&gt;

&lt;p&gt;For a volume under 334 GiB, one command is enough:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ec2 modify-volume &lt;span class="nt"&gt;--volume-id&lt;/span&gt; vol-0abc123def4567890 &lt;span class="nt"&gt;--volume-type&lt;/span&gt; gp3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a volume of 334 GiB or more, set the performance it needs (here, matching a 2,000 GiB gp2 volume):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ec2 modify-volume &lt;span class="nt"&gt;--volume-id&lt;/span&gt; vol-0abc123def4567890 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--volume-type&lt;/span&gt; gp3 &lt;span class="nt"&gt;--iops&lt;/span&gt; 6000 &lt;span class="nt"&gt;--throughput&lt;/span&gt; 250
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then watch the progress:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ec2 describe-volumes-modifications &lt;span class="nt"&gt;--volume-ids&lt;/span&gt; vol-0abc123def4567890 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--query&lt;/span&gt; &lt;span class="s1"&gt;'VolumesModifications[].[ModificationState,Progress]'&lt;/span&gt; &lt;span class="nt"&gt;--output&lt;/span&gt; text
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The volume stays attached and keeps serving reads and writes while it changes. Small volumes finish in minutes; large ones can take hours. You can modify a volume up to four times in a rolling 24-hour window, each change after the previous one completes (&lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyVolume.html" rel="noopener noreferrer"&gt;ModifyVolume reference&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Two habits make this boring:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Take a snapshot first if the volume holds anything you cannot rebuild. The change is safe, but a snapshot costs little and lets you sleep.&lt;/li&gt;
&lt;li&gt;Switch one non-production volume, watch it for a day, then do the rest.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 3: switch gp2 to gp3 in Terraform
&lt;/h2&gt;

&lt;p&gt;If Terraform created the volume, change it in Terraform, or the next &lt;code&gt;terraform apply&lt;/code&gt; will switch it back.&lt;/p&gt;

&lt;p&gt;A standalone volume:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_ebs_volume"&lt;/span&gt; &lt;span class="s2"&gt;"data"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;availability_zone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"us-east-1a"&lt;/span&gt;
  &lt;span class="nx"&gt;size&lt;/span&gt;              &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;              &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"gp3"&lt;/span&gt;
  &lt;span class="c1"&gt;# Only needed above the gp3 baseline of 3,000 IOPS and 125 MiB/s:&lt;/span&gt;
  &lt;span class="c1"&gt;# iops       = 6000&lt;/span&gt;
  &lt;span class="c1"&gt;# throughput = 250&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An instance's root volume:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_instance"&lt;/span&gt; &lt;span class="s2"&gt;"app"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;ami&lt;/span&gt;           &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ami-0123456789abcdef0"&lt;/span&gt;
  &lt;span class="nx"&gt;instance_type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"t3.medium"&lt;/span&gt;

  &lt;span class="nx"&gt;root_block_device&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;volume_type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"gp3"&lt;/span&gt;
    &lt;span class="nx"&gt;volume_size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A launch template, so every new instance starts on gp3:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_launch_template"&lt;/span&gt; &lt;span class="s2"&gt;"app"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;name_prefix&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"app-"&lt;/span&gt;

  &lt;span class="nx"&gt;block_device_mappings&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;device_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"/dev/xvda"&lt;/span&gt;
    &lt;span class="nx"&gt;ebs&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;volume_type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"gp3"&lt;/span&gt;
      &lt;span class="nx"&gt;volume_size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run &lt;code&gt;terraform plan&lt;/code&gt; and read it before you apply. A volume type change should show as &lt;strong&gt;update in-place&lt;/strong&gt;. If the plan says a resource will be &lt;strong&gt;replaced&lt;/strong&gt;, stop and find out why first: replacing an instance or a volume is not the same as modifying it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: EKS and Kubernetes volumes
&lt;/h2&gt;

&lt;p&gt;Older EKS clusters ship with a &lt;code&gt;gp2&lt;/code&gt; StorageClass as the default, so every new PersistentVolume is gp2. With the EBS CSI driver installed, add a gp3 StorageClass and make it the default:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;storage.k8s.io/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;StorageClass&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;gp3&lt;/span&gt;
  &lt;span class="na"&gt;annotations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;storageclass.kubernetes.io/is-default-class&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;true"&lt;/span&gt;
&lt;span class="na"&gt;provisioner&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ebs.csi.aws.com&lt;/span&gt;
&lt;span class="na"&gt;parameters&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;gp3&lt;/span&gt;
&lt;span class="na"&gt;volumeBindingMode&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;WaitForFirstConsumer&lt;/span&gt;
&lt;span class="na"&gt;allowVolumeExpansion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then remove the default annotation from the old gp2 class, so only one class is the default. Existing PersistentVolumes keep their EBS volume, so switch those with the same &lt;code&gt;aws ec2 modify-volume&lt;/code&gt; command from Step 2; the pods keep running. For more on keeping pods healthy, see &lt;a href="https://devopswithumar.com/blog/kubernetes-mistakes-crash-pods/" rel="noopener noreferrer"&gt;3 Kubernetes mistakes that crash your pods&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop new gp2 volumes from appearing
&lt;/h2&gt;

&lt;p&gt;Switching today's volumes is half the job. The other half is making sure next month's volumes are gp3:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Default EBS volume type in Terraform modules and launch templates&lt;/strong&gt;: set &lt;code&gt;gp3&lt;/code&gt; everywhere a volume type appears.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EKS default StorageClass&lt;/strong&gt;: gp3, as above.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A monthly check&lt;/strong&gt;: run the Step 1 loop, or add it to the routine in &lt;a href="https://devopswithumar.com/aws-cost-checklist/" rel="noopener noreferrer"&gt;the AWS cost checklist&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  gp2 vs gp3 checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;List every gp2 volume in every region.&lt;/li&gt;
&lt;li&gt;Delete the unattached ones instead of converting them.&lt;/li&gt;
&lt;li&gt;Switch volumes under 334 GiB with one command.&lt;/li&gt;
&lt;li&gt;For volumes of 334 GiB and up, check real IOPS and throughput in CloudWatch, and set them on gp3.&lt;/li&gt;
&lt;li&gt;Change the type in Terraform too, and check the plan says update in-place.&lt;/li&gt;
&lt;li&gt;Make gp3 the default in launch templates, modules and the EKS StorageClass.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Want a rough number for your whole account first? The &lt;a href="https://devopswithumar.com/tools/aws-cost-calculator/" rel="noopener noreferrer"&gt;AWS cost savings calculator&lt;/a&gt; has gp2 as one of its checks. If you would rather have someone go through the account with you, the &lt;a href="https://devopswithumar.com/services/aws-cost-optimization/" rel="noopener noreferrer"&gt;AWS cost optimization&lt;/a&gt; review covers this and the bigger wins, or start with a &lt;a href="https://devopswithumar.com/checkup/" rel="noopener noreferrer"&gt;Free AWS Review&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Prices and limits are from the &lt;a href="https://aws.amazon.com/ebs/general-purpose/" rel="noopener noreferrer"&gt;Amazon EBS General Purpose volumes page&lt;/a&gt; and the &lt;a href="https://docs.aws.amazon.com/ebs/latest/userguide/general-purpose.html" rel="noopener noreferrer"&gt;EBS user guide&lt;/a&gt;, checked in November 2026. Prices vary slightly by region.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Is gp3 always cheaper than gp2?
&lt;/h3&gt;

&lt;p&gt;For almost every volume, yes. gp3 storage is 20% cheaper, and below 1 TiB you get more IOPS for free. Very large gp2 volumes need extra IOPS and throughput bought on gp3 to match, which narrows the saving, but it usually stays cheaper.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do I need to stop my EC2 instance to change gp2 to gp3?
&lt;/h3&gt;

&lt;p&gt;No. On current-generation instance types you change the volume type while it stays attached and in use. The volume keeps serving reads and writes during the change.&lt;/p&gt;

&lt;h3&gt;
  
  
  How long does a gp2 to gp3 change take?
&lt;/h3&gt;

&lt;p&gt;It depends on the volume size and how busy it is: small volumes finish in minutes, large ones can take hours. You can keep using the volume the whole time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I go back from gp3 to gp2?
&lt;/h3&gt;

&lt;p&gt;Yes, with the same modify-volume command. You can modify a volume up to four times in a rolling 24-hour window, once the previous change has completed.&lt;/p&gt;

&lt;h3&gt;
  
  
  What about Kubernetes volumes on EKS?
&lt;/h3&gt;

&lt;p&gt;Set a gp3 StorageClass as the default for new volumes, then switch existing volumes with the same AWS CLI command. The pods keep running.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://devopswithumar.com/blog/gp2-vs-gp3-ebs/" rel="noopener noreferrer"&gt;DevOps with Umar&lt;/a&gt;. I keep free browser tools for this kind of work there: an &lt;a href="https://devopswithumar.com/tools/aws-cost-calculator/" rel="noopener noreferrer"&gt;AWS savings estimator&lt;/a&gt;, a &lt;a href="https://devopswithumar.com/tools/cron-generator/" rel="noopener noreferrer"&gt;cron expression generator&lt;/a&gt; and more in &lt;a href="https://devopswithumar.com/tools/" rel="noopener noreferrer"&gt;the tools list&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>cloud</category>
      <category>terraform</category>
    </item>
  </channel>
</rss>
