File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,42 @@ The main purpose of this MCP server is to help generate terraform-based composit
24245 .  Access example code and specific files to understand how to use and combine modules
25256 .  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** 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments