hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.28k stars 1.72k forks source link

authentication on import google_firebaserules_ruleset #13120

Closed saulortega closed 1 year ago

saulortega commented 1 year ago

Community Note

Terraform Version

Terraform v1.3.5 on linux_amd64 provider registry.terraform.io/hashicorp/google v4.44.1

Affected Resource(s)

Terraform Configuration Files

resource "google_firebaserules_ruleset" "reglasfirestore" {
}

Debug Output

I'm trying to import Firestore Rulesets:

terraform import google_firebaserules_ruleset.reglasfirestore projects/XXXXXXXXXXX/rulesets/YYYYYYYYYYYY

I get this message:

Error: Error when reading or editing FirebaserulesRuleset "projects/XXXXXXXXXXX/rulesets/YYYYYYYYYYYY": googleapi: Error 403: Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the firebaserules.googleapis.com. We recommend configuring the billing/quota_project setting in gcloud or using a service account through the auth/impersonate_service_account setting. For more information about service accounts and how to use them in your application, see https://cloud.google.com/docs/authentication/. If you are getting this error with curl or similar tools, you may need to specify 'X-Goog-User-Project' HTTP header for quota and billing purposes. For more information regarding 'X-Goog-User-Project' header, please check https://cloud.google.com/apis/docs/system-parameters.
β”‚ Details:
β”‚ [
β”‚   {
β”‚     "@type": "type.googleapis.com/google.rpc.ErrorInfo",
β”‚     "domain": "googleapis.com",
β”‚     "metadata": {
β”‚       "consumer": "projects/NNNNNNNNNN",
β”‚       "service": "firebaserules.googleapis.com"
β”‚     },
β”‚     "reason": "SERVICE_DISABLED"
β”‚   }
β”‚ ]

I was able to do other imports, such as google_project_service, whitout problem.

I think it's necessary to add that 'X-Goog-User-Project' header as mentioned in the error output.

Panic Output

Expected Behavior

Actual Behavior

Steps to Reproduce

Important Factoids

References

edwardmedia commented 1 year ago

@saulortega can you share the debug log? What account were you using? Does your account have the right permissions?

saulortega commented 1 year ago

I'm the owner/administrator of this account. I created the project with this account. This is the only account I use, there is no chance I'm using the wrong account. I reathenticated after updating terraform and google provider. The issue is the same before and after updating terraform and Google provider (I updated to see if the issue was solved in newer version). The ruleset is working in my project; the ruleset ID is correct (I copied it from inspectioning Network in Firebase Console).

Here is the log (these are my replacements: PPPPPPPPPPPPP, RRRRRRRRRRRRR, NNNNNNNNNNNNN, BBBBBBBBBBBBB, sssssssssssss):

