Skip to content

Terraform doesn't support GCP "external_account_authorized_user" #34234

@FabioAntunes

Description

@FabioAntunes

Terraform Version

v1.6.2aTerraform v1.6.3
on darwin_amd64

Terraform Configuration Files

provider "google" {
  region = "us-east1"
  project = "project-name"
}
terraform {
  backend "gcs" {
    bucket = "bucket-name"
    prefix = "state-name.tfstate"
  }
}

Debug Output

2023-11-13T17:54:31.126Z [INFO]  Terraform version: 1.6.3
2023-11-13T17:54:31.127Z [DEBUG] using github.com/hashicorp/go-tfe v1.36.0
2023-11-13T17:54:31.127Z [DEBUG] using github.com/hashicorp/hcl/v2 v2.19.1
2023-11-13T17:54:31.127Z [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1
2023-11-13T17:54:31.127Z [DEBUG] using github.com/zclconf/go-cty v1.14.1
2023-11-13T17:54:31.127Z [INFO]  Go runtime version: go1.21.3
2023-11-13T17:54:31.127Z [INFO]  CLI args: []string{"terraform", "init"}
2023-11-13T17:54:31.127Z [DEBUG] Attempting to open CLI config file: /Users/fabioantunes/.terraformrc
2023-11-13T17:54:31.127Z [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2023-11-13T17:54:31.128Z [INFO]  Loading CLI configuration from /Users/fabioantunes/.terraform.d/credentials.tfrc.json
2023-11-13T17:54:31.128Z [DEBUG] checking for credentials in "/Users/fabioantunes/.terraform.d/plugins"
2023-11-13T17:54:31.128Z [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2023-11-13T17:54:31.128Z [DEBUG] will search for provider plugins in /Users/fabioantunes/.terraform.d/plugins
2023-11-13T17:54:31.130Z [DEBUG] ignoring non-existing provider search directory /Users/fabioantunes/Library/Application Support/io.terraform/plugins
2023-11-13T17:54:31.130Z [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2023-11-13T17:54:31.130Z [INFO]  CLI command args: []string{"init"}

Initializing the backend...
2023-11-13T17:54:31.156Z [DEBUG] New state was assigned lineage "c7a673bd-fbc4-c147-1114-964bfdba5430"
2023-11-13T17:54:31.156Z [DEBUG] checking for provisioner in "."
2023-11-13T17:54:31.170Z [DEBUG] checking for provisioner in "/usr/local/bin"
2023-11-13T17:54:31.170Z [DEBUG] checking for provisioner in "/Users/fabioantunes/.terraform.d/plugins"
╷
│ Error: storage.NewClient() failed: dialing: unknown credential type: "external_account_authorized_user"

Expected Behavior

Terraform init should work

Actual Behavior

Terraform init fails even though the credentials are valid.

Steps to Reproduce

  1. gcloud auth login
  2. gcloud auth application-default login
cat /Users/fabioantunes/.config/gcloud/application_default_credentials.json
{
  "audience": "//iam.googleapis.com/locations/global/workforcePools/random/stuff/in/here/name-of-the-provider",
  "client_id": "randomnumber.apps.googleusercontent.com",
  "client_secret": "super-client-secret",
  "quota_project_id": "my-super-project",
  "refresh_token": "super-refresh-token",
  "token_info_url": "https://sts.googleapis.com/v1/introspect",
  "token_url": "https://sts.googleapis.com/v1/oauthtoken",
  "type": "external_account_authorized_user"
}
  1. terraform init

Additional Context

I have raised this with terragrunt as well and it seems they managed to fix this by upgrading the gcp SDK
gruntwork-io/terragrunt#2775

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend/gcsbugnewnew issue not yet triagedwaiting-responseAn issue/pull request is waiting for a response from the community

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions