Concepts

Learn why to adopt the controller, how to reuse pipelines, and where GitOps fits.

What is the product? · Follow a run · See the responsibilities

Why use IaC Stack Controller?

Imagine a Terraform pipeline that applies a change successfully. The following week, someone changes the resource in the cloud console. Who notices the difference? Which version should take precedence? Can the correction run automatically, or should it go through the original approval process?

With an IaCStack, the desired state remains declared in the Kubernetes API after the workflow finishes. You register which code to run, with which inputs, and which workflow governs the stack. The controller watches that intent and coordinates new attempts when the declaration changes or a drift check is due. The pipeline still creates and applies the plan, and the result is available on the stack itself.

  • Continuous reconciliation. A manifest change can trigger a new execution. A scheduled check can detect changes made outside IaC. The workflow’s policy determines whether to correct the difference automatically, wait for approval, or report it.
  • Governance per stack. The same API can select direct apply for a sandbox and a workflow with OPA and human approval for a shared environment. Execution rules live in the selected workflow.
  • An interface for your platform. A team can submit the same YAML through a pull request, kubectl, or a self-service form. The platform controls the available aliases and identities, and the team can follow the result through the Kubernetes API.

The controller coordinates dependencies, retries, suspension and deletion. Terraform or OpenTofu computes and applies the change. The pipeline owns target validation, and the backend stores and protects state. How it works

Bring your existing automation

If a GitHub Actions pipeline already manages your infrastructure, first map the steps it performs today. A typical pipeline checks out code, selects a backend, runs plan, waits for approval, and applies. You can reuse the modules, scripts, runner image, and governance logic where they fit the new execution environment.

  1. Adapt the steps for Argo. Put the sequence or DAG in a WorkflowTemplate. The pipeline receives the stack intent and reports the effective revision and result through the iacstack CLI or the execution contract.
  2. Register the integration. Configure an alias, namespace, template and ServiceAccount. A stack selects the alias with spec.workflowRef.name.
  3. Validate the state handoff. Check the revision, inputs, identity, target, state address and locking. Disable writes from the previous automation during the handoff. If the code matches the existing infrastructure, the first plan should return NoChanges. Investigate unexpected changes before applying.

Before and after workflow adoption

Bring your own workflow · Execution contract

Where GitOps fits

In GitOps, the desired state is versioned in Git, and an agent watches the repository and syncs the declarations. The object being synced here can be the IaCStack itself. Think of it as three steps, each with an owner:

  1. Git → Kubernetes. A person changes an input or module version in a pull request. After merge, Argo CD or Flux syncs the IaCStack manifest to the Kubernetes API.
  2. Kubernetes → execution. IaC Stack Controller sees the object change and coordinates the next attempt. The stack’s alias determines which workflow Argo Workflows runs.
  3. Execution → infrastructure and status. The workflow runs plan, applies its governance rules, and executes the change if allowed. The controller reports the result on the stack.

For example, a team can review a change from instance_count: "2" to "3" through its existing PR process. Merging accepts the manifest change in Git. If the selected pipeline also requires plan approval, that decision happens in the workflow once the actual impact is known.

A GitOps agent looks for differences between Git and the Kubernetes object. A stack drift check compares the managed resource with the IaC configuration. The manifest can be in sync while a resource in AWS is still awaiting correction. For a quick trial, apply the manifest directly with kubectl.

OpenGitOps principles · Architecture

Want to try delivery from Git? Sync a lab stack with Argo CD.

Choosing an approach

Compare workflow ownership and adoption models across IaC Stack Controller, Tofu Controller and Burrito.


Kubernetes API-first

Why a persistent Kubernetes API resource changes the infrastructure lifecycle.

Platform Engineering integration

Compose the controller with IDPs, GitOps and self-service interfaces.

Choosing an IaC controller

Compare workflow ownership and brownfield adoption across Kubernetes IaC controllers.