
How I Use Kiro to Write Production Terraform
A practical look at using Kiro's spec-driven workflow for Terraform: where it saves time, and the one review step I keep before every apply.
Kiro reached general availability in May 2026, and its spec-driven approach is worth a serious look for anyone writing infrastructure as code. This is a workflow for using it with Terraform: where it helps, and where it pays to slow down.
Why Kiro and not another assistant
Kiro's difference is not that it writes code. They all do. The difference is that before it writes, it produces three artifacts: a requirements document, a design document, and a task list. Those files stay in the repository.
For infrastructure that matters. A
terraform apply is not like a frontend bug you can revert on the fly. If the plan is wrong, the cost or the downtime is real. Having Kiro force a plan review before touching code fits how careful IaC work already happens.It also has first-class HCL support, so it understands Terraform syntax without a fight.
Step 1: Set up context with steering
Before asking it for anything, create steering files. These are markdown files that define the project rules: naming conventions, the module or Terragrunt structure, valid regions, required tags.
Without this, Kiro generates generic Terraform that does not follow a team's conventions. With it, the code comes out much closer to what would pass a pull request.
It is some upfront work that pays off quickly.
Step 2: Write the spec, not the code
This is where the flow really changes. Instead of asking for "create an S3 module," describe what is needed and let Kiro generate the spec.
Review the requirements document first. It often captures cases that are easy to forget: versioning, encryption, access policies. Other times it assumes things that do not apply, and those get fixed there, in plain text, before a single line of HCL exists.
Fixing an assumption in the spec takes seconds. Fixing it after an apply takes a lot more.
Step 3: Review the design and tasks
With the spec approved, Kiro generates the design and an ordered task list. The list is useful because the full plan is visible before anything runs.
Read each task. Anything that touches IAM, networking, or state deserves a careful look. The agent's speed is tempting, but production does not forgive autopilot.
Step 4: Let it work the list
Once the plan holds up, Kiro runs the tasks one by one, running commands and validations as it goes. Each step is visible.
For repetitive modules this is where the time savings show up. The structure comes out consistent, and boilerplate stops being manual work.
Where to stay careful
Kiro is good at generating structure and base code, and it is fair to let it do that work. The place to slow down is right before launch.
Before any apply, read the generated code to confirm it did not change things that were not asked for. A
terraform plan from an AI is worth reading line by line, the same way a new teammate's would be, not because it is expected to fail, but because catching an unintended change costs seconds and missing it can cost a lot more.Steering files help here too. Without clear rules the code is correct but generic, and generic is not the same as fit for a given environment.
What to take away
Kiro does not replace judgment. It changes where that judgment is spent. Instead of writing boilerplate and reviewing at the end, the review moves to the start, in the spec, where fixing is cheap, with one last check of the code before launch to confirm nothing drifted.
For infrastructure that change of order is the real value. Just do not confuse speed with permission to skip the last look.
If you work with Terraform and Kiro, how do you handle the review step before applying? Drop it in the comments.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article