Configure a Firestore database

Application Design Center lets you configure connections and parameters for Firestore, a flexible, scalable NoSQL database for mobile, web, and server development. Configurable parameters are based on the terraform-google-firestore Terraform module on GitHub.

Component connections

The following table includes the components that you can connect to a Firestore database, and the resulting updates to your application and its generated Terraform code.

Connected component Application updates Background information
Compute Engine instance template
  • The roles/datastore.user Identity and Access Management (IAM) role is granted to the Compute Engine instance template service account.
  • The Firestore database ID is added to the Compute Engine instance template metadata.
Configure per-database access permissions
Cloud Run
  • The roles/datastore.user IAM role is granted to the Cloud Run service account.
  • The Firestore database ID is added to the Cloud Run service environment variables.
Configure per-database access permissions

Required configuration parameters

If your template includes a Firestore component, you must configure the following parameters before you deploy.

Parameter name Description and constraint information Background information
Project ID The project where you want to deploy the Firestore instance. Creating and managing projects
Database ID The ID of the Firestore database. Defaults to (default). Database ID
Region The location where the Firestore database is deployed. Locations

Optional configuration parameters

The following parameters are optional. To display advanced parameters, in the Configuration area, select Show advanced fields.

Feature Parameter name Description and constraint information Background information
Database Type DatabaseType Choosing between Native mode and Datastore mode
Database Edition DatabaseEdition Firestore editions overview
Concurrency Mode ConcurrencyMode Concurrency modes
Delete Protection State DeleteProtectionState Delete protection
KMS Key Name kmsKeyName Customer-managed encryption keys
Point In Time Recovery Enablement PointInTimeRecoveryEnablement Point-in-time recovery overview
Deletion Policy The deletion policy to be enforced when the Firestore database is destroyed using Terraform. Terraform deletion_policy
Backup Schedule Weekly Recurrence Day day Back up and restore data
Backup Schedule Weekly Recurrence Retention retention Back up and restore data
Backup Schedule Daily Recurrence Retention retention Back up and restore data
Composite Index Index ID The ID of the composite index. Indexing overview
Composite Index Collection The collection ID. Indexing overview
Composite Index Query Scope queryScope Indexing overview
Composite Index API Scope apiScope Indexing overview
Composite Index Density density Indexing overview
Composite Index Multikey multikey Indexing overview
Composite Index Field Path fieldPath Indexing overview
Composite Index Order order Indexing overview
Composite Index Array Config arrayConfig Indexing overview
Composite Index Vector Dimension dimension Indexing overview
Field Configuration Collection The collection ID. Single field indexes
Field Configuration Field field Single field indexes
Field Configuration TTL Enabled TtlConfig Single field indexes
Field Configuration Ascending Index Query Scope IndexConfig Single field indexes
Field Configuration Descending Index Query Scope IndexConfig Single field indexes
Field Configuration Array Index Query Scope IndexConfig Single field indexes