Files
opentf/command/testdata/013upgrade-preserves-comments/input/main.tf
Alisdair McDiarmid b6739829e7 command: Fix 0.13upgrade to preserve more comments
Previously, any comments inside the required provider configuration for
a given provider would be wiped out upon rerunning the 0.13upgrade
command. This commit attempts to preserve those comments if the existing
entry is semantically equivalent to the entry we are about to write.
2020-06-24 15:54:46 -04:00

21 lines
401 B
HCL

resource foo_instance a {}
resource bar_instance b {}
terraform {
# Provider requirements go here
required_providers {
# Pin bar to this version
bar = "0.5.0"
# An explicit requirement
baz = {
# Comment inside the block should stay
source = "foo/baz"
}
# Foo is required
foo = {
# This comment sadly won't make it
version = "1.0.0"
}
}
}