configupgrade: new package for upgrading configs for 0.12

Although the new HCL implementation and configuration loader is broadly
compatible with the prior implementation, it has a number of new idiomatic
forms and it also cannot parse some more extreme non-idiomatic usages
that were possible under the old parser.

To help users migrate to the new implementation, this package will rewrite
configuration to comply with the new idiom and fix as many cases as
possible where the legacy parser was too liberal or exposed implementation
details.
This commit is contained in:
Martin Atkins 2018-03-10 10:02:45 -08:00
parent fc0e28b2b4
commit 2f85b47586
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
// Package configupgrade upgrades configurations targeting our legacy
// configuration loader (in package "config") to be compatible with and
// idiomatic for the newer configuration loader (in package "configs").
//
// It works on one module directory at a time, producing new content for
// each existing .tf file and possibly creating new files as needed. The
// legacy HCL and HIL parsers are used to read the existing configuration
// for maximum compatibility with any non-idiomatic constructs that were
// accepted by those implementations but not accepted by the new HCL parsers.
//
// Unlike the loaders and validators elsewhere in Terraform, this package
// always generates diagnostics with paths relative to the module directory
// currently being upgraded, with no intermediate paths. This means that the
// filenames in these ranges can be used directly as keys into the ModuleSources
// map that the file was parsed from.
package configupgrade