diff --git a/internal/stacks/stackconfig/config.go b/internal/stacks/stackconfig/config.go index 88e67d6361..b369e0c753 100644 --- a/internal/stacks/stackconfig/config.go +++ b/internal/stacks/stackconfig/config.go @@ -27,6 +27,12 @@ const maxEmbeddedStackNesting = 20 // so on for arbitrary levels of nesting. type Config struct { Root *ConfigNode + + // Sources is the source bundle that the configuration was loaded from. + // + // This is also the source bundle that any Terraform modules used by + // components should be loaded from. + Sources *sourcebundle.Bundle } // ConfigNode represents a node in a tree of stacks that are to be planned and @@ -66,7 +72,8 @@ func LoadConfigDir(sourceAddr sourceaddrs.FinalSource, sources *sourcebundle.Bun } ret := &Config{ - Root: rootNode, + Root: rootNode, + Sources: sources, } // Before we return we need to walk the tree and resolve all of the diff --git a/internal/stacks/stackruntime/internal/stackeval/stack.go b/internal/stacks/stackruntime/internal/stackeval/stack.go index d5cb196f1c..ce1dfac734 100644 --- a/internal/stacks/stackruntime/internal/stackeval/stack.go +++ b/internal/stacks/stackruntime/internal/stackeval/stack.go @@ -198,6 +198,7 @@ func (s *Stack) InputsType(ctx context.Context) (cty.Type, *typeexpr.Defaults) { atys[vAddr.Name] = cfg.TypeConstraint() if def := cfg.DefaultValue(ctx); def != cty.NilVal { defs.DefaultValues[vAddr.Name] = def + opts = append(opts, vAddr.Name) } if childDefs := cfg.NestedDefaults(); childDefs != nil { defs.Children[vAddr.Name] = childDefs