Open arueth opened 5 months ago
I ran gcloud auth application-default login
and the user(rueth@google.com) has Owner
permission on the project.
Hi @arueth!
As you can see in the terraform registry link of this issue there is a note explaining that you need to configure your provider scope to have the desired output, otherwise you could have an error or other kind of harassment.
This issue was replicated successfully and without errors with the shared terraform configuration, just adding the scope in the provider as the following example:
provider "google" { scopes = ["https://www.googleapis.com/auth/userinfo.email"] }
Be careful because other bad configurations in your provider like credentials
, project
, region
or zone
could affect this, as an advice you can check these attributes before run the terraform apply
.
Community Note
Terraform Version
$ terraform version Terraform v1.5.7 on linux_amd64
Your version of Terraform is out of date! The latest version is 1.8.1. You can update by downloading from https://www.terraform.io/downloads.html
Affected Resource(s)
google_client_openid_userinfo
Terraform Configuration
Debug Output
Expected Behavior
Expect to get a Terraform output of the executing identity's email property.
Actual Behavior
When doing this in Cloud Shell in the Google console, the value is always an empty string "".
Steps to reproduce
terraform apply
Important Factoids
It seems to work fine when on a Cloud Workstation.
References
A similar issue was raised before, but was closed due to inactivity: https://github.com/hashicorp/terraform-provider-google/issues/16431