Start-up - Export the env file's variables for other libraries (the Cloud provider's client) into the process environment; the app's own settings and secrets are never exported, and a value already in the environment wins. - Use GOOGLE_GENAI_USE_ENTERPRISE in place of the deprecated GOOGLE_GENAI_USE_VERTEXAI. Target architect - Look each distinct resource type up once instead of once per setting: in the run of 2026-10-07 it made 39 lookups for 8 types and exhausted its budget. terraform_schema's find takes several names; budget 30 to 45. - A cut-off schema outline says so. Removed, as leftovers of the original pipeline that nothing read - terraform/ (no longer passed terraform validate), scripts/validate.sh, tests/test_package.py and the CI steps that ran on them. - The sample outputs under docs/ and requirements.yaml. - CI now pins Terraform 1.14.3, as the container image does. Plans record the case 01 run: completed at 100% in 18 minutes with no Revision, against 60 minutes and warnings before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3.2 KiB
name, description, metadata
| name | description | metadata | ||
|---|---|---|---|---|
| iac-validation | Checks Terraform infrastructure-as-code without provisioning anything, using the local terraform_fmt, terraform_validate, terraform_plan and terraform_schema tools. Use when writing deployment guidance or validating it before deployment. |
|
IaC validation
Every check runs on a scratch copy of your Terraform files. Nothing is applied, and no state is written.
The files are your working copy: the files you wrote with write_file, or, when you are validating, the files that were submitted. Pass the tools no files.
Tools
terraform_fmt(): formats your working copy in place and names the files it changed.terraform_validate(): runsinit -backend=falseandvalidateoffline. It reports syntax errors, unknown references, missing variables and invalid arguments.terraform_plan(variables): previews the changes against the live cloud environment. It reads live state, so the first call may pause for the user's permission. Pass every variable the configuration requires.terraform_schema(resource_type, block, find): what a resource type accepts, from the provider's own schema. Withresource_typealone it lists the top-level arguments and outlines every block. Withblock, such astemplate.containers, it gives that block's arguments in full. Withfind, it says where an argument or block of that name sits, or that the resource type has none; give several names separated by commas to check them in one call.
When writing deployment guidance
- Run
terraform_fmt, thenterraform_validate. - Fix each error with
edit_file, changing only the lines concerned, and runterraform_validateagain until it passes. - On "An argument named X is not expected here" or "Unsupported block type", call
terraform_schemawithfindset to the name. It is either in a different block, which the reply names, or it does not exist on that resource type. Never move it around by trial.
When validating deployment guidance
-
Run
terraform_validate, and report its verdict and output. -
When permission to read the live environment is granted, run
terraform_planwith the variable values from the requirements, or clearly marked placeholders. Summarise the resources to add, change and destroy, and flag any destroy or replace. -
When a check can't run (a missing CLI, a refused permission or a provider download failure), give the user the exact commands to run themselves:
terraform init -backend=false terraform validate terraform plan -lock=false -var-file=<your.tfvars>
Reporting verdicts
Give a verdict on every Check in the Target architecture and attach them as verdicts.json, in the format the requirements-chain Skill gives. The dry-run's result goes in its dry_run entry: pass when terraform_validate passes, fail with the error when it does not, and not_run when the tool could not run.
A Check fails when the code could meet it and does not. When terraform_schema shows the resource type has no such setting, no code could meet it: the verdict is not_verifiable, with the schema's answer as evidence.
Never suggest terraform apply as part of validation.