Agent Runtime

Natural-Language Infrastructure-as-Code Generator

A CLI workflow that turns plain-English requests like 'terraform for a highly available EKS' into ready-to-review IaC using aiac, with provider backends for OpenAI, Amazon Bedrock, or a local Ollama model so prompts stay inside your environment.

What This Builds

Writing infrastructure-as-code is full of boilerplate: the same Terraform, Pulumi, CloudFormation, Dockerfile, and CI-pipeline shapes over and over. This recipe wires up aiac, an open-source AI infrastructure-as-code generator, so you can ask for a template in plain English and get reviewable code back at the command line.

Examples that work out of the box:

aiac terraform for a highly available eks
aiac pulumi golang for an s3 with sns notification
aiac dockerfile for a secured nginx
aiac github action that plans and applies terraform and sends a slack notification
aiac k8s manifest for a mongodb deployment
aiac opa policy that enforces readiness probe at k8s deployments

By default aiac prints the extracted code and opens an interactive shell where you can converse with the model, retry, refine (“region must be eu-central-1”), save to a file, or copy to the clipboard. The generated code is a starting point a human reviews and terraform plans — not an auto-apply.

The Stack

  • aiac (Apache-2.0) is both a CLI and a Go library. It composes the request, calls your chosen LLM backend, and extracts code into files.
  • Pluggable backends: OpenAI, Amazon Bedrock, or a local Ollama server. Backends are named in a TOML config (~/.config/aiac/aiac.toml), so you can keep separate staging and production backends and pick a default model per backend.
  • Terraform (or Pulumi, CloudFormation, k8s manifests, OPA, Dockerfiles) is the output target.

Step-by-Step Outline

  1. Install via brew, go install github.com/gofireflyio/aiac/v5@latest, or the ghcr.io/gofireflyio/aiac Docker image.
  2. Create ~/.config/aiac/aiac.toml with a named backend. For an air-gapped flow, use a local Ollama backend so prompts never leave your machine; for managed flows, use a Bedrock backend with an AWS profile and region.
  3. Generate interactively: aiac terraform for a highly available eks, then refine in the shell.
  4. Save and wire into a real workflow: aiac terraform for eks --output-file=eks.tf, or non-interactive aiac terraform for eks -q to pipe into a script.
  5. Review and validate: run terraform fmt / terraform plan (or kubectl --dry-run, opa test) before anything is applied. Treat generated code as a draft PR, not a deploy.

Source