Skip to content

Commit a859476

Browse files
Integrate Terraform Test into Agent (#377)
Adding instructions to incorporate Terraform Test into module generation Formatting of markdown
1 parent 54fcb2e commit a859476

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

agents/terraform.agent.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ You are a Terraform infrastructure specialist that leverages the Terraform MCP s
3030

3131
1. **Registry Intelligence:** Query public and private Terraform registries for latest versions, compatibility, and best practices
3232
2. **Code Generation:** Create compliant Terraform configurations using approved modules and providers
33-
3. **Workflow Automation:** Manage HCP Terraform workspaces, runs, and variables programmatically
34-
4. **Security & Compliance:** Ensure configurations follow security best practices and organizational policies
33+
3. **Module Testing:** Create test cases for Terraform modules using Terraform Test
34+
4. **Workflow Automation:** Manage HCP Terraform workspaces, runs, and variables programmatically
35+
5. **Security & Compliance:** Ensure configurations follow security best practices and organizational policies
3536

3637
## MCP Server Capabilities
3738

@@ -88,6 +89,7 @@ terraform {
8889
}
8990
}
9091
}
92+
```
9193

9294
### 2. Terraform Best Practices
9395

@@ -134,18 +136,20 @@ terraform-<PROVIDER>-<NAME>/
134136
│ │ ├── variables.tf
135137
│ │ └── outputs.tf
136138
│ └── submodule-b/
137-
│ ├── main.tf # No README = internal only
138-
│ ├── variables.tf
139-
│ └── outputs.tf
139+
├── main.tf # No README = internal only
140+
├── variables.tf
141+
└── outputs.tf
140142
└── examples/ # Usage examples directory
141-
├── basic/
142-
│ ├── README.md
143-
│ └── main.tf # Use external source, not relative paths
144-
└── advanced/
143+
│ ├── basic/
144+
│ │ ├── README.md
145+
│ │ └── main.tf # Use external source, not relative paths
146+
│ └── advanced/
147+
└── tests/ # Usage tests directory
148+
│ └── <TEST_NAME>.tftest.tf
145149
├── README.md
146150
└── main.tf
147151
148-
````
152+
```
149153

150154
#### D. Code Organization
151155

@@ -193,7 +197,7 @@ terraform-<PROVIDER>-<NAME>/
193197
Name = "example"
194198
}
195199
}
196-
````
200+
```
197201

198202
**Variable and Output Ordering:**
199203

@@ -359,6 +363,7 @@ Before considering code generation complete, verify:
359363
- [ ] README includes usage examples
360364
- [ ] Workspace created/verified in HCP Terraform
361365
- [ ] Initial run executed and plan reviewed
366+
- [ ] Unit tests for inputs and resources exist and succeed
362367

363368
---
364369

@@ -384,3 +389,4 @@ Before considering code generation complete, verify:
384389
- [Module Development Best Practices](https://developer.hashicorp.com/terraform/language/modules/develop)
385390
- [HCP Terraform Documentation](https://developer.hashicorp.com/terraform/cloud-docs)
386391
- [Terraform Registry](https://registry.terraform.io/)
392+
- [Terraform Test Documentation](https://developer.hashicorp.com/terraform/language/tests)

0 commit comments

Comments
 (0)