Add expansion transformer to eval graph

Add the expansion transformer to the eval graph,
which is used in rare scenarios which includes running
terraform console. Prevents panic when running terraform
console in contexts with module expansion
This commit is contained in:
Pam Selle 2020-04-27 13:09:08 -04:00
parent 9266e944fa
commit 6ee42efe16
1 changed files with 7 additions and 0 deletions

View File

@ -89,6 +89,13 @@ func (b *EvalGraphBuilder) Steps() []GraphTransformer {
// analyze the configuration to find references.
&AttachSchemaTransformer{Schemas: b.Schemas, Config: b.Config},
// Create expansion nodes for all of the module calls. This must
// come after all other transformers that create nodes representing
// objects that can belong to modules.
&ModuleExpansionTransformer{
Config: b.Config,
},
// Connect so that the references are ready for targeting. We'll
// have to connect again later for providers and so on.
&ReferenceTransformer{},