firestore library

Cloud Firestore — Native and Datastore mode databases + composite index management.

Classes

FirestoreBackupScheduleBackupRecurrence
Choice of recurrence for a GoogleFirestoreBackupSchedule. Sealed so the dichotomy is exhaustive at the type level. The Firestore service requires exactly one of daily_recurrence / weekly_recurrence -- the schema marks both as independently optional but rejects schedules with neither or both.
FirestoreBackupScheduleDailyRecurrence
daily_recurrence block. Carries no fields -- its presence alone signals "run every day". The encoded value is a single empty map (matching the schema's max_items: 1, list shape).
FirestoreBackupScheduleWeeklyRecurrence
weekly_recurrence block. Optional day specifies which weekday the backup runs on; when null, the provider defaults to the schema's DAY_OF_WEEK_UNSPECIFIED (server picks). Pin a specific day for predictable backup windows.
FirestoreDatabaseCmekConfig
cmek_config block (single, max_items=1). Wraps the database in Customer-Managed Encryption. Setting this on an existing database forces replacement -- CMEK cannot be added or removed in place.
FirestoreFieldIndexConfig
index_config block (max_items=1). Overrides Firestore's automatic single-field indexing for the parent field. An empty indexes list disables all single-field indexes on the field; a populated list adds explicit per-field indexes (mix of ordered / array-contains).
FirestoreFields
Static factory for Firestore document fields wire-format JSON.
FirestoreFieldSingleFieldIndex
One entry in index_config.indexes. Pick exactly one of order (ranged / equality / ORDER BY) or arrayContains (array-contains queries) -- the schema marks them mutually exclusive ("Only one of 'order' and 'arrayConfig' can be specified"). queryScope is independent and defaults to COLLECTION server-side.
FirestoreFieldTtlConfig
ttl_config block (max_items=1). Presence alone enables the TTL policy on the parent field -- the schema's single attribute (state) is computed and read-only. Pass const FirestoreFieldTtlConfig() to enable; omit to disable.
FirestoreGeoPoint
Sentinel value for Firestore geoPointValue — a latitude/longitude pair.
FirestoreIndexIndexField
One entry in fields[]. Each indexed field declares either an FirestoreIndexIndexFieldOrder (range queries / equality / ORDER BY) or an FirestoreIndexIndexFieldArrayConfig (array-contains queries) via spec. The schema's commented exactly_one_of constraint over order / array_config / search_config / vector_config is modeled at the type level by the sealed FirestoreIndexIndexFieldSpec dispatch.
FirestoreIndexIndexFieldArrayConfig
Array-contains dimension for a field. Firestore only supports 'CONTAINS' as the array config today, so no parameter is exposed.
FirestoreIndexIndexFieldOrder
Range / equality / order-by dimension for a field. Pair FirestoreIndexOrder.descending to flip the per-field direction.
FirestoreIndexIndexFieldSearchConfig
Text-search dimension for a field (Firestore Vector Search / full-text search). The schema models this as a nested block with geo_spec + text_spec; only text_spec is exposed here because geo_spec requires a single boolean knob and merits a separate variant if/when needed.
FirestoreIndexIndexFieldSpec
Sealed dispatch for FirestoreIndexIndexField.spec. Models the schema's exactly_one_of (order / array_config / search_config / vector_config) at the type level. Subclasses encode their own Terraform key.
FirestoreIndexIndexFieldTextSpec
search_config.text_spec block. Carries a list of FirestoreIndexIndexFieldTextSpecEntry entries (one per index_spec the user wants to configure -- e.g. one for substring matching, one for prefix matching of the same field).
FirestoreIndexIndexFieldTextSpecEntry
One entry in text_spec.index_specs. Both fields are schema-optional; combinations are documented in https://firebase.google.com/docs/firestore/text-search.
FirestoreIndexIndexFieldVectorConfig
Vector-search dimension for a field. The schema requires dimension plus a marker flat sub-block; the wrapper emits both.
FirestoreReference
Sentinel value for Firestore referenceValue — a document path of the form projects/<project>/databases/<db>/documents/<col>/<doc>....
GoogleFirestoreBackupSchedule
Factory wrapper for google_firestore_backup_schedule.
GoogleFirestoreDatabase
Factory wrapper for google_firestore_database (provider hashicorp/google ~> 7.0).
GoogleFirestoreDocument
Factory wrapper for google_firestore_document (provider hashicorp/google ~> 7.0).
GoogleFirestoreField
Factory wrapper for google_firestore_field.
GoogleFirestoreIndex
Factory wrapper for google_firestore_index (provider hashicorp/google ~> 7.0).
GoogleFirestoreUserCreds
Factory wrapper for google_firestore_user_creds.

Enums

AppEngineIntegrationMode
app_engine_integration_mode -- whether the database participates in the legacy App Engine integration. Only meaningful for Datastore-mode databases that were originally provisioned via App Engine.
BackupDayOfWeek
weekly_recurrence.day -- which day of the week the weekly backup runs on. dayOfWeekUnspecified is the schema-default sentinel (server picks the day); the seven concrete weekdays pin the slot.
ConcurrencyMode
concurrency_mode -- transaction concurrency strategy. optimistic is the default for Native mode; pessimistic is the default for Datastore mode. optimisticWithEntityGroups is a legacy Datastore-mode option.
DatabaseEdition
database_edition -- pricing + feature tier. enterprise unlocks the MongoDB-compatible / Realtime-Updates / Data-Access modes but forces type to be firestoreNative.
DeleteProtectionState
delete_protection_state -- when enabled, the database refuses delete operations until protection is disabled. Default unspecified (server-side equivalent to disabled).
FirestoreDataAccessMode
firestore_data_access_mode -- whether the Firestore document API is accessible. Only valid for enterprise edition. Use to lock down a database to MongoDB-compatible / Realtime-Updates access only.
FirestoreDatabaseType
type -- choose between Cloud Firestore's two API modes. Forces replacement when changed.
FirestoreFieldOrder
One FirestoreFieldSingleFieldIndex.order direction. ASCENDING / DESCENDING.
FirestoreFieldQueryScope
query_scope -- which queries can use this single-field index. collection scopes the index to a single collection; collectionGroup allows the index to serve collection-group queries.
FirestoreIndexApiScope
api_scope -- which Firestore API surface the index targets. anyApi (the default) serves both the Firestore native API and the Datastore-mode API; the others restrict to one.
FirestoreIndexDeletionPolicy
deletion_policy -- behaviour on terraform destroy. delete (the default) tears the index down both in state and in GCP. prevent keeps the index in GCP and FAILS the destroy -- a safety mode for indexes that back production queries.
FirestoreIndexDensity
density -- whether the index includes documents that are missing the indexed fields. sparseAll only indexes documents with values for ALL fields (the default for composite indexes); sparseAny indexes documents with ANY field; dense indexes every document.
FirestoreIndexOrder
One FirestoreIndexIndexField.spec dimension. Pairs with FirestoreIndexOrder.descending to flip the per-field index direction.
FirestoreIndexQueryScope
query_scope -- which queries can use this index. collection (the default) limits the index to queries scoped to a single collection; collectionGroup allows collection-group queries; collectionRecursive also covers descendant collection groups.
MongodbCompatibleDataAccessMode
mongodb_compatible_data_access_mode -- whether the MongoDB-compatible API is accessible. Only valid for enterprise edition.
PointInTimeRecoveryEnablement
point_in_time_recovery_enablement -- when enabled, reads can target timestamps within the past 7 days (1-minute granularity beyond the most-recent hour). Default disabled.
RealtimeUpdatesMode
realtime_updates_mode -- whether the WebSocket-based realtime listener API is accessible. Only valid for enterprise edition.