finds.dev← search

// the find

milliHQ/terraform-aws-next-js

★ 1,476 · TypeScript · Apache-2.0 · updated Dec 2023

Terraform module for building and deploying Next.js apps to AWS. Supports SSR (Lambda), Static (S3) and API (Lambda) pages.

A Terraform module for self-hosting Next.js on AWS using Lambda (SSR/API) and S3 (static), with a custom CLI (`tf-next`) and atomic deployment support via unique preview URLs. It is for teams that want Vercel-like deployments without the Vercel bill, and are comfortable owning the infrastructure in Terraform. This is not a managed service — you're running it yourself.

Atomic deployments are a genuine differentiator: each deploy gets a unique subdomain so you can preview before aliasing to production, which is table stakes on Vercel but rare in self-hosted setups. The architecture is well-decomposed — proxy config, deploy trigger, deploy controller, and runtime are separate packages with their own tests, not a giant monolith. The existing CloudFront integration option is thoughtful: teams that already have a CDN don't have to throw it away. IAM scoping is done right — the `api_endpoint_access_policy_arn` output lets you create CI users with minimal privileges.

The project is effectively abandoned: last push was December 2023 and Middleware support is explicitly not planned, which means you can't use a large and growing part of the Next.js feature set. It builds on Vercel's internal build pipeline, so it inherits Vercel's bugs and breaks whenever Vercel changes internals — a dependency with no SLA and no changelog you control. ISR is still listed as 'under development' with no timeline. The `terraform destroy` requiring two runs an hour apart is a real ops pain — documented as known, never fixed.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →