@@ -125,16 +125,17 @@ func ProcessConfig(stack string, config map[interface{}]interface{}) (map[interf
125
125
126
126
baseComponentVars := map [interface {}]interface {}{}
127
127
baseComponentBackend := map [interface {}]interface {}{}
128
+ baseComponentName := ""
128
129
129
- if baseComponentName , ok2 := componentMap ["component" ]; ok2 {
130
- baseComponent := baseComponentName .(string )
130
+ if baseComponent , ok2 := componentMap ["component" ]; ok2 {
131
+ baseComponentName = baseComponent .(string )
131
132
132
- if baseComponentMap , ok3 := allTerraformComponents [baseComponent ].(map [interface {}]interface {}); ok3 {
133
+ if baseComponentMap , ok3 := allTerraformComponents [baseComponentName ].(map [interface {}]interface {}); ok3 {
133
134
baseComponentVars = baseComponentMap ["vars" ].(map [interface {}]interface {})
134
135
baseComponentBackend = baseComponentMap ["backend" ].(map [interface {}]interface {})[backendType ].(map [interface {}]interface {})
135
136
} else {
136
137
return nil , errors .New ("Terraform component '" + component .(string ) + "' defines attribute 'component: " +
137
- baseComponent + "', " + "but `" + baseComponent + "' is not defined in the stack '" + stack + "'" )
138
+ baseComponentName + "', " + "but `" + baseComponentName + "' is not defined in the stack '" + stack + "'" )
138
139
}
139
140
}
140
141
@@ -152,6 +153,11 @@ func ProcessConfig(stack string, config map[interface{}]interface{}) (map[interf
152
153
comp ["vars" ] = finalComponentVars
153
154
comp ["backend_type" ] = backendType
154
155
comp ["backend" ] = finalComponentBackend
156
+
157
+ if baseComponentName != "" {
158
+ comp ["component" ] = baseComponentName
159
+ }
160
+
155
161
terraformComponents [component ] = comp
156
162
}
157
163
}
0 commit comments