HiveBrain v1.2.0
Get Started
← Back to all entries
debugterraformMinor

Terraform error: Provider "registry.terraform.io/hashicorp/google" requires explicit configuration. Add a provider block to the root module

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
errorprovidergooglethehashicorpblockregistryrequiresexplicitmodule

Problem

Is there anyway to find out what triggers a message like this,

Provider "registry.terraform.io/hashicorp/google" requires explicit configuration. Add a provider block to the root module and configure the provider's required arguments as described in the provider documentation.

This is what the error looks like in context. I have the provider though defined.

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: Invalid provider configuration
│ 
│ Provider "registry.terraform.io/hashicorp/google" requires explicit configuration. Add a provider block to the root module and configure the provider's
│ required arguments as described in the provider documentation.
│

Solution

This error means you're likely using the default configuration which requires a user-wide gcloud login. You simple need to run,
gcloud auth application-default login

Context

StackExchange DevOps Q#17634, answer score: 1

Revisions (0)

No revisions yet.