Skip to content
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

Set Firestore database mode #12294

Closed
AdamMAtWork opened this issue Aug 10, 2022 · 3 comments
Closed

Set Firestore database mode #12294

AdamMAtWork opened this issue Aug 10, 2022 · 3 comments

Comments

@AdamMAtWork
Copy link

AdamMAtWork commented Aug 10, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

Firestore is a component of Firebase. Firestore supports two modes of operation: Native and Datastore. The current google_firebase_project resource does not support specifying the Firestore mode. Since the mode cannot be changed after data is added, it's important to get this setting correct as soon as Firestore is enabled for the project.

There are 2 problems with the current implementation of google_firebase_project:

  1. It does not support specifying the Firestore mode
  2. It creates Firestore in Datastore mode. A separate call using gcloud or the REST api is required to set Native mode.

The google_firebase_project resource should support specifying the Firestore mode (or some other method of specifying the firestore mode should be added)

The default Firestore mode should be "Native", since Datastore mode is going away.

New or Affected Resource(s)

  • google_app_engine_application

Potential Terraform Configuration

resource "google_firebase_project" "immutable" {
  project  = "my_firebase_project"
  firestore_mode = "native"

  lifecycle {
    ignore_changes = [ firestore_mode ]
  }
}

OR, as a boolean option:

resource "google_firebase_project" "immutable" {
  project  = "my_firebase_project"
  firestore_native_mode = true

  lifecycle {
    ignore_changes = [ firestore_native_mode ]
  }
}

References

https://cloud.google.com/datastore/docs/firestore-or-datastore
b/277382009

@c2thorn c2thorn added the size/s label Aug 15, 2022
@c2thorn c2thorn added this to the Goals milestone Aug 15, 2022
@tylerg-dev
Copy link

Firestore mode is not managed as part of the FirebaseProject. The current way to manage this is through app_engine_application#database_type

@rainshen49
Copy link
Contributor

rainshen49 commented Apr 11, 2023

Update: you can specify the Firestore database mode directly now with google_firestore_database. Note that the usual limitation apply (your Firestore database should be empty). This issue can be marked as fixed now.

@roaks3 roaks3 closed this as completed Jul 20, 2023
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants