Cloud-agnostic Terraform best practices and workflow guidelines for Cursor IDE. These rules help AI assistants provide better guidance when working with infrastructure as code.
This repository contains Cursor IDE rules that guide AI assistants on Terraform best practices. The rules are:
- Cloud-agnostic - Works with GCP, Azure, AWS, and other cloud providers
- Pattern-focused - Emphasizes universal infrastructure patterns, not cloud-specific implementations
- Modular - Pick only the rule files you need for your project
-
Copy the
.cursorfolder to your project root:cp -r .cursor /path/to/your/project/
-
That's it! Cursor will automatically load these rules.
| File | Description |
|---|---|
infrastructure.mdc |
General infrastructure rules (sequential operations, no background agents) |
terraform.mdc |
Core Terraform workflow patterns (targeted operations, state management) |
terraform-patterns.mdc |
Core patterns (provider config, dependencies, common issues) |
terraform-container.mdc |
Container service best practices (lifecycle management, deployment strategy) |
terraform-iam.mdc |
Identity and access management patterns |
terraform-secrets.mdc |
Secrets vault integration patterns |
terraform-api-gateway.mdc |
API Gateway configuration (for public-facing services) |
terraform-storage.mdc |
Cloud storage best practices |
Most rules are set to alwaysApply: false with glob patterns matching terraform/**/*.tf files, meaning they activate when editing Terraform files. The infrastructure.mdc rule is set to alwaysApply: true for general infrastructure guidance.
To change this behavior, edit the alwaysApply setting in any rule file.
MIT License - see LICENSE file for details.
Contributions welcome! If you have improvements or additional patterns, please open an issue or pull request.
Created by @simonasrazm and Contributors.