$ TF_LOG=DEBUG terraform import google_firebaserules_ruleset.reglasfirestore projects/PPPPPPPPPPPPP/rulesets/RRRRRRRRRRRRR
2022-11-28T17:20:39.619-0500 [INFO]  Terraform version: 1.3.5
2022-11-28T17:20:39.691-0500 [DEBUG] using github.com/hashicorp/go-tfe v1.9.0
2022-11-28T17:20:39.691-0500 [DEBUG] using github.com/hashicorp/hcl/v2 v2.15.0
2022-11-28T17:20:39.691-0500 [DEBUG] using github.com/hashicorp/terraform-config-inspect v0.0.0-20210209133302-4fd17a0faac2
2022-11-28T17:20:39.691-0500 [DEBUG] using github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734
2022-11-28T17:20:39.691-0500 [DEBUG] using github.com/zclconf/go-cty v1.12.1
2022-11-28T17:20:39.691-0500 [INFO]  Go runtime version: go1.19.3
2022-11-28T17:20:39.691-0500 [INFO]  CLI args: []string{"terraform", "import", "google_firebaserules_ruleset.reglasfirestore", "projects/PPPPPPPPPPPPP/rulesets/RRRRRRRRRRRRR"}
2022-11-28T17:20:39.691-0500 [DEBUG] Attempting to open CLI config file: /home/saul/.terraformrc
2022-11-28T17:20:39.691-0500 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2022-11-28T17:20:39.691-0500 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2022-11-28T17:20:39.691-0500 [DEBUG] ignoring non-existing provider search directory /home/saul/.terraform.d/plugins
2022-11-28T17:20:39.691-0500 [DEBUG] ignoring non-existing provider search directory /home/saul/.local/share/terraform/plugins
2022-11-28T17:20:39.691-0500 [DEBUG] ignoring non-existing provider search directory /home/saul/.local/share/flatpak/exports/share/terraform/plugins
2022-11-28T17:20:39.691-0500 [DEBUG] ignoring non-existing provider search directory /var/lib/flatpak/exports/share/terraform/plugins
2022-11-28T17:20:39.691-0500 [DEBUG] ignoring non-existing provider search directory /usr/share/gnome/terraform/plugins
2022-11-28T17:20:39.691-0500 [DEBUG] ignoring non-existing provider search directory /usr/share/pantheon/terraform/plugins
2022-11-28T17:20:39.691-0500 [DEBUG] ignoring non-existing provider search directory /home/saul/.local/share/flatpak/exports/share/terraform/plugins
2022-11-28T17:20:39.691-0500 [DEBUG] ignoring non-existing provider search directory /var/lib/flatpak/exports/share/terraform/plugins
2022-11-28T17:20:39.691-0500 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2022-11-28T17:20:39.691-0500 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2022-11-28T17:20:39.691-0500 [DEBUG] ignoring non-existing provider search directory /var/lib/snapd/desktop/terraform/plugins
2022-11-28T17:20:39.692-0500 [INFO]  CLI command args: []string{"import", "google_firebaserules_ruleset.reglasfirestore", "projects/PPPPPPPPPPPPP/rulesets/RRRRRRRRRRRRR"}
2022-11-28T17:20:48.652-0500 [DEBUG] checking for provisioner in "."
2022-11-28T17:20:48.675-0500 [DEBUG] checking for provisioner in "/usr/bin"
2022-11-28T17:20:51.187-0500 [DEBUG] Building and walking import graph
2022-11-28T17:20:52.109-0500 [DEBUG] ProviderTransformer: "google_cloud_run_service_iam_policy.invocador_ipa (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2022-11-28T17:20:52.109-0500 [DEBUG] ProviderTransformer: "data.google_iam_policy.invocador (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2022-11-28T17:20:52.109-0500 [DEBUG] ProviderTransformer: "google_project_service.secretmanager (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2022-11-28T17:20:52.109-0500 [DEBUG] ProviderTransformer: "google_secret_manager_secret_version.paypal_secret_id_valor (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2022-11-28T17:20:52.109-0500 [DEBUG] ProviderTransformer: "google_secret_manager_secret_iam_member.paypal_client_id_acceso (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2022-11-28T17:20:52.109-0500 [DEBUG] ProviderTransformer: "google_secret_manager_secret_version.llave_firma_token_valor (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2022-11-28T17:20:52.109-0500 [DEBUG] ProviderTransformer: "data.google_project.proyecto (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2022-11-28T17:20:52.109-0500 [DEBUG] ProviderTransformer: "google_secret_manager_secret.paypal_client_id (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2022-11-28T17:20:52.109-0500 [DEBUG] ProviderTransformer: "google_project_service.run (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2022-11-28T17:20:52.109-0500 [DEBUG] ProviderTransformer: "google_secret_manager_secret_version.paypal_client_id_valor (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2022-11-28T17:20:52.109-0500 [DEBUG] ProviderTransformer: "google_firebaserules_ruleset.reglasfirestore (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2022-11-28T17:20:52.110-0500 [DEBUG] ProviderTransformer: "google_secret_manager_secret_iam_member.paypal_secret_id_acceso (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2022-11-28T17:20:52.110-0500 [DEBUG] ProviderTransformer: "google_firebaserules_release.publicacionreglasfirestore (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2022-11-28T17:20:52.110-0500 [DEBUG] ProviderTransformer: "google_cloud_run_service.ipa (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2022-11-28T17:20:52.110-0500 [DEBUG] ProviderTransformer: "google_project_service.containerregistry (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2022-11-28T17:20:52.110-0500 [DEBUG] ProviderTransformer: "google_secret_manager_secret.paypal_secret_id (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2022-11-28T17:20:52.110-0500 [DEBUG] ProviderTransformer: "google_secret_manager_secret_iam_member.llave_firma_token_acceso (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2022-11-28T17:20:52.110-0500 [DEBUG] ProviderTransformer: "google_secret_manager_secret.llave_firma_token (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2022-11-28T17:20:52.114-0500 [DEBUG] created provider logger: level=debug
2022-11-28T17:20:52.114-0500 [INFO]  provider: configuring client automatic mTLS
2022-11-28T17:20:52.167-0500 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.44.1/linux_amd64/terraform-provider-google_v4.44.1_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/4.44.1/linux_amd64/terraform-provider-google_v4.44.1_x5]
2022-11-28T17:20:52.167-0500 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.44.1/linux_amd64/terraform-provider-google_v4.44.1_x5 pid=14506
2022-11-28T17:20:52.167-0500 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.44.1/linux_amd64/terraform-provider-google_v4.44.1_x5
2022-11-28T17:20:52.527-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: configuring server automatic mTLS: timestamp=2022-11-28T17:20:52.518-0500
2022-11-28T17:20:52.777-0500 [DEBUG] provider.terraform-provider-google_v4.44.1_x5: plugin address: address=/tmp/plugin1192957707 network=unix timestamp=2022-11-28T17:20:52.776-0500
2022-11-28T17:20:52.778-0500 [DEBUG] provider: using plugin: version=5
2022-11-28T17:20:53.942-0500 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2022-11-28T17:20:53.951-0500 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.44.1/linux_amd64/terraform-provider-google_v4.44.1_x5 pid=14506
2022-11-28T17:20:53.952-0500 [DEBUG] provider: plugin exited
2022-11-28T17:20:53.953-0500 [DEBUG] ReferenceTransformer: "google_secret_manager_secret_version.paypal_secret_id_valor (expand)" references: [google_secret_manager_secret.paypal_secret_id (expand) var.paypal_secret_id]
2022-11-28T17:20:54.043-0500 [DEBUG] ReferenceTransformer: "google_firebaserules_release.publicacionreglasfirestore (expand)" references: []
2022-11-28T17:20:54.043-0500 [DEBUG] ReferenceTransformer: "local.proyecto (expand)" references: []
2022-11-28T17:20:54.043-0500 [DEBUG] ReferenceTransformer: "data.google_project.proyecto (expand)" references: []
2022-11-28T17:20:54.043-0500 [DEBUG] ReferenceTransformer: "var.paypal_client_id" references: []
2022-11-28T17:20:54.043-0500 [DEBUG] ReferenceTransformer: "var.paypal_secret_id" references: []
2022-11-28T17:20:54.043-0500 [DEBUG] ReferenceTransformer: "google_project_service.containerregistry (expand)" references: []
2022-11-28T17:20:54.044-0500 [DEBUG] ReferenceTransformer: "google_secret_manager_secret_iam_member.paypal_client_id_acceso (expand)" references: [google_secret_manager_secret.paypal_client_id (expand) google_secret_manager_secret.paypal_client_id (expand) data.google_project.proyecto (expand)]
2022-11-28T17:20:54.044-0500 [DEBUG] ReferenceTransformer: "google_project_service.run (expand)" references: []
2022-11-28T17:20:54.049-0500 [INFO]  ReferenceTransformer: reference not found: "terraform.workspace"
2022-11-28T17:20:54.053-0500 [DEBUG] ReferenceTransformer: "google_cloud_run_service.ipa (expand)" references: [google_project_service.containerregistry (expand) google_project_service.secretmanager (expand) google_project_service.run (expand) google_secret_manager_secret_version.llave_firma_token_valor (expand) google_secret_manager_secret_version.paypal_client_id_valor (expand) google_secret_manager_secret_version.paypal_secret_id_valor (expand) local.proyecto (expand) google_secret_manager_secret.llave_firma_token (expand) var.paypal_base_url google_secret_manager_secret.paypal_client_id (expand) google_secret_manager_secret.paypal_secret_id (expand)]
2022-11-28T17:20:54.055-0500 [DEBUG] ReferenceTransformer: "google_secret_manager_secret_version.llave_firma_token_valor (expand)" references: [var.llave_firma_token google_secret_manager_secret.llave_firma_token (expand)]
2022-11-28T17:20:54.055-0500 [DEBUG] ReferenceTransformer: "var.paypal_base_url" references: []
2022-11-28T17:20:54.056-0500 [INFO]  ReferenceTransformer: reference not found: "terraform.workspace"
2022-11-28T17:20:54.056-0500 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/hashicorp/google\"]" references: [local.proyecto (expand)]
2022-11-28T17:20:54.056-0500 [DEBUG] ReferenceTransformer: "google_secret_manager_secret.llave_firma_token (expand)" references: [google_project_service.secretmanager (expand)]
2022-11-28T17:20:54.057-0500 [DEBUG] ReferenceTransformer: "google_secret_manager_secret_iam_member.llave_firma_token_acceso (expand)" references: [google_secret_manager_secret.llave_firma_token (expand) google_secret_manager_secret.llave_firma_token (expand) data.google_project.proyecto (expand)]
2022-11-28T17:20:54.057-0500 [DEBUG] ReferenceTransformer: "google_secret_manager_secret_version.paypal_client_id_valor (expand)" references: [var.paypal_client_id google_secret_manager_secret.paypal_client_id (expand)]
2022-11-28T17:20:54.057-0500 [DEBUG] ReferenceTransformer: "google_secret_manager_secret.paypal_secret_id (expand)" references: [google_project_service.secretmanager (expand)]
2022-11-28T17:20:54.057-0500 [DEBUG] ReferenceTransformer: "var.llave_firma_token" references: []
2022-11-28T17:20:54.057-0500 [DEBUG] ReferenceTransformer: "data.google_iam_policy.invocador (expand)" references: []
2022-11-28T17:20:54.057-0500 [DEBUG] ReferenceTransformer: "google_project_service.secretmanager (expand)" references: []
2022-11-28T17:20:54.058-0500 [DEBUG] ReferenceTransformer: "google_firebaserules_ruleset.reglasfirestore (expand)" references: []
2022-11-28T17:20:54.058-0500 [DEBUG] ReferenceTransformer: "google_secret_manager_secret.paypal_client_id (expand)" references: [google_project_service.secretmanager (expand)]
2022-11-28T17:20:54.058-0500 [DEBUG] ReferenceTransformer: "google_secret_manager_secret_iam_member.paypal_secret_id_acceso (expand)" references: [google_secret_manager_secret.paypal_secret_id (expand) google_secret_manager_secret.paypal_secret_id (expand) data.google_project.proyecto (expand)]
2022-11-28T17:20:54.059-0500 [DEBUG] ReferenceTransformer: "google_cloud_run_service_iam_policy.invocador_ipa (expand)" references: [google_cloud_run_service.ipa (expand) google_cloud_run_service.ipa (expand) data.google_iam_policy.invocador (expand)]
2022-11-28T17:20:54.106-0500 [DEBUG] Starting graph walk: walkImport
2022-11-28T17:20:54.343-0500 [DEBUG] created provider logger: level=debug
2022-11-28T17:20:54.343-0500 [INFO]  provider: configuring client automatic mTLS
2022-11-28T17:20:54.377-0500 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.44.1/linux_amd64/terraform-provider-google_v4.44.1_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/4.44.1/linux_amd64/terraform-provider-google_v4.44.1_x5]
2022-11-28T17:20:54.377-0500 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.44.1/linux_amd64/terraform-provider-google_v4.44.1_x5 pid=14515
2022-11-28T17:20:54.377-0500 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.44.1/linux_amd64/terraform-provider-google_v4.44.1_x5
2022-11-28T17:20:54.562-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: configuring server automatic mTLS: timestamp=2022-11-28T17:20:54.501-0500
2022-11-28T17:20:54.769-0500 [DEBUG] provider.terraform-provider-google_v4.44.1_x5: plugin address: address=/tmp/plugin2730517485 network=unix timestamp=2022-11-28T17:20:54.768-0500
2022-11-28T17:20:54.769-0500 [DEBUG] provider: using plugin: version=5
2022-11-28T17:20:55.615-0500 [WARN]  ValidateProviderConfig from "provider[\"registry.terraform.io/hashicorp/google\"]" changed the config value, but that value is unused
2022-11-28T17:20:55.617-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:55 [INFO] Authenticating using DefaultClient...: timestamp=2022-11-28T17:20:55.617-0500
2022-11-28T17:20:55.617-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:55 [INFO]   -- Scopes: [https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/userinfo.email]: timestamp=2022-11-28T17:20:55.617-0500
2022-11-28T17:20:55.655-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:55 [INFO] Authenticating using DefaultClient...: timestamp=2022-11-28T17:20:55.654-0500
2022-11-28T17:20:55.655-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:55 [INFO]   -- Scopes: [https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/userinfo.email]: timestamp=2022-11-28T17:20:55.655-0500
2022-11-28T17:20:55.655-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:55 [DEBUG] Waiting for state to become: [success]: timestamp=2022-11-28T17:20:55.655-0500
2022-11-28T17:20:57.180-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:57 [INFO] Terraform is using this identity: sssssssssssss@gmail.com: timestamp=2022-11-28T17:20:57.180-0500
2022-11-28T17:20:57.371-0500 [DEBUG] ReferenceTransformer: "google_project_service.secretmanager" references: []
2022-11-28T17:20:57.371-0500 [DEBUG] Resource instance state not found for node "google_firebaserules_release.publicacionreglasfirestore", instance google_firebaserules_release.publicacionreglasfirestore
2022-11-28T17:20:57.371-0500 [DEBUG] ReferenceTransformer: "google_firebaserules_release.publicacionreglasfirestore" references: []
2022-11-28T17:20:57.372-0500 [DEBUG] ReferenceTransformer: "google_project_service.run" references: []
2022-11-28T17:20:57.372-0500 [DEBUG] ReferenceTransformer: "data.google_iam_policy.invocador" references: []
2022-11-28T17:20:58.280-0500 [DEBUG] ReferenceTransformer: "google_firebaserules_ruleset.reglasfirestore (import id \"projects/PPPPPPPPPPPPP/rulesets/RRRRRRRRRRRRR\")" references: []
google_firebaserules_ruleset.reglasfirestore: Importing from ID "projects/PPPPPPPPPPPPP/rulesets/RRRRRRRRRRRRR"...
2022-11-28T17:20:58.280-0500 [DEBUG] ReferenceTransformer: "google_project_service.containerregistry" references: []
2022-11-28T17:20:58.281-0500 [DEBUG] ReferenceTransformer: "data.google_project.proyecto" references: []
2022-11-28T17:20:58.281-0500 [INFO]  ReferenceTransformer: reference not found: "google_project_service.secretmanager"
2022-11-28T17:20:58.281-0500 [DEBUG] ReferenceTransformer: "google_secret_manager_secret.llave_firma_token" references: []
2022-11-28T17:20:58.281-0500 [INFO]  ReferenceTransformer: reference not found: "google_project_service.secretmanager"
2022-11-28T17:20:58.282-0500 [DEBUG] ReferenceTransformer: "google_secret_manager_secret.paypal_secret_id" references: []
2022-11-28T17:20:58.282-0500 [INFO]  ReferenceTransformer: reference not found: "google_project_service.secretmanager"
2022-11-28T17:20:58.282-0500 [DEBUG] ReferenceTransformer: "google_secret_manager_secret.paypal_client_id" references: []
2022-11-28T17:20:58.285-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [DEBUG] matching ID projects/PPPPPPPPPPPPP/rulesets/RRRRRRRRRRRRR to regex projects/(?P<project>[^/]+)/rulesets/(?P<name>[^/]+).: timestamp=2022-11-28T17:20:58.284-0500
2022-11-28T17:20:58.285-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [DEBUG] importing project = PPPPPPPPPPPPP: timestamp=2022-11-28T17:20:58.284-0500
2022-11-28T17:20:58.285-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [DEBUG] importing name = RRRRRRRRRRRRR: timestamp=2022-11-28T17:20:58.284-0500
2022-11-28T17:20:58.287-0500 [INFO]  ReferenceTransformer: reference not found: "var.paypal_secret_id"
2022-11-28T17:20:58.287-0500 [DEBUG] ReferenceTransformer: "google_secret_manager_secret_version.paypal_secret_id_valor" references: []
data.google_project.proyecto: Reading...
2022-11-28T17:20:58.288-0500 [INFO]  ReferenceTransformer: reference not found: "var.llave_firma_token"
2022-11-28T17:20:58.288-0500 [DEBUG] ReferenceTransformer: "google_secret_manager_secret_version.llave_firma_token_valor" references: []
2022-11-28T17:20:58.289-0500 [INFO]  ReferenceTransformer: reference not found: "var.paypal_client_id"
2022-11-28T17:20:58.289-0500 [DEBUG] ReferenceTransformer: "google_secret_manager_secret_version.paypal_client_id_valor" references: []
data.google_iam_policy.invocador: Reading...
data.google_iam_policy.invocador: Read complete after 0s [id=3450855414]
2022-11-28T17:20:58.298-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [DEBUG] Waiting for state to become: [success]: timestamp=2022-11-28T17:20:58.290-0500
2022-11-28T17:20:58.298-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [INFO] Instantiating Google Cloud ResourceManager client for path https://cloudresourcemanager.googleapis.com/: timestamp=2022-11-28T17:20:58.290-0500
2022-11-28T17:20:58.298-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [DEBUG] Retry Transport: starting RoundTrip retry loop: timestamp=2022-11-28T17:20:58.291-0500
2022-11-28T17:20:58.298-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [DEBUG] Retry Transport: request attempt 0: timestamp=2022-11-28T17:20:58.291-0500
2022-11-28T17:20:58.301-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
GET /v1/projects/PPPPPPPPPPPPP?alt=json&prettyPrint=false HTTP/1.1
Host: cloudresourcemanager.googleapis.com
User-Agent: google-api-go-client/0.5 Terraform/1.3.5 (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google/dev
X-Goog-Api-Client: gl-go/1.18.1 gdcl/0.102.0
Accept-Encoding: gzip

-----------------------------------------------------: timestamp=2022-11-28T17:20:58.300-0500
2022-11-28T17:20:58.307-0500 [INFO]  ReferenceTransformer: reference not found: "google_project_service.containerregistry"
2022-11-28T17:20:58.307-0500 [INFO]  ReferenceTransformer: reference not found: "google_project_service.secretmanager"
2022-11-28T17:20:58.308-0500 [INFO]  ReferenceTransformer: reference not found: "google_project_service.run"
2022-11-28T17:20:58.308-0500 [INFO]  ReferenceTransformer: reference not found: "google_secret_manager_secret_version.llave_firma_token_valor"
2022-11-28T17:20:58.308-0500 [INFO]  ReferenceTransformer: reference not found: "google_secret_manager_secret_version.paypal_client_id_valor"
2022-11-28T17:20:58.308-0500 [INFO]  ReferenceTransformer: reference not found: "google_secret_manager_secret_version.paypal_secret_id_valor"
2022-11-28T17:20:58.308-0500 [INFO]  ReferenceTransformer: reference not found: "local.proyecto"
2022-11-28T17:20:58.308-0500 [INFO]  ReferenceTransformer: reference not found: "terraform.workspace"
2022-11-28T17:20:58.308-0500 [INFO]  ReferenceTransformer: reference not found: "var.paypal_base_url"
2022-11-28T17:20:58.308-0500 [DEBUG] ReferenceTransformer: "google_cloud_run_service.ipa" references: []
2022-11-28T17:20:58.324-0500 [DEBUG] ReferenceTransformer: "google_cloud_run_service_iam_policy.invocador_ipa" references: []
google_firebaserules_ruleset.reglasfirestore: Import prepared!
  Prepared google_firebaserules_ruleset for import
google_firebaserules_ruleset.reglasfirestore: Refreshing state... [id=projects/PPPPPPPPPPPPP/rulesets/RRRRRRRRRRRRR]
2022-11-28T17:20:58.768-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [DEBUG][DCL INFO] [RequestID:lmzky1bm]  Google API Request: (id x8lc0)
-----------[REQUEST]----------
GET /v1/projects/PPPPPPPPPPPPP/rulesets/RRRRRRRRRRRRR?alt=json HTTP/1.1
Host: firebaserules.googleapis.com
User-Agent: Terraform/1.3.5 (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google/dev DeclarativeClientLib/0.0.1
Content-Type: application/json
Accept-Encoding: gzip

-------[END REQUEST]--------: timestamp=2022-11-28T17:20:58.766-0500
2022-11-28T17:20:58.774-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [DEBUG] Retry Transport: starting RoundTrip retry loop: timestamp=2022-11-28T17:20:58.771-0500
2022-11-28T17:20:58.774-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [DEBUG] Retry Transport: request attempt 0: timestamp=2022-11-28T17:20:58.771-0500
2022-11-28T17:20:58.774-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
GET /v1/projects/PPPPPPPPPPPPP/rulesets/RRRRRRRRRRRRR?alt=json HTTP/1.1
Host: firebaserules.googleapis.com
User-Agent: Terraform/1.3.5 (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google/dev DeclarativeClientLib/0.0.1
Content-Type: application/json
Accept-Encoding: gzip

-----------------------------------------------------: timestamp=2022-11-28T17:20:58.772-0500
2022-11-28T17:20:58.914-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Mon, 28 Nov 2022 22:20:58 GMT
Server: ESF
Server-Timing: gfet4t7; dur=345
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
 "projectNumber": "299264621919",
 "projectId": "PPPPPPPPPPPPP",
 "lifecycleState": "ACTIVE",
 "name": "Efidatos",
 "createTime": "2021-11-03T00:56:17.303Z"
}
-----------------------------------------------------: timestamp=2022-11-28T17:20:58.914-0500
2022-11-28T17:20:58.914-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [DEBUG] Retry Transport: Stopping retries, last request was successful: timestamp=2022-11-28T17:20:58.914-0500
2022-11-28T17:20:58.914-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [DEBUG] Retry Transport: Returning after 1 attempts: timestamp=2022-11-28T17:20:58.914-0500
2022-11-28T17:20:58.914-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [DEBUG] Waiting for state to become: [success]: timestamp=2022-11-28T17:20:58.914-0500
2022-11-28T17:20:58.914-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [INFO] Instantiating Google Cloud Billing client for path https://cloudbilling.googleapis.com/: timestamp=2022-11-28T17:20:58.914-0500
2022-11-28T17:20:58.915-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [DEBUG] Retry Transport: starting RoundTrip retry loop: timestamp=2022-11-28T17:20:58.915-0500
2022-11-28T17:20:58.915-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [DEBUG] Retry Transport: request attempt 0: timestamp=2022-11-28T17:20:58.915-0500
2022-11-28T17:20:58.915-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:58 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
GET /v1/projects/PPPPPPPPPPPPP/billingInfo?alt=json&prettyPrint=false HTTP/1.1
Host: cloudbilling.googleapis.com
User-Agent: google-api-go-client/0.5 Terraform/1.3.5 (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google/dev
X-Goog-Api-Client: gl-go/1.18.1 gdcl/0.102.0
Accept-Encoding: gzip

-----------------------------------------------------: timestamp=2022-11-28T17:20:58.915-0500
2022-11-28T17:20:59.036-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:59 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 403 Forbidden
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Mon, 28 Nov 2022 22:20:59 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
  "error": {
    "code": 403,
    "message": "Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the firebaserules.googleapis.com. We recommend configuring the billing/quota_project setting in gcloud or using a service account through the auth/impersonate_service_account setting. For more information about service accounts and how to use them in your application, see https://cloud.google.com/docs/authentication/. If you are getting this error with curl or similar tools, you may need to specify 'X-Goog-User-Project' HTTP header for quota and billing purposes. For more information regarding 'X-Goog-User-Project' header, please check https://cloud.google.com/apis/docs/system-parameters.",
    "status": "PERMISSION_DENIED",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.ErrorInfo",
        "reason": "SERVICE_DISABLED",
        "domain": "googleapis.com",
        "metadata": {
          "service": "firebaserules.googleapis.com",
          "consumer": "projects/NNNNNNNNNNNNN"
        }
      }
    ]
  }
}

-----------------------------------------------------: timestamp=2022-11-28T17:20:59.036-0500
2022-11-28T17:20:59.039-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:59 [DEBUG] Retry Transport: Stopping retries, last request failed with non-retryable error: googleapi: got HTTP response code 403 with body: HTTP/2.0 403 Forbidden
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Mon, 28 Nov 2022 22:20:59 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
  "error": {
    "code": 403,
    "message": "Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the firebaserules.googleapis.com. We recommend configuring the billing/quota_project setting in gcloud or using a service account through the auth/impersonate_service_account setting. For more information about service accounts and how to use them in your application, see https://cloud.google.com/docs/authentication/. If you are getting this error with curl or similar tools, you may need to specify 'X-Goog-User-Project' HTTP header for quota and billing purposes. For more information regarding 'X-Goog-User-Project' header, please check https://cloud.google.com/apis/docs/system-parameters.",
    "status": "PERMISSION_DENIED",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.ErrorInfo",
        "reason": "SERVICE_DISABLED",
        "domain": "googleapis.com",
        "metadata": {
          "service": "firebaserules.googleapis.com",
          "consumer": "projects/NNNNNNNNNNNNN"
        }
      }
    ]
  }
}: timestamp=2022-11-28T17:20:59.037-0500
2022-11-28T17:20:59.039-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:59 [DEBUG] Retry Transport: Returning after 1 attempts: timestamp=2022-11-28T17:20:59.037-0500
2022-11-28T17:20:59.040-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:59 [DEBUG][DCL INFO] [RequestID:lmzky1bm]  Google API Response: (id x8lc0) 
-----------[RESPONSE]----------
HTTP/2.0 403 Forbidden
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Mon, 28 Nov 2022 22:20:59 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
  "error": {
    "code": 403,
    "message": "Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the firebaserules.googleapis.com. We recommend configuring the billing/quota_project setting in gcloud or using a service account through the auth/impersonate_service_account setting. For more information about service accounts and how to use them in your application, see https://cloud.google.com/docs/authentication/. If you are getting this error with curl or similar tools, you may need to specify 'X-Goog-User-Project' HTTP header for quota and billing purposes. For more information regarding 'X-Goog-User-Project' header, please check https://cloud.google.com/apis/docs/system-parameters.",
    "status": "PERMISSION_DENIED",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.ErrorInfo",
        "reason": "SERVICE_DISABLED",
        "domain": "googleapis.com",
        "metadata": {
          "service": "firebaserules.googleapis.com",
          "consumer": "projects/NNNNNNNNNNNNN"
        }
      }
    ]
  }
}

-------[END RESPONSE]--------: timestamp=2022-11-28T17:20:59.037-0500
2022-11-28T17:20:59.040-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:59 [DEBUG][DCL INFO] Error appears not to be retryable: googleapi: Error 403: Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the firebaserules.googleapis.com. We recommend configuring the billing/quota_project setting in gcloud or using a service account through the auth/impersonate_service_account setting. For more information about service accounts and how to use them in your application, see https://cloud.google.com/docs/authentication/. If you are getting this error with curl or similar tools, you may need to specify 'X-Goog-User-Project' HTTP header for quota and billing purposes. For more information regarding 'X-Goog-User-Project' header, please check https://cloud.google.com/apis/docs/system-parameters.
Details:
[
  {
    "@type": "type.googleapis.com/google.rpc.ErrorInfo",
    "domain": "googleapis.com",
    "metadata": {
      "consumer": "projects/NNNNNNNNNNNNN",
      "service": "firebaserules.googleapis.com"
    },
    "reason": "SERVICE_DISABLED"
  }
]: timestamp=2022-11-28T17:20:59.037-0500
2022-11-28T17:20:59.039-0500 [ERROR] vertex "import google_firebaserules_ruleset.reglasfirestore result" error: Error when reading or editing FirebaserulesRuleset "projects/PPPPPPPPPPPPP/rulesets/RRRRRRRRRRRRR": googleapi: Error 403: Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the firebaserules.googleapis.com. We recommend configuring the billing/quota_project setting in gcloud or using a service account through the auth/impersonate_service_account setting. For more information about service accounts and how to use them in your application, see https://cloud.google.com/docs/authentication/. If you are getting this error with curl or similar tools, you may need to specify 'X-Goog-User-Project' HTTP header for quota and billing purposes. For more information regarding 'X-Goog-User-Project' header, please check https://cloud.google.com/apis/docs/system-parameters.
Details:
[
  {
    "@type": "type.googleapis.com/google.rpc.ErrorInfo",
    "domain": "googleapis.com",
    "metadata": {
      "consumer": "projects/NNNNNNNNNNNNN",
      "service": "firebaserules.googleapis.com"
    },
    "reason": "SERVICE_DISABLED"
  }
]
2022-11-28T17:20:59.040-0500 [ERROR] provider.terraform-provider-google_v4.44.1_x5: Response contains error diagnostic: tf_req_id=07a47838-9418-eab7-0be1-d3d3cb973e20 tf_resource_type=google_firebaserules_ruleset diagnostic_detail= diagnostic_severity=ERROR diagnostic_summary="Error when reading or editing FirebaserulesRuleset "projects/PPPPPPPPPPPPP/rulesets/RRRRRRRRRRRRR": googleapi: Error 403: Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the firebaserules.googleapis.com. We recommend configuring the billing/quota_project setting in gcloud or using a service account through the auth/impersonate_service_account setting. For more information about service accounts and how to use them in your application, see https://cloud.google.com/docs/authentication/. If you are getting this error with curl or similar tools, you may need to specify 'X-Goog-User-Project' HTTP header for quota and billing purposes. For more information regarding 'X-Goog-User-Project' header, please check https://cloud.google.com/apis/docs/system-parameters.
Details:
[
  {
    "@type": "type.googleapis.com/google.rpc.ErrorInfo",
    "domain": "googleapis.com",
    "metadata": {
      "consumer": "projects/NNNNNNNNNNNNN",
      "service": "firebaserules.googleapis.com"
    },
    "reason": "SERVICE_DISABLED"
  }
]" tf_rpc=ReadResource @caller=github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/internal/diag/diagnostics.go:56 @module=sdk.proto tf_proto_version=5.2 tf_provider_addr=provider timestamp=2022-11-28T17:20:59.038-0500
2022-11-28T17:20:59.040-0500 [ERROR] vertex "google_firebaserules_ruleset.reglasfirestore (import id \"projects/PPPPPPPPPPPPP/rulesets/RRRRRRRRRRRRR\")" error: Error when reading or editing FirebaserulesRuleset "projects/PPPPPPPPPPPPP/rulesets/RRRRRRRRRRRRR": googleapi: Error 403: Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the firebaserules.googleapis.com. We recommend configuring the billing/quota_project setting in gcloud or using a service account through the auth/impersonate_service_account setting. For more information about service accounts and how to use them in your application, see https://cloud.google.com/docs/authentication/. If you are getting this error with curl or similar tools, you may need to specify 'X-Goog-User-Project' HTTP header for quota and billing purposes. For more information regarding 'X-Goog-User-Project' header, please check https://cloud.google.com/apis/docs/system-parameters.
Details:
[
  {
    "@type": "type.googleapis.com/google.rpc.ErrorInfo",
    "domain": "googleapis.com",
    "metadata": {
      "consumer": "projects/NNNNNNNNNNNNN",
      "service": "firebaserules.googleapis.com"
    },
    "reason": "SERVICE_DISABLED"
  }
]
2022-11-28T17:20:59.040-0500 [ERROR] vertex "google_firebaserules_ruleset.reglasfirestore (expand)" error: Error when reading or editing FirebaserulesRuleset "projects/PPPPPPPPPPPPP/rulesets/RRRRRRRRRRRRR": googleapi: Error 403: Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the firebaserules.googleapis.com. We recommend configuring the billing/quota_project setting in gcloud or using a service account through the auth/impersonate_service_account setting. For more information about service accounts and how to use them in your application, see https://cloud.google.com/docs/authentication/. If you are getting this error with curl or similar tools, you may need to specify 'X-Goog-User-Project' HTTP header for quota and billing purposes. For more information regarding 'X-Goog-User-Project' header, please check https://cloud.google.com/apis/docs/system-parameters.
Details:
[
  {
    "@type": "type.googleapis.com/google.rpc.ErrorInfo",
    "domain": "googleapis.com",
    "metadata": {
      "consumer": "projects/NNNNNNNNNNNNN",
      "service": "firebaserules.googleapis.com"
    },
    "reason": "SERVICE_DISABLED"
  }
]
2022-11-28T17:20:59.184-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:59 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Mon, 28 Nov 2022 22:20:59 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
 "name": "projects/PPPPPPPPPPPPP/billingInfo",
 "projectId": "PPPPPPPPPPPPP",
 "billingAccountName": "billingAccounts/BBBBBBBBBBBBB",
 "billingEnabled": true
}
-----------------------------------------------------: timestamp=2022-11-28T17:20:59.184-0500
2022-11-28T17:20:59.185-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:59 [DEBUG] Retry Transport: Stopping retries, last request was successful: timestamp=2022-11-28T17:20:59.184-0500
2022-11-28T17:20:59.185-0500 [INFO]  provider.terraform-provider-google_v4.44.1_x5: 2022/11/28 17:20:59 [DEBUG] Retry Transport: Returning after 1 attempts: timestamp=2022-11-28T17:20:59.184-0500
data.google_project.proyecto: Read complete after 1s [id=projects/PPPPPPPPPPPPP]
2022-11-28T17:20:59.188-0500 [INFO]  ReferenceTransformer: reference not found: "google_secret_manager_secret.llave_firma_token"
2022-11-28T17:20:59.188-0500 [DEBUG] ReferenceTransformer: "google_secret_manager_secret_iam_member.llave_firma_token_acceso" references: []
2022-11-28T17:20:59.188-0500 [INFO]  ReferenceTransformer: reference not found: "google_secret_manager_secret.paypal_secret_id"
2022-11-28T17:20:59.188-0500 [DEBUG] ReferenceTransformer: "google_secret_manager_secret_iam_member.paypal_secret_id_acceso" references: []
2022-11-28T17:20:59.189-0500 [INFO]  ReferenceTransformer: reference not found: "google_secret_manager_secret.paypal_client_id"
2022-11-28T17:20:59.189-0500 [DEBUG] ReferenceTransformer: "google_secret_manager_secret_iam_member.paypal_client_id_acceso" references: []
β•·
β”‚ Error: Error when reading or editing FirebaserulesRuleset "projects/PPPPPPPPPPPPP/rulesets/RRRRRRRRRRRRR": googleapi: Error 403: Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the firebaserules.googleapis.com. We recommend configuring the billing/quota_project setting in gcloud or using a service account through the auth/impersonate_service_account setting. For more information about service accounts and how to use them in your application, see https://cloud.google.com/docs/authentication/. If you are getting this error with curl or similar tools, you may need to specify 'X-Goog-User-Project' HTTP header for quota and billing purposes. For more information regarding 'X-Goog-User-Project' header, please check https://cloud.google.com/apis/docs/system-parameters.
β”‚ Details:
β”‚ [
β”‚   {
β”‚     "@type": "type.googleapis.com/google.rpc.ErrorInfo",
β”‚     "domain": "googleapis.com",
β”‚     "metadata": {
β”‚       "consumer": "projects/NNNNNNNNNNNNN",
β”‚       "service": "firebaserules.googleapis.com"
β”‚     },
β”‚     "reason": "SERVICE_DISABLED"
β”‚   }
β”‚ ]
β”‚ 
β”‚ 
β•΅

