From fe0957deb7e6c1c839b0efa98de5c563485bad3b Mon Sep 17 00:00:00 2001 From: James Bardin Date: Tue, 17 Oct 2017 18:55:38 -0400 Subject: [PATCH] hcl2 maps now work --- config/loader_hcl2.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/config/loader_hcl2.go b/config/loader_hcl2.go index bcc671fdf..4f9f129f2 100644 --- a/config/loader_hcl2.go +++ b/config/loader_hcl2.go @@ -82,12 +82,11 @@ func (t *hcl2Configurable) Config() (*Config, error) { Config hcl2.Body `hcl:",remain"` } type module struct { - Name string `hcl:"name,label"` - Source string `hcl:"source,attr"` - Version *string `hcl:"version,attr"` - // FIXME, maps not working - // Providers *map[string]string `hcl:"providers,attr"` - Config hcl2.Body `hcl:",remain"` + Name string `hcl:"name,label"` + Source string `hcl:"source,attr"` + Version *string `hcl:"version,attr"` + Providers *map[string]string `hcl:"providers,attr"` + Config hcl2.Body `hcl:",remain"` } type resourceLifecycle struct { CreateBeforeDestroy *bool `hcl:"create_before_destroy,attr"` @@ -256,9 +255,9 @@ func (t *hcl2Configurable) Config() (*Config, error) { m.Version = *rawM.Version } - //if rawM.Providers != nil { - // m.Providers = *rawM.Providers - //} + if rawM.Providers != nil { + m.Providers = *rawM.Providers + } config.Modules = append(config.Modules, m) }