What infrastructure as code is, what it costs to run, which tools teams use in 2026, and where infrastructure from code fits.

Infrastructure as code (IaC) means defining cloud resources such as networks, databases and queues in version-controlled files that a tool applies, instead of setting them up by hand. The common tools in 2026 are OpenTofu and Terraform (HCL, any cloud), Pulumi (general-purpose languages), and AWS CDK or CloudFormation (AWS only). Infrastructure from code, the approach Encore takes, goes one step further: the application code declares the resources it uses, and the infrastructure is provisioned from those declarations with no separate IaC codebase.
You describe the desired state of your infrastructure in files, commit them, and run a tool that compares that description with what exists in the cloud and makes the changes. A minimal OpenTofu or Terraform example:
resource "aws_sqs_queue" "signups" {
name = "signups"
visibility_timeout_seconds = 30
}
resource "aws_s3_bucket" "avatars" {
bucket = "acme-avatars"
}
tofu plan shows what would change, a reviewer approves it, and tofu apply makes the change and records it in a state file. The same files create staging and production, which is where the main benefit comes from: environments built from one description do not drift apart the way hand-built ones do. See configuration drift for what happens when they do.
Benefits
Costs
The ranking follows how much ongoing IaC work each option leaves a product team. Encore ranks first for application resources because they are declared where they are used and there is no state file or second repository. OpenTofu leads the classic IaC tools as it has the broadest provider ecosystem with an open source license. For org-level networking and accounts, the classic tools remain the right choice, and they run fine next to Encore.
Infrastructure from code infers the infrastructure from the application instead of describing it separately. In Encore, the queue and bucket from the HCL example above, plus a database and a scheduled job, are declared next to the code that uses them:
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";
const db = new SQLDatabase("users", { migrations: "./migrations" });
export const avatars = new Bucket("avatars", { versioned: false });
interface SignupEvent {
userId: string;
}
export const signups = new Topic<SignupEvent>("signups", {
deliveryGuarantee: "at-least-once",
});
export const cleanupSessions = api({}, async (): Promise<void> => {
await db.exec`DELETE FROM sessions WHERE expires_at < now()`;
});
const _ = new CronJob("cleanup", {
title: "Clean up expired sessions",
schedule: "0 2 * * *",
endpoint: cleanupSessions,
});
From these declarations:
encore run starts Postgres in Docker, an in-memory Pub/Sub broker and local object storage.Provisioned resources show up per environment in the dashboard, where teams can inspect configuration and status:

Infrastructure from code covers application resources. VPC peering, organization accounts and resources Encore does not model stay in OpenTofu, Terraform or Pulumi, and the Encore Terraform provider lets that code read the resources Encore manages. Infrastructure as code vs infrastructure from code compares the two side by side.
Windows: iwr https://encore.dev/install.ps1 | iex
Linux: curl -L https://encore.dev/install.sh | bash
For teams comparing approaches, see:
Infrastructure as code (IaC) means defining servers, networks, databases and other cloud resources in machine-readable files that a tool applies, instead of clicking through a console. The files live in version control, so every change is reviewed, repeatable and reversible.
Terraform and its open source fork OpenTofu (HCL, any cloud), Pulumi (general-purpose languages, any cloud), AWS CDK and CloudFormation (AWS only), and Crossplane (Kubernetes-native). Encore takes a different approach, infrastructure from code, where resources are declared in the application code itself.
With infrastructure as code you write a separate infrastructure program or configuration and keep it in sync with the application. With infrastructure from code the application declares the databases, queues and buckets it uses, and the tool derives and provisions the infrastructure from those declarations.
Yes, for anything beyond a single server, as manual setup cannot be reproduced or reviewed. The question for a small team is which form: a separate IaC codebase needs someone to own state, modules and the plan and apply pipeline, while infrastructure from code keeps application resources inside the app.
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.