google_firestore_backup_schedule

A backup schedule for a Cloud Firestore Database. This resource is owned by the database it is backing up, and is deleted along with the database. The actual backups are not though.

To get more information about BackupSchedule, see:

Example Usage - Firestore Backup Schedule Daily

resource "google_firestore_database" "database" {
  project     = "my-project-name"
  name        = "database-id"
  location_id = "nam5"
  type        = "FIRESTORE_NATIVE"

  delete_protection_state = "DELETE_PROTECTION_ENABLED"
  deletion_policy         = "DELETE"
}

resource "google_firestore_backup_schedule" "daily-backup" {
  project  = "my-project-name"
  database = google_firestore_database.database.name

  retention = "8467200s" // 14 weeks (maximum possible retention)

  daily_recurrence {}
}

Example Usage - Firestore Backup Schedule Weekly

resource "google_firestore_database" "database" {
  project     = "my-project-name"
  name        = "database-id"
  location_id = "nam5"
  type        = "FIRESTORE_NATIVE"

  delete_protection_state = "DELETE_PROTECTION_ENABLED"
  deletion_policy         = "DELETE"
}

resource "google_firestore_backup_schedule" "weekly-backup" {
  project  = "my-project-name"
  database = google_firestore_database.database.name

  retention = "8467200s" // 14 weeks (maximum possible retention)

  weekly_recurrence {
    day = "SUNDAY"
  }
}

Argument Reference

The following arguments are supported:


The weekly_recurrence block supports:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

BackupSchedule can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import BackupSchedule using one of the formats above. For example:

import {
  id = "projects/{{project}}/databases/{{database}}/backupSchedules/{{name}}"
  to = google_firestore_backup_schedule.default
}

When using the terraform import command, BackupSchedule can be imported using one of the formats above. For example:

$ terraform import google_firestore_backup_schedule.default projects/{{project}}/databases/{{database}}/backupSchedules/{{name}}
$ terraform import google_firestore_backup_schedule.default {{project}}/{{database}}/{{name}}
$ terraform import google_firestore_backup_schedule.default {{database}}/{{name}}

User Project Overrides

This resource supports User Project Overrides.