Ready to Work Together?
Let's discuss how our expertise can help transform your business.
Alex Podobnik
·
Apr 24, 2026
Most LLM-generated Terraform is bad. You ask for a module, you get something that looks right, and then terraform validate lights up with errors. Provider blocks inside child modules, every variable typed as string, no tags, no outputs.
But the problem usually isn't the tool. It's the prompt. With some upfront work you can get scaffolds that are close to merge-ready. Here's how we do it at NextLink Labs.
You can use the chat interface for this, but Claude Code is better. It reads your existing modules, picks up on conventions, and writes files directly into your repo. No copy-pasting. Just cd into your Terraform repo root and go.
Before asking for any resources, lay out your conventions. Most people skip this and then wonder why the output doesn't match their style.
If you're using Claude Code, the best way to do this is with a CLAUDE.md file at your repo root. Claude Code reads it automatically at the start of every session, so you set your conventions once and they stick across every future interaction. No re-prompting.
Here's what ours looks like:
This kills about 80% of the cleanup you'd otherwise do. You can also add project-specific context in there, like naming conventions or which AWS accounts map to which environments. The more you put in CLAUDE.md, the less you repeat yourself in prompts.
Don't just say "create an EKS module." Tell it what goes in, what comes out, and what the module owns.
If you're vague about boundaries, Claude fills the gaps. Sometimes that's fine. Other times your EKS module comes back with things that aren't relevant.
Go through the output file by file.
You will find issues. Don't start over. Just tell Claude what's wrong.
Same as code review. You don't rewrite a whole PR over a missing policy attachment.
fmt fixes formatting. validate catches syntax problems. plan is the one that actually matters because it'll surface bad ARN formats, broken references, and missing data sources.
In Claude Code you can have it run these and fix whatever breaks. That feedback loop is fast.
Running these checks locally is fine while you're iterating. But once the module is in a merge request, you want the same checks running automatically. Here's a basic GitLab CI pipeline that does that:
Nothing too complicated. Three stages: fmt checks that formatting is clean, validate catches syntax issues without needing a backend, and plan runs on merge requests so reviewers can see what the module actually produces. The -backend=false flag on validate is important because you don't want your lint stage needing cloud credentials.
In practice you'll probably want to add your AWS credentials as CI/CD variables and maybe cache the .terraform directory so init isn't slow on every run. But this covers the basics and catches the same things you'd catch locally.
This doesn't replace knowing Terraform. You still need to know what resources you need and where to draw module boundaries. What it saves you is the 30 to 60 minutes of boilerplate writing that doesn't require much thought.
We've been doing this internally at NextLink and it's cut our time to first review pretty significantly. The generated code is never perfect, but a 90% scaffold that needs some cleanup beats an empty main.tf.
Be specific about conventions. Describe boundaries, not just resources. And run terraform plan before you trust anything.
Author at NextLink Labs
One account becomes five, and eventually nobody knows which guardrails are where. Here's how NextLink Labs manages AWS Organizations, OU hierarchies, and Service Control Policies with Terraform and GitLab CI.
Colin Soleim
·
Apr 22, 2026
One account becomes five, and eventually nobody knows which guardrails are where. Here's how NextLink Labs manages AWS Organizations, OU hierarchies, and Service Control Policies with Terraform and GitLab CI.
Alex Podobnik
·
Apr 22, 2026
Claude Code works great on 50-line demos. Large Rails codebases are different. Here's how NextLink Labs configures CLAUDE.md, MCP servers, custom skills, and permission hooks to make Claude genuinely productive on real production code.
Colin Soleim
·
Apr 15, 2026
Let's discuss how our expertise can help transform your business.