Charlotte, NC
BlogAugust 4, 2026

What SST v4 Gets Right for Full-Stack AWS Applications

Blake McCarn
What SST v4 Gets Right for Full-Stack AWS Applications
I deploy four Next.js applications with SST v4, and I'd pick it again for each of them. I wouldn't pick it for the AWS accounts, networks and homelab that sit underneath them. Both answers have the same reason. SST is good at infrastructure that belongs to one application, and the further a resource gets from a single application, the less I want it in an SST config. This post uses two of them: this portfolio and blog and the Charlotte Wire & Cable site. RapidEPR and Solomon run on SST too. The portfolio is one Next.js deployment with a domain and two secrets. Charlotte Wire puts DynamoDB, S3, Cognito and SES behind a public product catalog and an admin app, and it's the project that showed me where SST stops helping. SST is a full-stack application framework that defines infrastructure in TypeScript. Its higher-level components cover common application resources, and the Pulumi and Terraform provider ecosystem underneath exposes lower-level resources across AWS, Cloudflare and more than 150 other providers. The version history is worth getting right, because older descriptions are still everywhere. SST moved off CloudFormation and CDK in v3, and v4 keeps the Pulumi engine while moving to version 7 of the Pulumi AWS provider. It isn't a CDK wrapper, and there are no CDK stacks. A project starts with one sst.config.ts, and a larger project can split its resources into an infra/ directory without turning into a second infrastructure codebase. I like that model when the same small team owns the frontend, the backend and the AWS resources. The infrastructure sits next to the code that uses it, and TypeScript passes values between components without an outputs file to keep in sync. As of writing, this site runs Next.js 16.3 on SST 4.17.1. It deploys with the Nextjs component, which builds the app through OpenNext and provisions what it needs to run behind CloudFront. The whole infrastructure fits in one file: That file holds decisions that would otherwise be spread across a hosting dashboard, a DNS provider and my deploy notes. Production resources are retained and protected from removal. Only the production stage gets the real domain, so any other stage comes up on its generated AWS URL. The Cloudflare provider and the OpenNext adapter are both pinned to exact versions, and I'll come back to why. The two secrets are declared once and passed to the site twice. link makes them available through SST's Resource SDK. The environment block sets them as environment variables, which is how the site code reads them. The Google Analytics ID has to arrive that way in any case. Next.js only exposes variables prefixed with NEXT_PUBLIC_ to the browser, and it inlines them during next build, so the measurement ID has to be in process.env when the build runs. The provider credentials have a different lifecycle. make deploy reads the Cloudflare API token and account ID from encrypted SSM parameters and passes them only to the SST process. They're deployment credentials, not application secrets, and the running site never sees them. Charlotte Wire is where SST stopped being a convenient hosting wrapper and became the infrastructure layer for a whole application. It runs Next.js 15.5.12 and pins SST at exactly 4.1.0. Its infrastructure code defines:
  • Two DynamoDB tables, one for products (with a category index) and one for team members
  • An S3 bucket for product PDFs and team photos
  • A Cognito user pool and app client for the admin login
  • An SES email identity on the stages that send mail
  • The Next.js app, with IAM permissions for those tables, the bucket and the user pool, plus SES on the mail-sending stages
  • A custom domain and certificate on the live stage
