diff --git a/configs/compat_shim.go b/configs/compat_shim.go index 2f803b3fa..ed4f37d43 100644 --- a/configs/compat_shim.go +++ b/configs/compat_shim.go @@ -59,21 +59,28 @@ func shimTraversalInString(expr hcl.Expression, wantKeyword bool) (hcl.Expressio ) diags = append(diags, tDiags...) - if wantKeyword { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagWarning, - Summary: "Quoted keywords are deprecated", - Detail: "In this context, keywords are expected literally rather than in quotes. Previous versions of Terraform required quotes, but that usage is now deprecated. Remove the quotes surrounding this keyword to silence this warning.", - Subject: &srcRange, - }) - } else { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagWarning, - Summary: "Quoted references are deprecated", - Detail: "In this context, references are expected literally rather than in quotes. Previous versions of Terraform required quotes, but that usage is now deprecated. Remove the quotes surrounding this reference to silence this warning.", - Subject: &srcRange, - }) - } + // For initial release our deprecation warnings are disabled to allow + // a period where modules can be compatible with both old and new + // conventions. + // FIXME: Re-enable these deprecation warnings in a release prior to + // Terraform 0.13 and then remove the shims altogether for 0.13. + /* + if wantKeyword { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagWarning, + Summary: "Quoted keywords are deprecated", + Detail: "In this context, keywords are expected literally rather than in quotes. Previous versions of Terraform required quotes, but that usage is now deprecated. Remove the quotes surrounding this keyword to silence this warning.", + Subject: &srcRange, + }) + } else { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagWarning, + Summary: "Quoted references are deprecated", + Detail: "In this context, references are expected literally rather than in quotes. Previous versions of Terraform required quotes, but that usage is now deprecated. Remove the quotes surrounding this reference to silence this warning.", + Subject: &srcRange, + }) + } + */ return &hclsyntax.ScopeTraversalExpr{ Traversal: traversal, diff --git a/configs/parser_config_test.go b/configs/parser_config_test.go index ff90d5eba..62a04d3ba 100644 --- a/configs/parser_config_test.go +++ b/configs/parser_config_test.go @@ -99,11 +99,6 @@ func TestParserLoadConfigFileFailureMessages(t *testing.T) { hcl.DiagError, "Invalid variable type hint", }, - { - "valid-files/variable-type-quoted.tf", - hcl.DiagWarning, - "Quoted keywords are deprecated", - }, { "invalid-files/unexpected-attr.tf", hcl.DiagError, @@ -119,16 +114,6 @@ func TestParserLoadConfigFileFailureMessages(t *testing.T) { hcl.DiagError, "Unsuitable value type", }, - { - "valid-files/resources-dependson-quoted.tf", - hcl.DiagWarning, - "Quoted references are deprecated", - }, - { - "valid-files/resources-ignorechanges-quoted.tf", - hcl.DiagWarning, - "Quoted references are deprecated", - }, { "valid-files/resources-ignorechanges-all-legacy.tf", hcl.DiagWarning, @@ -139,16 +124,6 @@ func TestParserLoadConfigFileFailureMessages(t *testing.T) { hcl.DiagWarning, "Deprecated ignore_changes wildcard", }, - { - "valid-files/resources-provisioner-when-quoted.tf", - hcl.DiagWarning, - "Quoted keywords are deprecated", - }, - { - "valid-files/resources-provisioner-onfailure-quoted.tf", - hcl.DiagWarning, - "Quoted keywords are deprecated", - }, } for _, test := range tests {