The next release of Terraform will provide support to generate junit code coverage reports.
Since Sonar is already capable of parsing such reports for other languages it should be relatively easy to add this support.
There was a prior discussion about this about a year ago but that was before terraform was capable of generating the reports.
The coverage reports support is only experimental, and in an alpha release but if Sonar can proactively add the support this will help encourage adoption of using test files for terraform.