From 2f85b47586093d441b62c8daf797293636ed6ab9 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Sat, 10 Mar 2018 10:02:45 -0800 Subject: [PATCH] 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. --- configs/configupgrade/doc.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 configs/configupgrade/doc.go diff --git a/configs/configupgrade/doc.go b/configs/configupgrade/doc.go new file mode 100644 index 000000000..aa3267434 --- /dev/null +++ b/configs/configupgrade/doc.go @@ -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