Summary:
When using hcl2.Builder() to generate HCL files, the providers map for module blocks includes quoted keys
e.g.,
providers = {
aws.route53 = "aws.route53"
aws.rds = "aws.rds"
}
This triggers the following deprecation warning from Terraform (version 1.11.4):
Warning: Quoted references are deprecated
What we expect hcl2.Builder() to generate:
providers = {
aws.route53 = aws.route53
aws.rds = aws.rds
}
Proposed Action:
Add special handling within hcl2.Builder() for providers maps:
- Do not quote the keys (provider names).
- Maintain quotes for values that actually need it (eg. strings).
- Compatibility across recent versions of Terraform.