diff --git a/configs/config_build.go b/configs/config_build.go index 8f7fa6b16d..948b2c8ffd 100644 --- a/configs/config_build.go +++ b/configs/config_build.go @@ -5,6 +5,7 @@ import ( version "github.com/hashicorp/go-version" "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/terraform/addrs" ) // BuildConfig constructs a Config from a root module by loading all of its @@ -123,7 +124,7 @@ type ModuleRequest struct { // this module. This can be used, for example, to form a lookup key for // each distinct module call in a configuration, allowing for multiple // calls with the same name at different points in the tree. - Path []string + Path addrs.Module // SourceAddr is the source address string provided by the user in // configuration. diff --git a/configs/configload/module_manifest.go b/configs/configload/module_manifest.go index 777f3a282f..0a2348be82 100644 --- a/configs/configload/module_manifest.go +++ b/configs/configload/module_manifest.go @@ -5,9 +5,10 @@ import ( "fmt" "os" "path/filepath" - "strings" version "github.com/hashicorp/go-version" + + "github.com/hashicorp/terraform/addrs" ) // moduleRecord represents some metadata about an installed module, as part @@ -43,8 +44,8 @@ type moduleRecord struct { // it to reflect any changes to the installed modules. type moduleManifest map[string]moduleRecord -func manifestKey(path []string) string { - return strings.Join(path, ".") +func manifestKey(path addrs.Module) string { + return path.String() } // manifestSnapshotFile is an internal struct used only to assist in our JSON