hcl2 maps now work

This commit is contained in:
James Bardin 2017-10-17 18:55:38 -04:00
parent 2e505083cd
commit fe0957deb7
1 changed files with 8 additions and 9 deletions

View File

@ -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)
}