How to authenticate to gcp when using terraform cloud

Hi there,
Amazing solution you’ve found there, worked for me too, thanks for that!

In additional, in order to extend the test I created a terraform variable instead of environment variables, with the same value (the json file content), it worked too, however I had to got through a few more steps:

  1. Added the terraform variable, using a random key (I created something like “google_creds”)

  2. In the main.tf file, in the provider block I added the credentials field with its value being var.google_creds (credentials = var.google_creds)

  3. I created a variables.tf file (but you can also declare variables in the main.tf file if you want) with the variable name and type only (variables “google_creds” { type = string })

And in my case, my code is in a github repo and terraform cloud workspace configured to receive its webhook, after performing a push, the terraform plan worked successfully!!