Terraform 0.12.0 removed the need for putting references and keywords
in quotes, but we disabled the deprecation warnings for the initial
release in order to avoid creating noise for folks who were intentionally
attempting to maintain modules that were cross-compatible with both
Terraform 0.11 and Terraform 0.12.
However, with Terraform 0.12 now more widely used, the lack of these
warnings seems to be causing newcomers to copy the quoted versions from
existing examples on the internet, which is perpetuating the old and
confusing quoted form in newer configurations.
In preparation for phasing out these deprecated forms altogether in a
future major release, and for the shorter-term benefit of giving better
feedback to newcomers when they are learning from outdated examples, we'll
now re-enable those deprecation warnings, and be explicit that the old
forms are intended for removal in a future release.
In order to properly test this, we establish a new set of test
configurations that explicitly mark which warnings they are expecting and
verify that they do indeed produce those expected warnings. We also
verify that the "success" tests do _not_ produce warnings, while removing
the ones that were previously written to succeed but have their warnings
ignored.
// 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.
/*
ifwantKeyword{
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,
})
}
*/
ifwantKeyword{
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. Terraform 0.11 and earlier required quotes, but quoted keywords are now deprecated and will be removed in a future version of Terraform. 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. Terraform 0.11 and earlier required quotes, but quoted references are now deprecated and will be removed in a future version of Terraform. Remove the quotes surrounding this reference to silence this warning.",