2022-11-28T17:20:59.487-0500 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2022-11-28T17:20:59.491-0500 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.44.1/linux_amd64/terraform-provider-google_v4.44.1_x5 pid=14515
2022-11-28T17:20:59.491-0500 [DEBUG] provider: plugin exited
$
edwardmedia commented 1 year ago

@saulortega is below account the owner of the project?

sssssssssssss@gmail.com

Which gcloud command were you using? Can you try the 2nd one before you run apply gcloud auth login gcloud auth application-default login

saulortega commented 1 year ago

@saulortega is below account the owner of the project?

sssssssssssss@gmail.com

Yes it is.

Which gcloud command were you using? Can you try the 2nd one before you run apply gcloud auth login gcloud auth application-default login

Same error after each of those.

gcloud auth application-default login:

Credentials saved to file: [/home/saul/.config/gcloud/application_default_credentials.json]

These credentials will be used by any library that requests Application Default Credentials (ADC).

gcloud auth login:

You are now logged in as [sssssssssssss@gmail.com].
Your current project is [PPPPPPPPPPPP].  You can change this setting by running:
  $ gcloud config set project PROJECT_ID

My default project is the same as the one configured in terraform.

saulortega commented 1 year ago

After checking out the code of this repo, and the Google documetnation, I figured it out.

When you works with multiple projects, it seems the "billing project" doesn't change in your environment when you switch your "project". So you need to specify it (https://github.com/hashicorp/terraform-provider-google/blob/main/google/config.go#L506):

Before:

provider "google" {
  project = local.proyecto[terraform.workspace]
  region  = "us-central1"
  zone    = "us-central1-c"
}

After:

provider "google" {
  project = local.proyecto[terraform.workspace]
  region  = "us-central1"
  zone    = "us-central1-c"

  user_project_override = true
  billing_project       = local.proyecto[terraform.workspace]
}

Now it works.

(This "billing project" thing seems to affect some things from Firebase, but not in GCloud outside Firebase)

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.