Error: Invalid provider configuration (terraform plan locally with TerraformCloud)

Problem

You are trying to run locally the terraform plan, while using the Terraform’s Cloud remote backend, before commiting your changes to your repo and running it through Terraform’s Cloud UI, and you are getting the previous error message:

Error: Invalid provider configuration

Solution

Remember to add the environment variables needed for your provider (AWS, Google, Exoscale etc) in the Variables section of your Terraform Cloud setup.

Even you have added them before, using a new Workspace means you will need to add them to each new workspace.