sst.config.ts owns the deployment policy and the app component. Files under infra/ define the tables, the bucket, the user pool and the email identity, one file each. The app and its infrastructure live in one repository and deploy together, and each file is small enough to review on its own. SST doesn't force everything into one file. A deploy starts at sst.config.ts, and it imports the files under infra/. The stage policy is more involved than the portfolio's. Three named stages keep their data when they're removed, and every other stage is disposable. A single isProd flag decides which stages get SES, the custom domain and the strict bot checks on the contact form. That flag lives in its own module, infra/stage.ts, which creates no resources, and the reason surprised me. Importing infra/ declares the tables, the bucket and the user pool as a side effect of evaluating the module, and Pulumi doesn't roll back operations that have already started when a later step throws. A check that's supposed to stop a deploy has to run before that import. Otherwise a refused deploy has already created part of a stage.
Tap to enlarge, then pinch to zoom
According to the current sst dev documentation, dev mode deploys most infrastructure resources, runs Function components through SST Live, starts frontend processes, loads linked resources into their environment, and watches sst.config.ts for infrastructure changes. A Nextjs component isn't deployed during sst dev. SST starts the app's normal development command, which defaults to npm run dev, so the accurate mental model looks like this:
Tap to enlarge, then pinch to zoom
SST Live only applies to Function components I define myself. For Next.js, sst dev runs the app on my laptop and connects it to the stage's real AWS resources. No request goes through CloudFront. When I need a real deployed preview, I use a named stage: The CLI uses the stage to isolate resource names, and the deployed Nextjs component returns an AWS URL when no custom domain is configured. That's the URL I can hand to someone else for review. It also costs whatever its AWS resources cost, though a low-traffic serverless stage is cheap. SST doesn't put secret values in Parameter Store. The current Secret component documentation says secret values are encrypted and stored in an S3 bucket in the AWS account. Values used by the infrastructure configuration are encrypted in state. Linked runtime secrets are encrypted in the function bundle, and the SST SDK decrypts them when the function starts. Secrets are scoped by app and stage: On its live stage, Charlotte Wire declares its Turnstile secret with no fallback value, so the deploy fails with a missing-secret error if nobody ever set it. That's the easy half. A secret can be present and still useless. An empty string, stray whitespace or one of Cloudflare's published Turnstile test keys all pass SST's presence check, and any of them would put the contact form online looking protected while it accepts every bot. So the config reads the value SST is about to inject, from SST's own SST_SECRET_TurnstileSecretKey environment variable, and refuses to deploy a live stage if the value is blank or matches the test-key pattern. It also trims the value in exactly one place, so the string the check approves is byte for byte the string the Lambda receives. Without that, a secret pasted with a trailing newline would pass every check and then fail every form submission.
Tap to enlarge, then pinch to zoom
SST state is generated locally, then backed up to the configured home provider. With home: "aws", SST stores state in an S3 bucket and keeps the encryption passphrase in SSM Parameter Store. Completed state snapshots form the recovery history. State is backed up remotely, but the AWS console doesn't replace it. If someone changes a resource by hand in the console, state no longer matches what's in AWS. SST documents sst refresh as the way to fix that. SST removes a lot of glue code by composing several projects: SST's components, Pulumi providers, OpenNext, Next.js and AWS itself. The cost is that compatibility between those layers becomes part of every deploy. This site has the clearest example. SST picks an OpenNext version for you, and for Next.js 15 and later its default is a 3.x release. Next.js 16.2.6 broke image optimization under that default (SST issue #6867), and the portfolio project page covers how that showed up in production. The application code was fine. The adapter between Next.js and Lambda wasn't. OpenNext v4 handles the change, so the config pins an exact v4 release. The pin fixed the image bug, and it also changed how I upgrade. With an exact openNextVersion, the adapter only changes when I change it, so it shows up in the same pull request as the Next.js version it has to match. The dependency refresh that produced the versions in the snippet above moved Next.js to 16.3, SST to 4.17.1, the Cloudflare provider to 6.18.0 and OpenNext to 4.1.0 together. That PR was checked with a clean install, a build, sst install and an sst diff against production before anything was deployed. Those numbers will keep changing, and each change gets the same review.
Tap to enlarge, then pinch to zoom
Charlotte Wire made a different choice. It pins an older SST release alongside Next.js 15, and an upgrade there is more than a version bump. The Turnstile check reads the secret through SST_SECRET_TurnstileSecretKey, which is an SST internal rather than a documented interface, and the comment next to it says to re-verify that name whenever the SST pin moves. That isn't automatically a problem. It means upgrades get treated as infrastructure changes. I read the release notes, run the tests, build the app, inspect the diff and deploy a non-live stage before I touch the live one. Provider changes need the same care. SST pins each installed provider to the version in sst.config.ts, and its docs require a config change plus sst install to move one. That predictability helps, but the testing is still my job. I'd choose SST again when these conditions are true:
  • The product is a full-stack application running mostly on AWS.
  • The same team owns the application and its supporting infrastructure.
  • TypeScript is already the working language.
  • The architecture maps reasonably well to SST components or ordinary provider resources.
  • Fast local application work and repeatable stage deployments both matter.
I wouldn't use it as the default answer for every infrastructure problem. My multi-account AWS foundation, network topology and homelab lifecycle boundaries belong in CDK or Terraform, because those systems outlive any one application. I wrote about that separation in Terraforming My Homelab: Rebuild the Shells, Protect the Data. Vercel is still the simpler choice when the entire requirement is "host this Next.js site." SST earns its place when the application needs its own AWS resources, IAM permissions between them, a separate copy of everything per stage, or state and secrets that stay in my AWS account. SST makes stages cheap to create, but it doesn't know which ones hold data you can't lose. A stage named production means nothing special to SST. My config decides what each name does. Charlotte Wire shows how literal that is. Its live site deploys from the production stage. The email identity, the custom domain and the strict contact-form checks all depend on one isProd comparison against that stage name. If someone changes that string in the wrong place, the next deploy of the live site drops all three, and SST does it exactly as written.
Share this post: