【发布时间】:2020-11-11 19:13:23
【问题描述】:
在将现有基础架构迁移到“基础架构即代码”设置时,我们还需要导入现有 Firebase 项目。
按照GCP beta Terraform provider 的说明进行操作。在对应的terraform模块中添加了以下sn-p。
resource "google_firebase_project" "default" {
provider = google-beta
project = "my-project-id"
}
通过运行命令启动现有 Firebase 项目的导入
terraform import google_firebase_project.default my-project-id
这导致了以下输出:
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/.
错误是在使用服务帐户运行 Terraform 或使用最终用户帐户模拟服务帐户时获得的。所有身份都拥有相应 GCP 项目的 Owner 权限。
【问题讨论】:
-
您好,您遇到过解决方案吗?我也遇到了 firebase api 的凭据错误。
-
不,我们已经在我们组织的新项目中删除了 Firebase 的使用,因为 API 不足以作为成熟的代码软件交付工作流。如果您具备良好的 terraform 技能,则可以从 GCP 原生资源中获得相同的技能,而无需更少的技术债务和更多的可能性。
标签: firebase google-cloud-platform terraform