-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Support for Firebase #2973
Comments
Hello, I started looking into this issue since I would like to create firebase projects from terraform but I ran into a couple of issues.
The result is a PERMISSION_DENIED error even though I used the key from a service account which is owner of the project:
The strange thing is that if I try to perform the request on the API Explorer from the addFirebase Reference with the same body and same project parameter, the Firebase project is created successfully. |
Facing same issue. As per link can not call |
That does make this issue a bit of a nonstarter for Terraform - it is very uncommon to use Terraform from a user account, and so this resource will not work for the majority of users. Given that, I do not think we want to add it right now, even though it has (as of now) 155 votes. I have re-raised this issue internally at Google, and will update if anything comes of it. |
Came here interested in this as well. Digging a little deeper, Google APIs already have Go support, and support for firebase v1beta1 and a lot more stuff ... |
Yes, that is not the issue - it would work if you used a user account, but if you use a service account (as most people do, and as we strongly recommend) it will not work correctly. I expect this issue to be permanent after looking into it further internally, unfortunately. I'll leave this open so people searching can find it and see the explanation for why it doesn't exist. |
@josephlewis42 Hi - doesn't this already exist? https://github.com/elislusarczyk/terraform-provider-firebase |
@veeral-patel that provider will configure firebase resources given an existing firebase user and service account key file. This issue is about setting up firebase inside a GCP project in the first place. However, as per @ndmckinley's comment, it seems like there is no interest at Google internally to support this particular workflow so we may have to be content with not having it. |
@ndmckinley wrote:
I don't see any explanation, just "it will not work correctly" and "I expect this issue to be permanent". This issue creates several manual steps in our deployment of services that send push notifications to our Android app. Google Firebase Cloud Messaging is the only way to send Android push notifications. This is an example of API Practices If You Hate Your Customers - Technique #8: Ignore the IaC revolution. I read the Google SRE book and learned how Google strives to eliminate toil, especially manual operations tasks. But they do that for themselves, not for us customers. By ignoring this issue, Google Cloud is preventing us from using SRE best-practices. |
I contacted our google accountmanager about this issue, and after that he disappeared completly. Hasn't replied to any mail or call in three weeks. It looks like firebase + terraform is a a no-go area for Google :-( |
My TAM pointed me here: https://cloud.google.com/sdk/gcloud/reference/alpha/firestore/databases/create. I'm hopeful that this will migrate up the chain, but haven't researched more. |
I'm removing the It's possible for us to implement, given the API exists, although it's a frustrating limitation that service accounts can't call it. Not only does that conflict with our (and generally the rest of GCP's) guidance to prefer service accounts, but it means that we won't be able to run our nightly tests to check for regressions as they're using SA credentials. It's possible we'll need to work out how to get Regardless, we'll evaluate the request again and post an update here, likely around early next week. @duffenterprises: That's more relevant for enabling Firestore I think, #3657. |
@rileykarson Is there anything we can do other than beating the drum at our respective TAM / sales contacts to apply pressure on the service account aspect of this issue? |
@rileykarson Would quoting the Bezos mandate a few times help? @eriksw I'll drum my TAM / Account Partner as well. 1 yr from the issue being raised, 300 or so up votes, and "Cloud Firestore is the next generation of Cloud Datastore. Learn more about upgrading to Cloud Firestore" and I'm surprised we are no further forward in either issue. I acknowledge the naming of the products makes it difficult to make sure we are on the same page, alas. That being said, appreciate the promise of an update. |
@eriksw @duffenterprises: I just added a paragraph about how GCP-internal folks like TAMs can raise awareness of your requests with my team: https://github.com/terraform-providers/terraform-provider-google/wiki/Customer-Contact#raising-gcp-internal-issues-with-the-provider-development-team. I don't think Firebase has come up before internally, and I can't find any internal bugs my team has been CC'ed on. That should help focus efforts some more, at least. Re: Firestore, we're tracking the bug requesting the team publishes an API endpoint for Firestore enablement on projects. |
It looks firebase team has just recently added support for service accounts even though much of the documentation hasn't caught up yet. GoogleCloudPlatform/magic-modules#3281 is to support the addFirebase behavior to enable this on a given google project which I believe is the most critical part of supporting Firebase. The surface area of the Firebase APIs is pretty large and evolving and not all of it makes sense to provision with Terraform resources (like hosting site). I'm going to ask that if there are other features of Firebase that people want to manage that you file a new resource request and link back to this issue so we can keep use-cases, context and discussion per feature. |
Closing this as it will be added in 3.15.0 |
Finalize location resource coming in 3.16.0 thanks to @yinzara |
I've got the "WebApp" resource working locally in my development environment now. I just gotta get an official release of it. |
WebApp resource coming soon too |
Did this make it into 3.15.0? |
It's available in |
Thanks for adding the How about also adding more resources?
The project elislusarczyk/terraform-provider-firebase is maintained by individuals and provides only a |
@mleonhard We can add more resources but can you file them as new issues please? This allows us to prioritize our work based on the need per resource by letting the community weigh in with 👍's. Feel free to link back to this issue for discoverability. |
@chrisst I think with our recent merge of "google_firebase_project_location" somehow we messed up the doc generation: The side menu now only shows "google_firebase_project_location" under the Firebase Resources and does not show "google_firebase_project. |
@yinzara just me being bad at html. GoogleCloudPlatform/magic-modules#3390 will fix. Thanks for catching. |
Is there support for enabling the google signon or redirect domains? |
Unfortunately this API doesn't even exist for that yet. The UI is the only way to set that up. So there's no way we could enhance the terraform provider to do that at this time. |
@chrisst could you elaborate why it would not make sense to provision Firebase Hosting with Terraform? I would love to try to get firebasehosting to work with Magic Modules, and thus terraform. But I am wondering why/if this is a bad idea I should abbandon.
|
I believe, with the additional of "google_firebase_web_app", you can provision Firebase Hosting. The issue is with the custom domain mapping. There are no APIs to manage that as of yet. |
AFAIK the firebase_web_app resource is from https://firebase.google.com/docs/projects/api/reference/rest/v1beta1/projects.webApps which only registers a web app, which gives you the configuration to include in the html/js code to communicate to the Firebase backend. But this doesn’t setup hosting. Hosting is from the API at https://firebase.google.com/docs/hosting/reference/rest I could give the firebase hosting API a try, but it probably needs some custom coding as it has an API that is a bit awkward. It’s not just a simple reference to a storage bucket, but you first need to register the number of files and their hashes, then wait for a response which files are still unknown to firebase hosting and should be uploaded. The flow is explained at https://firebase.google.com/docs/hosting/api-deploy |
Oh ok. now I understand what you're meaning. Hmmmm I probably would have to agree with @chrisst on this one. The whole idea of application code deployment is not something in general Terraform is best used for. Terraform is great for infrastructure as code (i.e. setting up the infrastructure for an application) but deploying a version of that application is usually left up to other tools. I won't say there aren't cases where this is handled (i.e. the "helm" provider is a good example) but I feel like using an automated build process with the "firebase" CLI is much better suited for the use case you describe. |
@wvanderdeijl In my experience Terraform isn't always the best tool for managing software (like) deployments. It can be difficult to declaratively manage things like incremental roll outs, canary deploys or automated rollbacks of code. This isn't to say it's not possible but if Terraform redeploys a broken version of code that had been rolled back it wouldn't be ideal. There are many release pipeline type solutions that are usually a better choice for these types of actions. However we aren't always aware of the context that people will be using these features in so if you think it makes sense for your workflow then feel free to open a new issue/feature request. In it I recommend adding as much context as you can for how you intend to use the feature. The issue can serve as a place to discuss these use cases and possible alternatives in more detail. |
I'm locking this conversation as most of these discussions are more relevant in individual feature requests instead of this broader forum. Feel free to back link for discoverability. |
Community Note
Description
Firebase is Google's "preferred" way to do various common tasks in GCP, so being able to at least set up a GCP project to use Firebase with Terraform would unlock a lot of potenaitl. For example:
New or Affected Resource(s)
Potential Terraform Configuration
References
Request comes from:
See this doc for API:
Discovery Docs:
The text was updated successfully, but these errors were encountered: