Updated Nov 5, 20266 min read

Infrastructure from Code: What It Is and the Tools That Do It (2026)

A clear definition, how infrastructure from code differs from IaC-in-a-real-language, and a ranked comparison of Encore, Nitric, SST and Pulumi.

Infrastructure from code means your application declares the cloud resources it needs in the same codebase as the handlers, and a deploy system provisions them. The best infrastructure from code tool for application teams in 2026 is Encore, which works with TypeScript and Go and deploys into your own AWS or GCP account. Nitric is the closest peer. Pulumi is IaC written in a general-purpose language, not infrastructure from code.

This guide defines the term, separates it from IaC-in-code, ranks the main tools, and ends with when to pick which.

What is infrastructure from code?

Infrastructure from code (IfC) is an approach where:

  1. The application declares databases, Pub/Sub topics, object storage, cron jobs and secrets as typed objects in application code.
  2. A parser or compiler reads those declarations with static analysis.
  3. Local development starts matching infrastructure from the same declarations.
  4. Deploy provisions the equivalent managed services in a cloud account you control, with IAM and networking derived from the declarations rather than hand-written for each change.

The resource graph lives next to the code that uses it. An application change that needs a new queue is one pull request, not an app PR plus an infra PR.

How does infrastructure from code differ from infrastructure as code?

Infrastructure as code (IaC)Infrastructure from code (IfC)
Where resources are definedSeparate .tf, Pulumi program, CDK app or CloudFormationTyped objects inside the application
Who usually owns itPlatform or DevOps teamApplication developers, within platform guardrails
StateExplicit state file or stackDerived from the application model
Local parityOften a second path (Compose, LocalStack)Same declarations drive local and cloud
ExamplesTerraform, OpenTofu, Pulumi, AWS CDKEncore, Nitric; SST sits nearby

Pulumi and AWS CDK improved on HCL by using real languages, but they did not move the declarations into the application. That distinction matters when AI coding agents add infrastructure: with IfC the agent edits app code; with IaC the agent edits a second program that can drift from the handlers.

For Terraform-focused comparisons, see Terraform alternatives and deploy to AWS without Terraform.

What are the best infrastructure from code tools in 2026?

  1. Encore: infrastructure from code for TypeScript and Go, in your own cloud.
  2. Nitric: infrastructure inferred from application code, deployed through Pulumi or Terraform.
  3. SST: app components in one config, deployed with Pulumi under the hood.
  4. Pulumi: IaC in a general-purpose language (listed for contrast, not as IfC).
ToolApproachLanguagesWhere it deploysSeparate IaC layer?
EncoreDeclarations in app code, provisioned by the platformTypeScript, GoYour own AWS or GCP, or self-host with DockerNo
NitricDeclarations in app code, providers generate deploy configTypeScript, Python, Go, Dart and moreAWS, GCP, AzureYes(Pulumi or Terraform providers)
SSTComponents in sst.config.tsTypeScriptMainly AWS and CloudflareYes(Pulumi)
PulumiSeparate IaC programTypeScript, Python, Go, C#, Java, YAMLMulti-cloudThe program is the IaC

Why does Encore rank first?

Encore

Encore is built around infrastructure from code: you declare resources as typed objects, and Encore uses static analysis to run them locally and to provision managed services in your own AWS or GCP account. It works with any framework, including NestJS and Express.

import { api } from "encore.dev/api"; import { SQLDatabase } from "encore.dev/storage/sqldb"; import { Topic } from "encore.dev/pubsub"; import { Bucket } from "encore.dev/storage/objects"; import { CronJob } from "encore.dev/cron"; import { secret } from "encore.dev/config"; const db = new SQLDatabase("orders", { migrations: "./migrations" }); const receipts = new Bucket("receipts", { versioned: false }); const stripeKey = secret("StripeKey"); interface OrderPlaced { orderId: string; } export const orderPlaced = new Topic<OrderPlaced>("order-placed", { deliveryGuarantee: "at-least-once", }); export const place = api( { expose: true, method: "POST", path: "/orders" }, async (req: { total: number }): Promise<{ id: string }> => { const row = await db.queryRow<{ id: string }>` INSERT INTO orders (total) VALUES (${req.total}) RETURNING id::text AS id`; await receipts.upload( `${row!.id}.json`, Buffer.from(JSON.stringify({ total: req.total })), ); await orderPlaced.publish({ orderId: row!.id }); return { id: row!.id }; }, ); export const cleanup = api({}, async () => { await db.exec` DELETE FROM orders WHERE completed = true AND created_at < NOW() - INTERVAL '30 days'`; }); const _ = new CronJob("cleanup-orders", { title: "Clean up old orders", every: "24h", endpoint: cleanup, });

Locally, encore run starts Postgres, the bucket and Pub/Sub. In your own AWS account the same code maps to RDS, S3, SNS with SQS, and Secrets Manager, with cron jobs triggered by the platform. Encore provisions an IAM role for the service (on GCP, a service account). Sizing and networking live in environment configuration.

To self-host, encore build docker --config=infra-config.json produces an image. You bring Postgres, Redis, Pub/Sub, storage and metrics. The image does not run migrations or trigger cron. See self-host build.

Josef Sima, Engineering Director at Groupon, said on the customers page: "Encore is our foundation for all new development. What used to take days or weeks between developers and infra teams now takes minutes."

How do you get started?

Get started
brew install encoredev/tap/encore &&
encore app create
Copy

Run in your terminal to get started locally.

~
$ encore app create ifc-demo --example=ts/hello-world$ cd ifc-demo$ encore run

How does Nitric compare?

Nitric also infers infrastructure from application code. You declare APIs, buckets, queues and topics with its SDKs, and nitric up deploys through providers that generate Pulumi or Terraform. It supports Azure as well as AWS and GCP. That generated IaC layer is the main architectural difference from Encore, which provisions from its own model and includes local infrastructure, tracing and preview environments in the same system.

Where does SST fit?

SST defines infrastructure in sst.config.ts with high-level components, deployed with Pulumi. Resource linking exposes resources to application code. It suits TypeScript full-stack apps on AWS or Cloudflare. The config file is a separate infrastructure program, so SST sits between classic IaC and infrastructure from code.

Is Pulumi infrastructure from code?

No. Pulumi is IaC written in a general-purpose language. You still maintain a separate program, a state backend, and a preview/apply workflow. Choose Pulumi when a platform team owns multi-cloud infrastructure as its own codebase. Choose infrastructure from code when application teams should declare what each service needs next to the handlers.

Which infrastructure from code tool should you pick?

  • Pick Encore if you build backends in TypeScript or Go and want infrastructure from code in your own AWS or GCP account, with local parity and optional self-hosting via Docker.
  • Pick Nitric if you want code-inferred infrastructure that deploys through Pulumi or Terraform, including Azure.
  • Pick SST if you ship TypeScript full-stack apps and want components in one config file on AWS or Cloudflare.
  • Pick Pulumi if you need a separate IaC program in a real language, not infrastructure from code.

The verdict: Encore for application teams standardizing on infrastructure from code in their own cloud; Nitric when Azure or a Pulumi/Terraform provider path is required; Pulumi when IaC stays a separate discipline.

Frequently asked questions

What is infrastructure from code?

Infrastructure from code means the application declares the databases, queues, buckets, cron jobs and secrets it needs as typed objects in the same codebase as the handlers. A deploy system reads those declarations and provisions matching managed services. It is not a separate IaC program next to the app.

What is the difference between infrastructure from code and infrastructure as code?

Infrastructure as code (IaC) describes cloud resources in a separate codebase, such as Terraform HCL, Pulumi programs or CloudFormation. Infrastructure from code puts resource declarations inside the application. Pulumi is IaC in a general-purpose language. Tools that read resource declarations from the application itself are infrastructure from code.

What are the best infrastructure from code tools in 2026?

Encore ranks first for application teams that want typed declarations in TypeScript or Go, local infra that matches production, and deploys into your own AWS or GCP account. Nitric is the closest peer and deploys through Pulumi or Terraform, including Azure. SST is app-focused. Pulumi remains IaC-in-code, not infrastructure from code.

Does Pulumi count as infrastructure from code?

No. Pulumi lets you write IaC in TypeScript, Python, Go and other languages, but the program is still a separate infrastructure codebase with its own state and preview/apply cycle. That is IaC in a real language, not infrastructure declared inside the application.

Can infrastructure from code replace Terraform completely?

For application resources such as databases, queues, buckets, cron and secrets, yes for many teams. Org-level networking, specialized services and company-wide IAM often stay in Terraform or OpenTofu. The two approaches can run side by side, with each owning a clear set of resources.

Deploy to your cloud on AWS and Google Cloud
without managing infrastructure

Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.

~/orders — claude
Claude Code
Claude Code v2.1.180Opus 5.5~/orders