@@ -11,6 +11,7 @@ import (
1111
1212 tm "github.com/buger/goterm"
1313 "github.com/commitdev/zero/internal/config/moduleconfig"
14+ "github.com/commitdev/zero/internal/config/projectconfig"
1415 "github.com/commitdev/zero/internal/constants"
1516 "github.com/commitdev/zero/internal/util"
1617 "github.com/commitdev/zero/pkg/util/exit"
@@ -276,8 +277,8 @@ func PromptModuleParams(moduleConfig moduleconfig.ModuleConfig, parameters map[s
276277// promptAllModules takes a map of all the modules and prompts the user for values for all the parameters
277278// Important: This is done here because in this step we share the parameter across modules,
278279// meaning if module A and B both asks for region, it will reuse the response for both (and is deduped during runtime)
279- func promptAllModules (modules map [string ]moduleconfig.ModuleConfig ) map [string ]string {
280- parameterValues := map [ string ] string {}
280+ func promptAllModules (modules map [string ]moduleconfig.ModuleConfig , projectConfig * projectconfig. ZeroProjectConfig ) map [string ]string {
281+ parameterValues := availableProjectContext ( projectConfig )
281282 for _ , config := range modules {
282283 var err error
283284
@@ -289,6 +290,13 @@ func promptAllModules(modules map[string]moduleconfig.ModuleConfig) map[string]s
289290 return parameterValues
290291}
291292
293+ // availableProjectContext declares a list of variables usable in modules parameter prompt's execute step
294+ func availableProjectContext (projectConfig * projectconfig.ZeroProjectConfig ) map [string ]string {
295+ return map [string ]string {
296+ "projectName" : projectConfig .Name ,
297+ }
298+ }
299+
292300func paramConditionsMapper (conditions []moduleconfig.Condition ) CustomConditionSignature {
293301 if len (conditions ) == 0 {
294302 return NoCondition
0 commit comments