terraform/configs/configupgrade
Martin Atkins 966eb39427 configs/configupgrade: Default arguments in "connection" blocks
Prior to Terraform v0.12 it was possible for a provider to secretly set
some default arguments for the "connection" block, which most commonly
included a hard-coded type of "ssh" and a value from "host".

In the interests of "explicit is better than implicit", Terraform 0.12 no
longer has this feature and instead requires connection settings to be
written explicitly in terms of the resource's exported attributes. For
compatibility though, the upgrade tool will insert expressions that are
as close as possible to the logic the provider formerly implemented, or
in a few rare cases a TF-UPGRADE-TODO comment to fix it up manually.

Some of the existing resource type implementations have incredibly
complicated implementations of selecting a single host IP address to use
and don't expose the result of that as an attribute, so for now we handle
those via a complicated Terraform language expression achieving the same
result. Ideally these providers would introduce a new attribute that
exports the same address formerly exported as the hostname before their
initial v0.12-compatible release, in which case we can simplify these to
just reference the attribute in question. That would be preferable also
because it would allow use of that exported attribute in other contexts,
such as in a null_resource provisioner somewhere else or in an output
to allow a caller to deal with the SSH part itself.
2019-02-22 12:32:56 -08:00
..
test-fixtures configs/configupgrade: Default arguments in "connection" blocks 2019-02-22 12:32:56 -08:00
analysis.go configs/configupgrade: Include provisioner schemas in analysis 2019-02-22 12:32:56 -08:00
analysis_expr.go configs/configupgrade: Do type inference with input variables 2018-12-07 17:05:36 -08:00
doc.go configupgrade: new package for upgrading configs for 0.12 2018-10-16 18:50:29 -07:00
module_sources.go configupgrade: Load source code for a module and detect already upgraded 2018-10-16 18:50:29 -07:00
module_sources_test.go configupgrade: Load source code for a module and detect already upgraded 2018-10-16 18:50:29 -07:00
upgrade.go configs/configupgrade: Retain any .tf.json files unchanged 2018-12-04 11:37:39 -08:00
upgrade_body.go configs/configupgrade: Default arguments in "connection" blocks 2019-02-22 12:32:56 -08:00
upgrade_expr.go configs/configupgrade: Detect and fix element(...) usage with sets 2019-02-21 09:39:55 -08:00
upgrade_native.go configs/configupgrade: Default arguments in "connection" blocks 2019-02-22 12:32:56 -08:00
upgrade_test.go configs/configupgrade: Default arguments in "connection" blocks 2019-02-22 12:32:56 -08:00
upgrader.go terraform: More wiring in of new provider types 2018-10-16 19:12:54 -07:00