terraform/config/loader.go

20 lines
426 B
Go
Raw Normal View History

package config
// Load loads the Terraform configuration from a given file.
2014-05-24 00:32:34 +02:00
//
// This file can be any format that Terraform recognizes, and import any
// other format that Terraform recognizes.
func Load(path string) (*Config, error) {
importTree, err := loadTree(path)
if err != nil {
return nil, err
}
configTree, err := importTree.ConfigTree()
if err != nil {
return nil, err
}
return configTree.Flatten()
}