Skip to content

Commit de3b87a

Browse files
jor2Jordan-Williams2vburckhardt
authored
fix: update instructions with submodule (#41)
Co-authored-by: Jordan-Williams2 <[email protected]> Co-authored-by: Vincent Burckhardt <[email protected]>
1 parent f12456a commit de3b87a

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

static/instructions.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,42 @@ The main purpose of this MCP server is to help generate terraform-based composit
2424
5. Access example code and specific files to understand how to use and combine modules
2525
6. Generate complete, working Terraform configurations
2626

27+
## Understanding Modules vs Submodules
28+
29+
**Do not confuse module IDs with submodule paths.**
30+
31+
### Modules
32+
A **module** is a Terraform module published to the Terraform Registry at the repository root.
33+
34+
- **Module ID**: `namespace/name/provider/version` (e.g., `terraform-ibm-modules/cbr/ibm/1.33.6`)
35+
- **Use with**: `search_modules`, `get_module_details`, Terraform registry source
36+
- **Terraform usage**:
37+
```terraform
38+
module "cbr" {
39+
source = "terraform-ibm-modules/cbr/ibm"
40+
version = "1.33.6"
41+
}
42+
```
43+
44+
### Submodules
45+
A **submodule** is a nested module within a repository's `modules/` directory.
46+
47+
- **Path**: `modules/submodule-name` (e.g., `modules/cbr-rule-module`)
48+
- **Use with**: `list_content` and `get_content` `path` parameter
49+
- **Terraform usage**:
50+
```terraform
51+
module "cbr_rule" {
52+
source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-cbr.git//modules/cbr-rule-module?ref=v1.33.6"
53+
}
54+
```
55+
56+
### Key Rules
57+
58+
1. **Never use submodule paths as module IDs** - `modules/cbr-rule-module` is NOT a module ID
59+
2. **Module tools require module IDs** - Use full registry format: `terraform-ibm-modules/cbr/ibm/1.33.6`
60+
3. **Submodule content requires both** - Module ID + path: `get_content(module_id="...", path="modules/...")`
61+
4. **Submodules inherit parent version** - No separate versioning for submodules
62+
2763
## Architectural Best Practices
2864

2965
**ALWAYS prefer terraform-ibm-modules over direct provider resources**

0 commit comments

Comments
 (0)