What is IaC Stack Controller?

Learn the components and the flows for creation, drift detection, and remediation.

A Terraform or OpenTofu pipeline can provision infrastructure. The platform engineering challenge is offering a common way for teams to request changes and track them without making every team build and operate its own pipeline. An apply also doesn’t, on its own, keep track of whether the infrastructure still matches what was requested.

IaC Stack Controller connects the two. An IaCStack records the desired infrastructure in Kubernetes and shows the outcome there. When the declaration changes or a scheduled drift check is due, the controller starts the workflow registered for that stack.

Why use it?

The platform team keeps its existing modules, state backend, and rules for executing changes. A team requesting infrastructure specifies inputs and selects a registered workflow instead of rebuilding that automation. The workflow can apply directly, wait for a review, or use a policy to decide. If a drift check finds an out-of-band change, the workflow determines whether to report it, request approval, or correct it.

The controller doesn’t replace Terraform, OpenTofu, or your state backend. It uses Argo Workflows to run the pipeline you register. If you use GitHub Actions today, you can reuse the underlying scripts and tools, but the workflow itself needs to be adapted.

Main components

A CustomResourceDefinition, or CRD, adds the IaCStack type to Kubernetes. Each stack is one instance of that type.

ComponentResponsibility
IaCStack CRDAdds an API resource for declaring a stack’s source, inputs, workflow and lifecycle rules. The resource status shows the outcome.
Controller written in GoWatches stacks, evaluates dependencies and suspension, schedules executions and drift checks, and records results.
Argo WorkflowsRuns the chosen pipeline. It orchestrates its steps, Pods, and configured approvals.
RunnerThe container that runs the scripts and tools selected by the workflow.
Your pipelineDefines how to resolve the source and backend, create a plan, evaluate policy, request approval, and apply with Terraform or OpenTofu.

The operator registers pipelines as integrations. A stack selects one through spec.workflowRef.name. Start with an example or register your own pipeline with your team’s images, stages and governance. Configure workflows in Argo · Component responsibilities

How it works

From the stack request to the result
  1. IaCStack

    Declares what to run, the inputs, and the workflow alias.

    spec:
      workflowRef:
        name: manual-aws-sg
      inputs:
        vpc_id: vpc-…
  2. IaC Stack Controller

    Watches the stack, looks up its alias, and creates a Workflow from the registered template.

    alias → WorkflowTemplate
  3. Argo Workflows

    Runs the recipe. Your WorkflowTemplate defines the stages, commands, pauses, and outputs.

    steps scripts outputs
  4. Runner pod

    Uses the image and ServiceAccount chosen for the workflow to run the tools and report outputs.

    Terraform / OpenTofu iacstack CLI
The result returns to IaCStack.status

Argo exposes the runner’s outputs. The controller watches the Workflow and updates the stack’s status.

Example with manual approval and technical authorization
  1. Plan
  2. Review and approve in Argo
  3. Controller authorizes the current attempt
  4. Apply

Reject ends the run without Apply.

The controller receives the intent and starts a run in Argo from the registered WorkflowTemplate. The template defines the step order, runner image, and scripts. The pipeline reads the intent and publishes its result; the controller watches the Workflow and updates stack status. If the workflow requires manual approval, Argo pauses for a person to decide. Technical authorization, when enabled, is a separate check by the controller before apply.

The Go binary iacstack helps the pipeline read intent and produce a result in the format the controller expects. You can change the image, tools, and steps. The execution contract is what keeps the integration working.

Follow an execution in detail · Configure workflows in Argo · Execution contract and CLI

Three everyday flows

FlowWhat happens
Create or updateThe controller starts an attempt for the new intent. The workflow validates, plans, runs its configured checks, and applies the plan when permitted.
Detect driftAt the configured interval, the controller schedules a check. The workflow compares desired and actual infrastructure and can report a difference, such as a change made in the cloud console.
Remediate driftWhen policy allows it, the workflow corrects the difference automatically and verifies the outcome. A policy that requires review lets the plan wait for approval.

Imagine a stack that declares three instances. The first execution plans and creates all three. If someone removes one outside IaC, a subsequent check can detect the difference. A governed workflow can restore the instance automatically or pause to let the team review the corrective plan.

Get started · Try it on Kind

Explore Kubernetes API-first and Platform Engineering integration to see how this interface fits GitOps, Backstage and internal developer platforms.