While migrating our existing infrastructure into an "Infrastructure as Code" Setup, we also needed to import an existing Firebase Project.
Following the instructions from the GCP beta Terraform provider. The following snippet was added to the corresponding terraform module.
resource "google_firebase_project" "default" {
provider = google-beta
project = "my-project-id"
}
The Import of the existing Firebase project was initiated by running the command
terraform import google_firebase_project.default my-project-id
This led to the following output:
google_firebase_project.default: Importing from ID "my-project-id"...
google_firebase_project.default: Import prepared!
Prepared google_firebase_project for import
google_firebase_project.default: Refreshing state... [id=projects/my-project-id]
Error: Error when reading or editing FirebaseProject "projects/my-project-id": 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 firebase.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/.
The error was obtained running Terraform with a Service Account or using a end user account to impersonate a service account. All identities had Owner permissions on the corresponding GCP project.