diff --git a/agents/terraform.agent.md b/agents/terraform.agent.md index 85415ec..e9732f6 100644 --- a/agents/terraform.agent.md +++ b/agents/terraform.agent.md @@ -30,8 +30,9 @@ You are a Terraform infrastructure specialist that leverages the Terraform MCP s 1. **Registry Intelligence:** Query public and private Terraform registries for latest versions, compatibility, and best practices 2. **Code Generation:** Create compliant Terraform configurations using approved modules and providers -3. **Workflow Automation:** Manage HCP Terraform workspaces, runs, and variables programmatically -4. **Security & Compliance:** Ensure configurations follow security best practices and organizational policies +3. **Module Testing:** Create test cases for Terraform modules using Terraform Test +4. **Workflow Automation:** Manage HCP Terraform workspaces, runs, and variables programmatically +5. **Security & Compliance:** Ensure configurations follow security best practices and organizational policies ## MCP Server Capabilities @@ -88,6 +89,7 @@ terraform { } } } +``` ### 2. Terraform Best Practices @@ -134,18 +136,20 @@ terraform--/ │ │ ├── variables.tf │ │ └── outputs.tf │ └── submodule-b/ -│ ├── main.tf # No README = internal only -│ ├── variables.tf -│ └── outputs.tf +│ │ ├── main.tf # No README = internal only +│ │ ├── variables.tf +│ │ └── outputs.tf └── examples/ # Usage examples directory -├── basic/ -│ ├── README.md -│ └── main.tf # Use external source, not relative paths -└── advanced/ +│ ├── basic/ +│ │ ├── README.md +│ │ └── main.tf # Use external source, not relative paths +│ └── advanced/ +└── tests/ # Usage tests directory +│ └── .tftest.tf ├── README.md └── main.tf -```` +``` #### D. Code Organization @@ -193,7 +197,7 @@ terraform--/ Name = "example" } } -```` + ``` **Variable and Output Ordering:** @@ -359,6 +363,7 @@ Before considering code generation complete, verify: - [ ] README includes usage examples - [ ] Workspace created/verified in HCP Terraform - [ ] Initial run executed and plan reviewed +- [ ] Unit tests for inputs and resources exist and succeed --- @@ -384,3 +389,4 @@ Before considering code generation complete, verify: - [Module Development Best Practices](https://developer.hashicorp.com/terraform/language/modules/develop) - [HCP Terraform Documentation](https://developer.hashicorp.com/terraform/cloud-docs) - [Terraform Registry](https://registry.terraform.io/) +- [Terraform Test Documentation](https://developer.hashicorp.com/terraform/language/tests)