[EN] Modern IaC: How to build cloud infrastructure with the Formae Agent

Julian | Mar 6, 2026 min read

Anyone who has ever worked with Terraform or CloudFormation knows the game: you struggle with state locks, drifting resources and a DSL (Domain Specific Language) that often feels more like configuration than real code. Infrastructure as Code (IaC) is supposed to make our lives easier, but it often feels like managing a gigantic, fragile database.

This is where Formae comes into play.

Was ist Form? (Agent IAC)

Formae takes a radically different approach, which the creators call “Agentic IaC”. Instead of maintaining a central state in an S3 bucket, Formae acts as an intelligent agent. The tool uses Pkl (the configuration language developed by Apple) to define infrastructure.

The crucial difference to classic IaC:

  • State-less by Design: Formae reads the current state directly from the cloud API. There is no local or remote state file that can corrupt.
  • Pkl as a powerhouse: We use a real programming language with type safety instead of digging through endless YAML deserts.
  • Real-time synchronization: With --watch mode, your infrastructure behaves like your local dev server - if you save the file, the agent immediately adjusts the cloud resources.

The basis: Pkl and the “Forma”

In Formae we define our resources in so-called .pkl files. We call these files “formas”. Since Pkl natively supports types, we know whether a parameter is valid as we write it - long before we type ‘apply’.

For example, a simple S3 bucket in Formae looks like this:

import "package://pkg.formae.io/aws/v1/s3.pkl"

bucket = new s3.Bucket {
  name = "my-unique-app-assets"
  region = "eu-central-1"
  versioning = true
}

This is clean, readable and most importantly: Type safe.

Hands-on: Deploying your first “Forma”.

Theory aside, let’s make this thing fly. To work with Formae we need the Formae Agent and the Pkl CLI.

1. Setup & Installation

The Formae Agent is the heart. It acts as an interpreter between your Pkl code and the cloud APIs (like AWS, Azure or GCP). Installation is incredibly easy thanks to the Go base:

# Beispiel für macOS/Linux via Brew oder Direct Download
curl -sSL https://install.formae.io | sh

Also make sure you have pkl installed so that your editor can give you feedback on types and validations as you write the infrastructure.

2. In the Manifest: main.pkl

We create a project directory and define our infrastructure. Let’s take a practical example: a simple S3 bucket for static assets.

// main.pkl
import "package://pkg.formae.io/aws/v1/s3.pkl"

bucket = new s3.Bucket {
  name = "julianpaul-dev-assets"
  region = "eu-central-1"
  acl = "private"

  tags = new {
    ["Environment"] = "Development"
    ["ManagedBy"] = "Formae"
  }
}

3. Der “Magic Moment”: formae apply

This is where Formae differs massively from Terraform. Instead of first generating a plan that you have to laboriously review (only to find out that the state is locked), we run the agent:

formae apply main.pkl --watch

What’s happening in the background here? The agent analyzes your main.pkl, queries the AWS API for the current state of the bucket and calculates the difference. The --watch flag keeps the process active. If you now add versioning = true in the editor and save, Formae will immediately trigger the update.

Tip: This infrastructure “live reload” workflow is an absolute game changer for the developer experience. No more waiting for CI/CD pipelines for small config changes in the dev environment.

Reconcile vs. Patch: Stay in control

Formae offers two modes of how it handles changes:

  • Reconcile Mode (default): The agent ensures that the cloud looks exactly like your code. Manual changes in the AWS Console are mercilessly overwritten. Source of Truth is the code.
  • Patch Mode: Ideal for migrations. Formae only changes the fields you explicitly defined in the Pkl code, leaving the rest of the resource untouched.

My conclusion: Is Formae the “Terraform killer”?

Formae is a breath of fresh air in the often rigid IaC world. The combination of Pkl as a powerful configuration language and the agentic approach without laborious state files is technically brilliant.

When should you use Formae?

  • If you are tired of terraform.tfstate conflicts in your team.
  • If you prefer a real “programming language” (Pkl) instead of YAML hacks for complex logic.
  • For dynamic environments in which “live feedback” on infrastructure changes massively accelerates the workflow.

Where are the boundaries? We have to be realistic: the ecosystem around Formae is still growing. While the core providers for AWS and Azure are stable, Terraform (still) offers the broader range of niche providers. Formae is currently perfect for greenfield projects or teams ready to adapt state-of-the-art tools.

My advice: Try it in a sandbox project. The moment you save a .pkl file and see your infrastructure synchronize in seconds without a plan-apply cycle will convince you.