write_resource_file
Creates or updates Terraform resource files like main.tf and variables.tf within a module directory. Updates to outputs.tf are handled separately.
Instructions
Writes a Terraform resource file (main.tf, variables.tf, etc.) to a module directory.
Does NOT allow writing output(s).tf here. To update outputs.tf, use write_outputs().
Args: module_path (str): Path to the module directory. file_name (str): Name of the file to write (e.g., "main.tf", "variables.tf"). content (str): Content to write to the file.
Returns: str: JSON string with success, message, instructions, and optional error/data fields.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"module_path": "<module_path>",
"file_name": "<file_name>",
"content": "<content>"
},
"name": "write_resource_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| module_path | Yes | ||
| file_name | Yes | ||
| content | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |