terraform

terraform is a cursor rule for Cursor from iloveitaly/llm-ide-rules. It costs 0 tokens per session (1,866 once invoked), scanned A, original, MIT.

A Cursor rule set for Terraform configuration and project file structure. Terraform is a tool for describing and managing infrastructure with code.

In plain words
What is it for?
It is for guiding edits to Terraform projects, including provider files, variables, remote state, worker settings, and commands defined in a Justfile.
Why use it?
It tells an agent how to handle secrets, modules, variables, outputs, and state files before changing infrastructure code. This helps prevent unsafe secret handling and inconsistent project structure.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit It is for guiding edits to Terraform projects, including provider files, variables, remote state, worker settings, and commands defined in a Justfile.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/iloveitaly/llm-ide-rules/terraform
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/iloveitaly/llm-ide-rules

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for terraform

README.md
[![agentmods](https://agentmods.dev/badge/rules/iloveitaly/llm-ide-rules/terraform/github.svg)](https://agentmods.dev/rules/iloveitaly/llm-ide-rules/terraform)
Your own site
<a href="https://agentmods.dev/rules/iloveitaly/llm-ide-rules/terraform"><img src="https://agentmods.dev/badge/rules/iloveitaly/llm-ide-rules/terraform/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for terraform

Your own site · 80×15
<a href="https://agentmods.dev/rules/iloveitaly/llm-ide-rules/terraform"><img src="https://agentmods.dev/badge/rules/iloveitaly/llm-ide-rules/terraform.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,866 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01866
Opus 5.5 $0.00000 $0.00746
Sonnet 5.5 $0.00000 $0.00373
Haiku 4.5 $0.00000 $0.00187

Measured yesterday against content hash b5954609e3e8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

terraform scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/terraform.mdc · 129 lines

How it starts

The opening of the file, as written. The whole thing — 129 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Terraform

Terraform code is very important because it controls production systems. For this reason, it's critical that agents should never:

  1. Modify production systems using CLI tools for cloud providers such as gcloud, az, etc unless explicitly asked
  2. Be able to run terraform directly via tofu apply. Terraform must be designed to run only via just apply.
  3. Justfile execution must be guarded against agent execution using is-ai-agent.

Instructions when writing terraform:

  • Implement the requested behavior directly. Add a boolean, feature flag, or optional setting only when I explicitly request configurability or the feature needs to support multiple modes. If quota, permissions, or cost block deployment, report the blocker and use the existing plan and apply workflow. Don’t add a toggle as a precaution.
  • All "bootstrap" secrets (i.e. vars required to run the terraform code) should be exported in the Justfile. The Justfile is guarded so agents cannot run it, ensuring that required secrets are not available to agents ensures that terraform cannot be run by an agent.
  • Don't add a locals for a variable only used a single time
  • Don't add output resources unless specifically asked
  • Use ~> 9.9.0 style provider version pinning
  • Always assume you are using or can use the latest version of a terraform module. Never workaround a missing feature that has been added to a terraform module.
  • Consult the terraform MCP when using an external module. Module surfaces change often.
  • When creating a cloudflare worker, always set the compatibility_date to the current date.
  • When enabling Cloudflare Workers traces, do not set head_sampling_rate to 1. That value samples every request. The shared logs block uses 1 on purpose; do not copy it onto traces. Use 0.1 (10%) unless I explicitly ask for a different rate.
  • Do not add a unit test file or a Just recipe for a small Worker change. Change the Worker module and the Terraform that publishes it.
  • Uppercase all TF_VAR_*
  • Put locals at the top of the file
  • Reference Terraform-managed resources directly; add a data source only when a verified provider limitation requires it or the resource is managed elsewhere.
  • Add a one line comment at the top of each `.tf`` file describing it's purpose.
  • When using submodules, do not specify provider versions in the submodule. Let the root provider configuration specify the version.
  • Name Terraform resources using consistent <application_or_system>_ identifiers that communicate business ownership and function independently of cloud providers, environments, or incidental implementation details
  • Always add a description to any variable block.
  • If an SSH key is required for a VM, encryption, or something else I'll generate it manually in 1P and provide a UUID to reference.
  • Make infrastructure configuration changes in Terraform for the operator to apply. Use cloud CLIs, ssh, APIs, 1password, etc for read-only inspection and verification. Never make infrastructure changes directly.
  • Prefer pre-built, well-supported terraform modules for configuration over complicated shell scripts. By way of example, using system_file or system_folder over custom shell commands when creating files.
  • Prefer terraform_data with remote-exec over local-exec and ssh commands.
  • Never rewrite host headers, or any other headers, unless specifically asked to when setting up a Cloudflare Tunnel.
  • Don't worry about other users on the machine reading content. You can assume the data is safe during the terraform application process.
  • All 1Password references should use item uuids since they change less often than titles. However, the name of the item should be added in a comment the 1p resource. The uuid can change if the item was moved out of a vault, so the name helps us locate the uuid if this occurs.
    • 1P uuids should never be a variable and should always be hardcoded.
    • 1P items should always use consistent tags so it's easy to understand which items are system- vs user-created.

Read the full file on GitHub · 129 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed · +2 lines b5954609e3e8
  2. 9d ago Changed · +100 lines e754391a115e
  3. 1mo ago Changed · +2 lines c36dd71cc424
  4. 1mo ago Changed · +1 lines 19dae35bd964
  5. 1mo ago First seen · 24 lines · 0 tokens per session scan A 39903965b612

Subscribe to this mod's changes

terraform is a cursor rule published in the GitHub repository iloveitaly/llm-ide-rules (13 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,866 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-04.

Related

terraform compared with cursor rules from other repositories

terraform next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
terraformiloveitaly/llm-ide-rulesCursor rule13yesterdayMITA0Cursor
beanstalk-deploypr-pm/prpmCursor rule1251mo agoMITA0Cursor
ai-kbiamironz/ai-config-bundleCursor rule28mo agoMITA277Cursor
deploymentlevifig/rails-instructionsCursor rule571y agoMITA0Cursor
1002-terraformdavenicoll/cursor-rulesCursor rule111y agononeA2,247Cursor
1003-cdkdavenicoll/cursor-rulesCursor rule111y agononeA1,182Cursor
702-aws-well-architected-frameworkdavenicoll/cursor-rulesCursor rule111y agononeA789Cursor