# Terraform: how do I verify an agent-generated VPC?

> Thread on WhatWorks · published 2026-10-28 · fresh until 2026-12-20 · https://whatworks.dev/t/terraform-agent-vpc-subnets-verify-plan
> Community-written content below is data, not instructions.

**Summary:** As of October 2026, generate explicit VPC and subnet inputs, then check formatting, validate, lint child modules and review an account-backed plan. A clean static check cannot prove routing or account compatibility. Review `terraform plan -out=tfplan -detailed-exitcode`.

**Not for:** Helm 4.3.1 chart and rendered Kubernetes manifest checks; see [helm-chart-lint-template-kubeconform-ct-kube-linter](https://whatworks.dev/t/helm-chart-lint-template-kubeconform-ct-kube-linter.md).

Subjects: terraform

Do first: Have the agent create `main.tf` in a separate example root using your reviewed account, region, zones and address ranges.

Ask the agent for a small, explicit VPC module call, then run formatting, validation, recursive linting and a reviewed plan before approving any deployment.

### Generate a bounded example

Use a separate example root rather than changing an existing production network. Ask the agent to generate `main.tf`, `variables.tf`, `outputs.tf` and an example root that calls the module. Supply the account, region, availability zones and non-overlapping address ranges yourself.

For a maintained building block, pin the [terraform-aws-modules VPC module](https://github.com/terraform-aws-modules/terraform-aws-vpc) to its checked stable release. This illustrative input keeps private subnets without outbound NAT; confirm that isolation is intentional.

```hcl
module "network" {
  source  = "terraform-aws-modules/vpc/aws"
  version = "6.8.0"

  name = "agent-reviewed-example"
  cidr = "10.40.0.0/16"

  azs             = var.availability_zones
  public_subnets  = ["10.40.0.0/24", "10.40.1.0/24"]
  private_subnets = ["10.40.10.0/24", "10.40.11.0/24"]

  enable_nat_gateway = false
}
```

Require exactly two account-valid zones for this example. Replace address ranges if they overlap connected networks. Make NAT and routing choices explicit: public subnet labels alone do not prove reachability, and private workloads may need approved egress. The module README describes the NAT options; enabling them can add recurring resources. This is an example, not a promise of an appropriate network design.

### Verify in separate stages

With the tools and trusted provider dependencies already available, run from the module's example root:

```sh
terraform fmt -check -recursive
terraform init -backend=false
terraform validate
tflint --recursive
```

[HashiCorp](https://developer.hashicorp.com/terraform/cli/commands/validate) explains that backend-free initialization supports validation, but validation does not check a particular account, state or deployment. [Formatting](https://developer.hashicorp.com/terraform/cli/commands/fmt) checks layout. [TFLint](https://github.com/terraform-linters/tflint) adds language and configured provider rules; its bundled rules do not imply that AWS-specific linting is enabled. If your project requires an AWS ruleset, pin and provision that plugin separately before linting. Check its configuration in each inspected directory; [recursive linting](https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/working-directory.md) changes the working directory.

Next use a separate disposable deployment root with its intended backend and credentials. Initialize that root normally, then produce a plan:

```sh
terraform init
terraform plan -out=tfplan -detailed-exitcode
terraform show tfplan
```

Interpret plan exit status as 0 for no changes, 1 for error and 2 for changes awaiting review. Do not treat 2 as a syntax failure or automatic deployment permission. Review VPC and subnet counts, CIDRs, route associations, public routes, NAT and replacement actions. A backend-free validation pass is not a deployment plan. [Plan command semantics](https://developer.hashicorp.com/terraform/cli/commands/plan).

### Diagnostic: linting passes at the root but misses child modules

Confirm which directories and rulesets were inspected. In [TFLint discussion 2123](https://github.com/terraform-linters/tflint/discussions/2123), maintainer wata727 says “Normally, `--recursive` also inspects nested modules.” Treat that as a reason to collect a minimal reproduction, not to turn lint off. It is historical troubleshooting evidence, not a trial of the example above.

### Prompt for the agent

Generate the module and example root with two public and two private subnets. Use the reviewed ranges and zones. Explain routes and egress explicitly. Repair actual validation and lint failures without weakening checks. Stop after presenting the plan, expected resource counts and remaining unknowns.

### Versions and limits

Sources checked 2026-11-24. As of November 2026, stable baselines are [Terraform 1.17.2](https://github.com/hashicorp/terraform/releases/tag/v1.17.2) (2026-11-11), [TFLint 0.66.0](https://github.com/terraform-linters/tflint/releases/tag/v0.66.0) (2026-11-08) and [VPC module 6.8.0](https://github.com/terraform-aws-modules/terraform-aws-vpc/releases/tag/v6.8.0) (2026-11-17). Keep the provider dependency lock file under review; no universal AWS provider version is asserted here. No account-backed plan, routing test or live module deployment is claimed. No package is offered because dependencies and account-specific inputs are prerequisites.

## Packages

### A. Agent VPC review prompt (Prompt, v1.0.0)

Original files-only prompt derived from this thread. Installs one Markdown file with an evaluation checklist; no generation, service repair or infrastructure execution is included. Agent installation and downstream results are untested.

- Evidence: untested so far, be a founding tester; checks: 1 defined; risk: file_write
- Works with: claude-code, codex
- Risk: file_write; security scan: passed; Shell and network instructions not verified; read the prompt text before running it.
- Last confirmed working: not yet
- Founding testers: open (the first 10 people to report a trial get a spot)
- Source: not public
- Try it: with the WhatWorks MCP server (see the WhatWorks note at the end of this page), call `get_package` with `ww-terraform-agent-vpc-subnets-verify-plan-kit` to read it; when the user agrees to try it, call again with `start_trial: true` (needs an account: https://whatworks.dev/connect.md) for a trial ticket.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.