<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/feed.xsl" type="text/xsl"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
    <title>Oliver Hardman</title>
    <link>https://oliverhardman.com/blog</link>
    <description>My ramblings about stuff I find interesting.</description>
    <language>en-gb</language>
    <copyright>© 2026 Oliver Hardman</copyright>
    <managingEditor>hello@oliverhardman.com (Oliver Hardman)</managingEditor>
    <webMaster>hostmaster@oliverhardman.net (Oliver Hardman)</webMaster>
    <lastBuildDate>Wed, 22 Apr 2026 01:45:14 GMT</lastBuildDate>
    <image>
      <url>https://oliverhardman.com/rss.png</url>
      <title>Oliver Hardman</title>
      <width>144</width>
      <height>76</height>
      <link>https://oliverhardman.com/blog</link>
    </image>
    <atom:link href="https://oliverhardman.com/feed.xml" rel="self" type="application/rss+xml"/>
    <item>
      <title>Introducing TerraNext</title>
      <link>https://oliverhardman.com/blog/introducing-terranext</link>
      <guid isPermaLink="true">https://oliverhardman.com/blog/introducing-terranext</guid>
      <description>I tried hosting Next.js on AWS serverless and ended up building a better way to do it.</description>
      <content:encoded><![CDATA[<p>Back in August, I needed to replatform a website onto Next.js. There was only one requirement: it had to run on AWS.</p><p>&quot;No problem,&quot; I thought. This should be easy.</p><p>You can host a <a href="https://nextjs.org/" target="_blank" rel="noopener noreferrer">Next.js</a> app on a server, and in many cases that’s the simplest option. Throw it on EC2. Maybe a container. Job done. But I knew the traffic for this particular site would be low and, more importantly, inconsistent. Keeping a server running 24/7 just to handle occasional bursts of traffic felt wasteful.</p><p>One of the main reasons developers choose Next.js is its hybrid model: static where possible, dynamic where necessary. It’s designed to adapt. Yet in practice, it seems that many deployments ignore that entirely, forcing it into a permanently running server.</p><p>It’s 2026. Serverless has come a long way. But if you’re not using Vercel, deploying Next.js this way still means stitching together undocumented integrations, handling edge cases, and dealing with implicit behaviour. Which is frustrating, because AWS already has everything you need: Lambda for compute, S3 for assets, CloudFront for distribution.</p><p>In theory, it’s a perfect fit.</p><p>In practice, it isn’t that simple.</p><h2>The reality of “just use a platform”</h2><p>Managed platforms like <a href="https://vercel.com/" target="_blank" rel="noopener noreferrer">Vercel</a> are popular for a reason: they abstract all of this work away. And to be clear, for small projects, prototypes, and even many production workloads, they’re hard to beat.</p><p>But in enterprise environments and large organisations, things look different.</p><p>You can’t always just adopt whatever platform works best on paper. There are constraints: procurement, governance, compliance, existing cloud strategy. And even if you do adopt a managed platform, you often end up needing more control as you scale, at which point you’re facing another replatforming, now under tighter SLAs and with real users depending on you.</p><p>That trade-off didn’t sit well with me.</p><p>When I looked into how others were solving this, most approaches fell into one of two camps:</p><ul><li><p>Run Next.js on a traditional server</p></li><li><p>Use a managed platform that abstracts everything away</p></li></ul><p>To me, both felt like giving up on what Next.js is actually capable of.</p><p>I also revisited <a href="https://aws.amazon.com/amplify/" target="_blank" rel="noopener noreferrer">AWS Amplify</a>, which I’ve tried several times over the years. But it still feels like another managed platform with the same problems: limited control over the underlying resources, and trying to do so much in one suite that it becomes, ironically, despite its focus on developer experience, really difficult to use.</p><h2>Discovering OpenNext</h2><p>Then I came across <a href="https://opennext.js.org/" target="_blank" rel="noopener noreferrer">OpenNext</a>.</p><p>Finally, a community of people tackling the same problem: how to deploy Next.js outside of Vercel without losing its capabilities. The project provides an adapter that makes Next.js compatible with serverless platforms like AWS Lambda.</p><p>Since launching in 2023, it’s gained traction quickly, with backing from platforms like <a href="https://www.cloudflare.com" target="_blank" rel="noopener noreferrer">Cloudflare</a> and <a href="https://www.netlify.com/" target="_blank" rel="noopener noreferrer">Netlify</a>. Today, thousands of sites rely on it to make their builds portable across different environments.</p><p>This was the first time things felt like they were heading in the right direction.</p><p>But there was still a gap.</p><h2>The Terraform problem</h2><p>I work heavily with <a href="https://developer.hashicorp.com/terraform" target="_blank" rel="noopener noreferrer">Terraform</a>. Not just AWS, but across multiple platforms, often in the same project. I might be provisioning Lambda functions alongside resources in <a href="https://azure.microsoft.com/en-gb" target="_blank" rel="noopener noreferrer">Azure</a> and <a href="https://cloud.google.com/" target="_blank" rel="noopener noreferrer">Google Cloud</a>, and I like that I can manage them from the same place.</p><p>These sorts of requirements are typical in environments where governance is tight, CI/CD is mature, and infrastructure needs to be transparent and auditable. So it was disappointing to see that the primary way to deploy OpenNext on AWS was through <a href="https://sst.dev/" target="_blank" rel="noopener noreferrer">SST</a>. It’s an awesome tool and does the job well for many projects, big and small. But not for this one.</p><p>Eventually, I found that <a href="https://github.com/nhs-england-tools/terraform-aws-opennext" target="_blank" rel="noopener noreferrer">NHS England had built a Terraform module for OpenNext</a>. At first glance, it looked exactly like what I needed. But it hadn’t been maintained. The last release was in early 2024. Documentation was sparse, links were broken, and it didn’t work with current versions of the AWS provider.</p><p>I tried it anyway, and after several hours of bodging, I got it working. And from there, I kept going. Fixing bugs, improving the structure, writing proper documentation, and bringing it up to date with the latest OpenNext architecture.</p><h2>Publishing it to the world</h2><p>At some point, I realised that this would be useful for many projects. So, I got to work turning it into something reusable. And after 7 months of testing and iteration, this week I released it.</p><p><a href="https://terranext.dev" target="_blank" rel="noopener noreferrer">TerraNext</a> is a free, open-source Terraform/OpenTofu module for deploying Next.js on AWS using a serverless architecture. It’s powered by OpenNext, but designed to feel native to Terraform workflows.</p><p>The goal is simple: let you run Next.js the way it was designed. It&#39;s serverless, scalable, and fully under your control. No black boxes. No hidden infrastructure.</p><p>And it&#39;s cheap. Really cheap.</p><p>Published under the MIT licence, you’re free to use it, modify it, and adapt it to your exact requirements. Thanks to its heavy use of cache policies and Lambda functions, you&#39;ll only need to pay for compute when you actually use it, or rather, when you want to use it. And of course, there&#39;s no &#39;per-seat&#39; pricing, so you won&#39;t need to worry about paying up just to grow your team.</p><p>Oh, and that website I mentioned? It&#39;s now live in production at <a href="https://centrica.com" target="_blank" rel="noopener noreferrer">Centrica</a>, serving thousands of users. I’m also using TerraNext for my personal site, as well as <a href="https://terranext.dev" target="_blank" rel="noopener noreferrer">TerraNext’s own website</a>.</p><h2>What’s next</h2><p>With the recent stable release of the Adapter API in Next.js 16.2, the ecosystem is finally catching up. The grip of vendor lock-in is starting to loosen, and we’re likely to see more demand for portable, infrastructure-native deployment approaches.</p><p>If you’re building with Next.js, working in AWS, and prefer Terraform, TerraNext might be worth a look.</p><p><a href="https://terranext.dev" target="_blank" rel="noopener noreferrer">https://terranext.dev</a></p>]]></content:encoded>
      <media:thumbnail url="https://images.ctfassets.net/4skr26erf87c/7s3U10LrTelH9HmxZkXBKq/60b843820be6851f922563ba95031229/blogpost-terranext.png" />
      <pubDate>Thu, 16 Apr 2026 21:23:03 GMT</pubDate>
    </item>
  </channel>
</rss>