From 7987a2fdb25c892b7ec7eaee3f62efd7bd05fa77 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Thu, 1 Feb 2018 19:03:54 -0800 Subject: [PATCH] configs: new package for HCL2-based configuration There's a lot of complexity in our existing "config" package that results from our approach to handling configuration with HCL and HIL. A lot of that functionality is no longer needed -- or must work in a significantly different way -- for HCL2. The new package "configs", which is named following the convention of some Go standard library packages like "strings", is a re-imagination of some of the functionality from the "config" package for an HCL2-only world. The scope of this package will be slightly smaller than "config", since it only deals with config loading and not with expression evaluation. Another package "lang" (mentioned in the docstring here but not yet added) will deal with the more dynamic portions of of configuration handling, including populating an hcl.EvalContext to evaluate expressions. --- configs/doc.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 configs/doc.go diff --git a/configs/doc.go b/configs/doc.go new file mode 100644 index 0000000000..9688b36cd4 --- /dev/null +++ b/configs/doc.go @@ -0,0 +1,14 @@ +// Package configs contains types that represent Terraform configurations and +// the different elements thereof. +// +// The functionality in this package can be used for some static analyses of +// Terraform configurations, but this package generally exposes representations +// of the configuration source code rather than the result of evaluating these +// objects. The sibling package "lang" deals with evaluation of structures +// and expressions in the configuration. +// +// Due to its close relationship with HCL, this package makes frequent use +// of types from the HCL API, including raw HCL diagnostic messages. Such +// diagnostics can be converted into Terraform-flavored diagnostics, if needed, +// using functions in the sibling package tfdiags. +package configs