Adding Google Cloud json credentials as an environment variable in Terraform Cloud

When you are trying to add the contents of the Google Cloud credentials json file as a variable in Terraform Cloud you get the error that it cannot contain new lines. In this case you have to use the jq -c option as in:

cat credentials.json | jq -c