tfvars-json reads Terraform .tfvars variable definition files and outputs the same values in Terraform JSON syntax.
$ tfvars-json file.tfvars > file.tfvars.jsontfvars-json processes a single file and outputs to stdout. You can use a JSON scripting tool like jq to filter or post-process this output.
$ go install github.com/alisdair/tfvars-json@latest